by Seymor Butts (1 Submission)
Category: Games
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Tue 18th February 2003
Date Added: Mon 8th February 2021
Rating: (1 Votes)
It is a powerball game and it works completley
API Declarations
Dim num1, num2, num3, num4, num5 As Integer
Dim pb As Integer
Dim U1, U2, U3, U4, U5, UPB As Integer
Dim wkount As Integer
Dim pbb As Boolean
Dim upot As Double
Dim jackpot As Double
Dim q1, q2, q3, q4, q5, q6 As Integer
Dim wwkount, llkount As Integer
Private Declare Function mciSendString Lib "winmm.dll" Alias "mciSendStringA" (ByVal lpstrCommand As String, ByVal lpstrReturnString As String, ByVal uReturnLength As Long, ByVal hwndCallback As Long) As Long
Dim lngReturn As Long
Dim strReturn As Long
End
End Sub
Private Sub cmdplay_Click()
lblupot.Visible = True
wkount = 0
pbb = False
upot = upot - 1
jackpot = jackpot + 5
lblupot.Caption = "You have $" & upot
lbljackpot.Caption = "$" & jackpot
Shape1.FillColor = vbWhite
shape2.FillColor = vbWhite
shape3.FillColor = vbWhite
shape4.FillColor = vbWhite
shape5.FillColor = vbWhite
shape6.FillColor = vbRed
Label1.Visible = True
Label2.Visible = True
Label3.Visible = True
Label4.Visible = True
Label5.Visible = True
Label6.Visible = True
Randomize
num1 = Int(Rnd * 48) + 1
Do
num2 = Int(Rnd * 48) + 1
Loop Until num2 <> num1
Do
num3 = Int(Rnd * 48) + 1
Loop Until num3 <> num2 And num3 <> num1
Do
num4 = Int(Rnd * 48) + 1
Loop Until num4 <> num3 And num4 <> num2 And num4 <> num1
Do
num5 = Int(Rnd * 48) + 1
Loop Until num5 <> num4 And num5 <> num3 And num5 <> num2 And num5 <> num1
pb = Int(Rnd * 48) + 1
Label1.Caption = num1
Label2.Caption = num2
Label3.Caption = num3
Label4.Caption = num4
Label5.Caption = num5
Label6.Caption = pb
U1 = txtunum1.Text
U2 = txtunum2.Text
U3 = txtunum3.Text
U4 = txtunum4.Text
U5 = txtunum5.Text
UPB = txtpbnum.Text
If txtunum1 = Label1.Caption Then
Shape1.FillColor = vbBlue
wkount = wkount + 1
End If
If txtunum1 = Label2.Caption Then
shape2.FillColor = vbBlue
wkount = wkount + 1
End If
If txtunum1 = Label3.Caption Then
shape3.FillColor = vbBlue
wkount = wkount + 1
End If
If txtunum1 = Label4.Caption Then
shape4.FillColor = vbBlue
wkount = wkount + 1
End If
If txtunum1 = Label5.Caption Then
shape5.FillColor = vbBlue
wkount = wkount + 1
End If
If txtunum2 = Label1.Caption Then
Shape1.FillColor = vbBlue
wkount = wkount + 1
End If
If txtunum2 = Label2.Caption Then
shape2.FillColor = vbBlue
wkount = wkount + 1
End If
If txtunum2 = Label3.Caption Then
shape3.FillColor = vbBlue
wkount = wkount + 1
End If
If txtunum2 = Label4.Caption Then
shape4.FillColor = vbBlue
wkount = wkount + 1
End If
If txtunum2 = Label5.Caption Then
shape5.FillColor = vbBlue
wkount = wkount + 1
End If
If txtunum3 = Label1.Caption Then
Shape1.FillColor = vbBlue
wkount = wkount + 1
End If
If txtunum3 = Label2.Caption Then
shape2.FillColor = vbBlue
wkount = wkount + 1
End If
If txtunum3 = Label3.Caption Then
shape3.FillColor = vbBlue
wkount = wkount + 1
End If
If txtunum3 = Label4.Caption Then
shape4.FillColor = vbBlue
wkount = wkount + 1
End If
If txtunum3 = Label5.Caption Then
shape5.FillColor = vbBlue
wkount = wkount + 1
End If
If txtunum4 = Label1.Caption Then
Shape1.FillColor = vbBlue
wkount = wkount + 1
End If
If txtunum4 = Label2.Caption Then
shape2.FillColor = vbBlue
wkount = wkount + 1
End If
If txtunum4 = Label3.Caption Then
shape3.FillColor = vbBlue
wkount = wkount + 1
End If
If txtunum4 = Label4.Caption Then
shape4.FillColor = vbBlue
wkount = wkount + 1
End If
If txtunum4 = Label5.Caption Then
shape5.FillColor = vbBlue
wkount = wkount + 1
End If
If txtunum5 = Label1.Caption Then
Shape1.FillColor = vbBlue
wkount = wkount + 1
End If
If txtunum5 = Label2.Caption Then
shape2.FillColor = vbBlue
wkount = wkount + 1
End If
If txtunum5 = Label3.Caption Then
shape3.FillColor = vbBlue
wkount = wkount + 1
End If
If txtunum5 = Label4.Caption Then
shape4.FillColor = vbBlue
wkount = wkount + 1
End If
If txtunum5 = Label5.Caption Then
shape5.FillColor = vbBlue
wkount = wkount + 1
End If
If UPB = pb Then
shape6.FillColor = vbBlue
pbb = True
End If
If pbb = True And wkount = 0 Then
MsgBox "You win $3!"
upot = upot + 3
jackpot = jackpot - 3
wwkount = wwkount + 1
ElseIf wkount = 1 And pbb = True Then
MsgBox "You win $4!"
upot = upot + 4
jackpot = jackpot - 4
wwkount = wwkount + 1
ElseIf wkount = 2 And pbb = True Then
MsgBox "You win $7!"
upot = upot + 7
jackpot = jackpot - 7
wwkount = wwkount + 1
ElseIf wkount = 3 And pbb = False Then
MsgBox "You win $7!"
upot = upot + 7
jackpot = jackpot - 7
wwkount = wwkount + 1
ElseIf wkount = 3 And pbb = True Then
MsgBox "You win $100!"
upot = upot + 100
jackpot = jackpot - 100
wwkount = wwkount + 1
ElseIf wkount = 4 And pbb = False Then
MsgBox "You win $100!"
upot = upot + 100
jackpot = jackpot - 100
wwkount = wwkount + 1
ElseIf wkount = 4 And pbb = True Then
MsgBox "You win $5000!"
upot = upot + 5000
jackpot = jackpot - 5000
wwkount = wwkount + 1
ElseIf wkount = 5 And pbb = False Then
MsgBox "You win $100000"
jackpot = jackpot - 100000
upot = upot + 100000
wwkount = wwkount + 1
ElseIf wkount = 5 And pbb = True Then
MsgBox "You hit the jackpot!!!!"
upot = upot + jackpot
jackpot = jackpot - jackpot
wwkount = wwkount + 1
End If
If jackpot <= 0 Then
jackpot = 250000
End If
If wwkount = 0 Then
llkount = llkount + 1
End If
End Sub
Private Sub Form_Load()
Label1.Visible = False
Label2.Visible = False
Label3.Visible = False
Label4.Visible = False
Label5.Visible = False
Label6.Visible = False
jackpot = 250000
upot = 1000
lblupot.Visible = False
End Sub
Private Sub Label9_Click()
MsgBox "Pick Your Numbers and Push the Play Button!!!!"
End Sub
Private Sub mnuclose_Click()
lngReturn = mciSendString("set CDAudio door closed", strReturn, 127, 0)
End Sub
Private Sub mnufileexit_Click()
End
End Sub
Private Sub mnulosses_Click()
MsgBox "You have " & llkount & " losses!!"
End Sub
Private Sub mnuopen_Click()
lngReturn = mciSendString("set CDAudio door open", strReturn, 127, 0)
End Sub
Private Sub mnuoptionsquickpick_Click()
Randomize
q1 = Int(Rnd * 48) + 1
txtunum1.Text = q1
Do
q2 = Int(Rnd * 48) + 1
txtunum2.Text = q2
Loop Until q2 <> q1
Do
q3 = Int(Rnd * 48) + 1
txtunum3.Text = q3
Loop Until q3 <> q2 And q3 <> q1
Do
q4 = Int(Rnd * 48) + 1
txtunum4.Text = q4
Loop Until q4 <> q3 And q4 <> q2 And q4 <> q1
Do
q5 = Int(Rnd * 48) + 1
txtunum5.Text = q5
Loop Until q5 <> q4 And q5 <> q3 And q5 <> q2 And q5 <> q1
q6 = Int(Rnd * 48) + 1
txtpbnum.Text = q6
End Sub
Private Sub mnuwins_Click()
MsgBox "You have " & wwkount & " wins!!!"
End Sub