VB help please!

Status
Not open for further replies.

123max

Member
Original poster
member
Joined
Jul 12, 2010
Posts
1,454
Reaction score
182
Points
66
I am trying to make a minecraft keygen problem is after writing the code for hours, it works but after you generate the first code it takes 3 clicks to get the second code (which comes as 1 instead of the second random code) and then the other codes are randomized normally
can someone help me fix this please?

Code:
Code:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        TextBox1.Text = Int(Rnd() * 4)
        Select Case TextBox1.Text
            Case 0
                TextBox1.Text = "v5l4-m2s3-i5k4"
            Case 2
                TextBox1.Text = "c2d7-o4a7-b8q8"
            Case 3
                TextBox1.Text = "p7i1-f2e7-b3f8"
            Case 4
                TextBox1.Text = "u4y4-g5l2-t6l3"
            Case 5
                TextBox1.Text = "n3k8-b3p2-n6a6"
            Case 6
                TextBox1.Text = "o6v2-x6w6-l4g7"
            Case 7
                TextBox1.Text = "u3m5-a8e1-e7m3"
            Case 8
                TextBox1.Text = "i8r0-p6i2-e2b2"
            Case 9
                TextBox1.Text = "o5j2-r0p6-v5h7"
            Case 10
                TextBox1.Text = "n8l2-e6t5-j4o9"
            Case 11
                TextBox1.Text = "w4b8-x2j5-n9d7"
            Case 12
                TextBox1.Text = "g6m5-y7m9-k4t4"
            Case 13
                TextBox1.Text = "d3c5-v4h6-r2i6"
            Case 14
                TextBox1.Text = "o2c4-g8f5-b6p9"
            Case 15
                TextBox1.Text = "g2f2-h9j5-r3a8"
            Case 16
                TextBox1.Text = "t7u9-x6p7-c8s7"
            Case 17
                TextBox1.Text = "t3a5-t2w0-o7n2"
            Case 18
                TextBox1.Text = "i7f0-j1b1-o3c2"
            Case 19
                TextBox1.Text = "n4v3-l3i5-h5i6"
            Case 12
                TextBox1.Text = "y7h7-i2i5-g4g2"
            Case 13
                TextBox1.Text = "h1s4-q2b1-h6a2"
            Case 14
                TextBox1.Text = "o2q2-l0e7-p0q4"
            Case 15
                TextBox1.Text = "k2e7-r8c7-y8j3"
            Case 16
                TextBox1.Text = "l6j2-h4g7-r2a7"
            Case 17
                TextBox1.Text = "v2p2-k3s8-m8t5"
            Case 18
                TextBox1.Text = "u1n7-f8n4-g2n1"
            Case 19
                TextBox1.Text = "j6s2-w5b7-d3a6"
            Case 20
                TextBox1.Text = "x8d4-x3j3-b9j8"
            Case 21
                TextBox1.Text = "y0c5-x2o8-l2y2"
            Case 22
                TextBox1.Text = "a7s9-k5h4-p4o9"
            Case 23
                TextBox1.Text = "r3j5-r5h2-g7q5"
            Case 24
                TextBox1.Text = "t9f6-j3m8-p9g7"
            Case 25
                TextBox1.Text = "b8a3-h6m4-d9v8"
            Case 26
                TextBox1.Text = "a3c3-p7w2-y7c7"

        End Select
    End Sub
End Class
 

Ace12

Senior
senior
Joined
May 2, 2011
Posts
1,013
Reaction score
369
Points
91
Location
Toronto
Code:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        TextBox1.Text = Int(Rnd() * 30)
        Select Case TextBox1.Text
            Case 0
                TextBox1.Text = "v5l4-m2s3-i5k4"
            Case 1
                TextBox1.Text = "c2d7-o4a7-b8q8"
            Case 2
                TextBox1.Text = "p7i1-f2e7-b3f8"
            Case 3
                TextBox1.Text = "u4y4-g5l2-t6l3"
            Case 4
                TextBox1.Text = "n3k8-b3p2-n6a6"
            Case 5
                TextBox1.Text = "o6v2-x6w6-l4g7"
            Case 6
                TextBox1.Text = "u3m5-a8e1-e7m3"
            Case 7
                TextBox1.Text = "i8r0-p6i2-e2b2"
            Case 8
                TextBox1.Text = "o5j2-r0p6-v5h7"
            Case 9
                TextBox1.Text = "n8l2-e6t5-j4o9"
            Case 10
                TextBox1.Text = "w4b8-x2j5-n9d7"
            Case 11
                TextBox1.Text = "g6m5-y7m9-k4t4"
            Case 12
                TextBox1.Text = "d3c5-v4h6-r2i6"
            Case 13
                TextBox1.Text = "o2c4-g8f5-b6p9"
            Case 14
                TextBox1.Text = "g2f2-h9j5-r3a8"
            Case 15
                TextBox1.Text = "t7u9-x6p7-c8s7"
            Case 16
                TextBox1.Text = "t3a5-t2w0-o7n2"
            Case 17
                TextBox1.Text = "i7f0-j1b1-o3c2"
            Case 18
                TextBox1.Text = "n4v3-l3i5-h5i6"
            Case 19
                TextBox1.Text = "y7h7-i2i5-g4g2"
            Case 20
                TextBox1.Text = "h1s4-q2b1-h6a2"
            Case 21
                TextBox1.Text = "o2q2-l0e7-p0q4"
            Case 22
                TextBox1.Text = "k2e7-r8c7-y8j3"
            Case 23
                TextBox1.Text = "l6j2-h4g7-r2a7"
            Case 24
                TextBox1.Text = "v2p2-k3s8-m8t5"
            Case 25
                TextBox1.Text = "u1n7-f8n4-g2n1"
            Case 26
                TextBox1.Text = "j6s2-w5b7-d3a6"
            Case 27
                TextBox1.Text = "x8d4-x3j3-b9j8"
            Case 28
                TextBox1.Text = "y0c5-x2o8-l2y2"
            Case 29
                TextBox1.Text = "a7s9-k5h4-p4o9"
            Case 30
                TextBox1.Text = "r3j5-r5h2-g7q5"
            Case 31
                TextBox1.Text = "t9f6-j3m8-p9g7"
            Case 32
                TextBox1.Text = "b8a3-h6m4-d9v8"
            Case 33
                TextBox1.Text = "a3c3-p7w2-y7c7"

        End Select
    End Sub
End Class
^ just tested this and it works fine.
 
  • Like
Reactions: 123max

123max

Member
Original poster
member
Joined
Jul 12, 2010
Posts
1,454
Reaction score
182
Points
66
thanks! it works forgot that i had set Int(Rnd() * 30) as Int(Rnd() * 4)
+rep for ya
 
Status
Not open for further replies.