Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Public Class Form1
- Dim currentXp As Integer
- Dim newXp As Integer
- Function convertXp(ByVal level As Int16)
- Dim xP As Integer
- If (level = 1) Then
- Return 0
- ElseIf (level = 2) Then
- Return 83
- Else
- For value As Integer = 2 To level
- If (value = 2) Then
- xP = 83
- Else
- xP += ((value - 1 + 300 * 2 ^ ((value - 1) / 7)) / 4)
- End If
- Next
- Return xP
- End If
- End Function
- Function convertLevel(ByVal xP As Integer)
- Dim xP2 As Integer
- If (xP < 83) Then
- Return 1
- ElseIf (xP < 174) Then
- Return 2
- Else
- For value As Integer = 2 To 100
- If (value = 2) Then
- xP2 = 83
- Else
- xP2 += ((value - 1 + 300 * 2 ^ ((value - 1) / 7)) / 4)
- If (xP2 > xP Or value = 100) Then
- Return value - 1
- End If
- End If
- Next
- Return 0
- End If
- End Function
- Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
- Try
- If Int(TextBox1.Text) < 1 Or Int(TextBox1.Text) > 75 Or Int(TextBox2.Text) < 1 Or Int(TextBox2.Text) > 75 Then
- MsgBox("Invalid XP Rate")
- ElseIf Int(TextBox3.Text) < 0 Or Int(TextBox3.Text) > 200000000 Then
- MsgBox("Invalid XP")
- Else
- ''Label2.Text = (Int(TextBox1.Text) - 1 + 300 * 2 ^ ((Int(TextBox1.Text) - 1) / 7)) / 4
- currentXp = Int(TextBox3.Text)
- newXp = currentXp / Int(TextBox1.Text) * Int(TextBox2.Text)
- If (newXp > 200000000) Then
- newXp = 200000000
- End If
- ''Label2.Text = newXp
- Label2.Text = "New Level - " + Str(convertLevel(newXp))
- Label5.Text = "New XP - " + Str(newXp)
- End If
- Catch ex As System.InvalidCastException
- MsgBox("Error: Textbox is blank!")
- End Try
- End Sub
- Private Sub LinkLabel1_LinkClicked(sender As Object, e As LinkLabelLinkClickedEventArgs) Handles LinkLabel1.LinkClicked
- Process.Start("https://indovaps.com/")
- End Sub
- Private Sub LinkLabel2_LinkClicked(sender As Object, e As LinkLabelLinkClickedEventArgs) Handles LinkLabel2.LinkClicked
- Process.Start("https://forum.indovaps.com/index.php?/profile/950-kevinf100/")
- End Sub
- Private Sub LinkLabel3_LinkClicked(sender As Object, e As LinkLabelLinkClickedEventArgs) Handles LinkLabel3.LinkClicked
- Process.Start("https://forum.indovaps.com/index.php?/topic/485-rate-change-calculator/")
- End Sub
- End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement