View Single Post
Old 07-03-2009, 08:41 PM   #1
Rexgr
Registered User
 
Last Online: 08-17-2009 12:24 AM
Join Date: May 2009
Posts: 28
Rep Power: 0
Rep Points: 10
Rexgr is on a distinguished road
Feedback: (0)
Points: 3,644.09
Bank: 0.00
Total Points: 3,644.09
Vb.net need help with a exp calculator

Hey guys im making a exp calculator for fishing on a game. I am pretty new to programming and I am unsure on how to calculate the multiple values that are needed to calculate the exp. I will post the code I have so far most of it is useless because i was just experimenting but if someone could fix up my code or give me advice that would be much appreciated!

Numfish is the ammount of fish the user has.
numcat is the number of cat fish a user has.
num pig is the number of piglet fish a user has.
num spec is the number of special items a user has.

Code:
Public Class Form1

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim numfish As Integer = TextBox1.Text
        Dim numcat As Integer = TextBox2.Text
        Dim numpig As Integer = TextBox3.Text
        Dim numspec As Integer = TextBox4.Text
        Dim fishexp As Integer = numfish
        Dim catexp As Integer = numcat * "5"
        Dim pigexp As Integer = numpig * "10"
        Dim specexp As Integer = numspec * "20"
        Dim dofish As Integer = "0"
        Dim dopig As Integer = "0"
        Dim docat As Integer = "0"
        Dim dospec As Integer = "0"
        If CheckBox1.Checked = True Then
            dofish = "1"
        End If
        If CheckBox2.Checked = True Then
            docat = "1"
        End If
        If CheckBox3.Checked = True Then
            dopig = "1"
        End If
        If CheckBox4.Checked = True Then
            dospec = "1"
        End If
        Dim final As Integer = "0"
        Dim whatused As Integer = "0"
        If docat = "1" Then
            final = final + fishexp
        End If
        If dofish = "1" Then
            final = final + fishexp
        End If
        If dopig = "1" Then
            final = final + pigexp
        End If
        If dospec = "1" Then
            final = final + specexp
        End If
        MessageBox.Show(final)
    End Sub
End Class
If you need anymore information or a attachment I can get it for you.
Attached Files
File Type: rar Eosep fishing exp calculator.rar (65.4 KB, 1 views)
Please scan all the files you download with NoVirusThanks before opening them. If there is a virus, report the post by clicking the button.

Last edited by Rexgr; 07-03-2009 at 08:44 PM. Reason: attachment
Rexgr is offline   Reply With Quote