妳的白癡老師肯定要需要點時間去研究
Function save()
Open App.Path & "\save\" & xUser & ".sav" For Output As #1
Print #1, xUser
Print #1, xUserGold
Close #1
End Function
Function load()
If Dir(App.Path & "\save\" & xUser & ".sav") <> "" Then
Open App.Path & "\save\" & xUser & ".sav" For Input As #1
Input #1, xUser
Input #1, xUserGold
Close #1
Else
xUserGold = 10000
End If
End Function
Function oPPBet()
If xXysgGold <= 0 Then
labXysg.Caption = "?ù?:" & Chr(10) & "С×?????????×???±???¨?¨?"
MsgBox xUser & "???????÷?ù?ò°?????′ε???±??±????", vbOKOnly, "?¤?"
Call save
End
Else
xXysgBet = Int(xXysgGold * 0.5 * Rnd())
labXysgBet.Caption = "Bet: " & xXysgBet
xXysgGold = xXysgGold - xXysgBet
labXysgG.Caption = "Gold:" & xXysgGold
xoppy = Int(1 + 2 * Rnd())
If xoppy = 1 Then
labXysgY.Caption = "?ó"
Else
labXysgY.Caption = "С"
End If
End If
End Function
Private Sub cmdChat_Click()
If xChatIndex = 1 Then
With picUser
.Picture = LoadPicture(App.Path & "\pic\user.gif")
.Top = Me.Height - picUser.Height
.Left = 0
End With
Call load
With labUserG
.Caption = "Gold:" & xUserGold
.Height = 500
.Left = picUser.Width
.Top = Me.Height - .Height
End With
With labUserBet
.Left = labUserG.Left
.Top = labUserG.Top - 400
End With
With labUserY
.Left = labUserG.Left
.Top = labUserBet.Top - 400
End With
Open App.Path & "\data\user.t" For Input As #1
For i = 1 To 100
If Not EOF(1) Then
Input #1, str(i)
End If
Next
Close #1
With labUser
.Left = picUser.Width
.Top = Me.Height - picUser.Height
.Caption = xUser & Chr(10) & str(1 + Int(3 * Rnd()))
End With
cmdChat.Left = labUser.Left + labUser.Width
cmdChat.Top = labUser.Top
xChatIndex = xChatIndex + 1
Exit Sub
End If
If xChatIndex = 2 Then
labUser.Caption = xUser & Chr(10) & "???à?????°ɡ?"
cmdChat.Visible = False
cmdShake.Visible = True
imgExit.Visible = True
xChatIndex = xChatIndex + 1
labXysgG.Left = picXysg.Left
labXysgG.Top = picXysg.Height
xXysgGold = 10000
labXysgG.Caption = "Gold:" & xXysgGold
labXysgBet.Left = labXysgG.Left
labXysgBet.Top = labXysgG.Top + 400
labXysgY.Left = labXysgG.Left
labXysgY.Top = labXysgBet.Top + 400
Exit Sub
End If
End Sub
Private Sub cmdShake_Click()
cmdShake.Visible = False
labResult.Caption = ""
labUserBet.Caption = ""
labUserY.Caption = ""
labXysgBet.Caption = ""
labXysgY.Caption = ""
Call oPPBet
frmYa.Show
End Sub
Private Sub Form_Load()
Me.Top = 0
Me.Left = 0
Me.Height = Screen.Height
Me.Width = Screen.Width
xUser$ = InputBox("±??ò?" & Chr(10) & "???×?????óС." & Chr(10) & "???×á?10%." & Chr(10) & "±?×?¨?×???ù?ó?,ר???" & Chr(10) & Chr(10) & "???ó??ó?:", "?·?")
If xUser = "" Then
End
End If
With cmdShake
.Left = Me.Width / 2 - 1000
.Top = Me.Width / 2 - 500
.Visible = False
End With
With imgExit
.Top = cmdShake.Top + cmdShake.Height
.Left = cmdShake.Left + 150
.Visible = False
End With
labResult.Top = Picture1.Top + Picture1.Height
labResult.Left = Screen.Width * 0.45
Picture1.Width = 3000
Picture2.Width = Picture1.Width
Picture3.Width = Picture1.Width
Picture1.Left = 4000
Picture2.Left = Picture1.Left + Picture1.Width
Picture3.Left = Picture2.Left + Picture1.Width
With picXysg
.Picture = LoadPicture(App.Path & "\pic\xysg.jpg")
.Top = 0
.Left = Me.Width - picXysg.Width
End With
Open App.Path & "\data\xysg.t" For Input As #1
For i = 1 To 100
If Not EOF(1) Then
Input #1, str(i)
End If
Next
Close #1
With labXysg
.Caption = "?ù?" & Chr(10) & str(1 + Int(4 * Rnd()))
.Height = 1500
.Width = 5000
.Left = Me.Width - picXysg.Width - .Width
.Top = 0
End With
xChatIndex = 1
cmdChat.Left = labXysg.Left
cmdChat.Top = labXysg.Height
End Sub
Private Sub imgExit_Click()
Call save
End
End Sub