Code:
Dim Dpage As String, strHTML As String, x As Integer, strGuess As String, HTML As String, StopProgram As Boolean
Private Sub cmdclear_Click()
lstlog.Clear
End Sub
Private Sub cmdreset_Click()
lblwins.Caption = "0"
lblloss.Caption = "0"
lblplays.Caption = "0"
End Sub
Private Sub Form_Unload(Cancel As Integer)
Call SaveSetting("Violent_J's guess the card", "Login", "Username", txtuser.Text)
Call SaveSetting("Violent_J's guess the card", "Login", "Password", txtpass.Text)
Call SaveSetting("Violent_J's guess the card", "Login", "Save Login Information", chksave.Value)
Dim frmTemp As Form
For Each frmTemp In Forms
Unload frmTemp
Set frmTemp = Nothing
Next
End
End Sub
Private Sub cmdLogin_click()
cmdLogin.Enabled = False
lblstatus.Caption = "Logging in..."
strHTML = w.PostWrapper("http://neopets.com/login.phtml", "username=" & txtuser & "&password=" & txtpass & "&destination=%2Fpetcentral.phtml", "http://neopets.com/hi.phtml")
If InStr(1, strHTML, "badpassword") Then
lblstatus.Caption = "Bad Password"
cmdLogin.Enabled = True
ElseIf InStr(1, strHTML, "This account has been") Then
lblstatus.Caption = "Account Frozen"
cmdLogin.Enabled = True
ElseIf InStr(1, strHTML, "petcentral") Then
lblstatus.Caption = "Logged in"
lstlog.AddItem Time & " - Logged in as " & txtuser.Text
cmdstart.Enabled = True
Else
cmdLogin.Enabled = True
lblstatus.Caption = "Unknown Error"
End If
End Sub
Private Sub cmdStart_Click()
cmdstart.Enabled = False
cmdStop.Enabled = True
lstlog.AddItem Time & " - Started Playing!"
Do Until lblplays.Caption = txtamount.Text Or cmdStop.Enabled = False
strHTML = w.GetWrapper("http://www.neopets.com/games/process_psy.phtml?cards=4", "http://www.neopets.com/games/psychoanalysis.phtml")
lblplays.Caption = lblplays.Caption + 1
If InStrB(1, strHTML, "Congratulations your pet is psychic!") Then
lstlog.AddItem Time & " - You won 50 neopoints!"
lblwins.Caption = lblwins.Caption + 1
ElseIf InStrB(1, strHTML, "Wrong!") Then
lstlog.AddItem Time & " - You lost 10 neopoints!"
lblloss.Caption = lblloss.Caption + 1
Else
lstlog.AddItem Time & " - Unknown event at "
End If
SleepModule.SecondsToWait (txtinterval.Text)
Loop
lstlog.AddItem Time & " - Finished Playing!"
cmdstart.Enabled = True
cmdStop.Enabled = False
End Sub
Private Sub cmdStop_click()
cmdstart.Enabled = True
cmdStop.Enabled = False
lstlog.AddItem "Stopped Program"
End Sub
Private Sub Form_Load()
chksave.Value = GetSetting("Violent_J's guess the card", "Login", "Save Login Information", Checked)
If chksave.Value = Checked Then
txtuser.Text = GetSetting("Violent_J's guess the card", "Login", "Username")
txtpass.Text = GetSetting("Violent_J's guess the card", "Login", "Password")
End If
End Sub