All made by me.
Code:
Dim strHTML As String
Private Sub cmdLogin_Click()
'disables login button
cmdLogin.Enabled = False
'locks user and pass
txtUser.Locked = True
txtPass.Locked = True
'checks for valid user and pass
If Len(txtUser.Text) < 3 Then lblStatus.Caption = "Invalid User": Call Unlocker: Exit Sub
If Len(txtPass.Text) < 3 Then lblStatus.Caption = "Invalid Pass": Call Unlocker: Exit Sub
'visit neopets main page
strHTML = wrapper.GetWrapper("http://www.neopets.com/", "")
lblStatus.Caption = "Visiting Neopets Main Page"
'visits neopets login page
strHTML = wrapper.GetWrapper("http://www.neopets.com/loginpage.phtml", "http://www.neopets.com/")
lblStatus.Caption = "Visiting Neopets Login Page"
'posting user
strHTML = wrapper.PostWrapper("http://www.neopets.com/hi.phtml", "destination=%2Fpetcentral.phtml&username=" & txtUser.Text, "http://www.neopets.com/loginpage.phtml")
lblStatus.Caption = "Posting User"
'checking for validity of user
If InStr(1, strHTML, "Sorry, we did not find") <> 0 Then
'could not find username
lblStatus.Caption = "Did Not Find Username"
Call Unlocker
Exit Sub
ElseIf InStr(1, strHTML, "<td><b>Your birthday</b></td>") <> 0 Then
'birthday needed
lblStatus.Caption = "Needing Birthday Entry"
Call Unlocker
Exit Sub
ElseIf InStr(1, strHTML, "Sorry, you have tried too") <> 0 Then
'tried too many times
lblStatus.Caption = "You Have Tried Too Many Times"
Call Unlocker
Exit Sub
End If
'posting user and pass
strHTML = wrapper.PostWrapper("http://www.neopets.com/login.phtml", "username=" & txtUser.Text & "&password=" & txtPass.Text & "&destination=%2Fpetcentral.phtml", "http://www.neopets.com/hi.phtml")
'checking results
If InStr(1, strHTML, "Your site username matches your email username.") <> 0 Then
'change email
lblStatus.Caption = "Site Username matches Email - Change Soon!"
Call ParseAccDetails
ElseIf InStr(1, strHTML, "STOP! Your password's not secure enough!") <> 0 Then
'not secure enough password
lblStatus.Caption = "Your Password's not Secure Enough - Change Soon!"
Call ParseAccDetails
ElseIf InStr(1, strHTML, "username/password") <> 0 Then
'bad password
lblStatus.Caption = "Bad Password"
Call Unlocker
Exit Sub
ElseIf InStr(1, strHTML, "petcentral.phtml") <> 0 Then
'successful login
lblStatus.Caption = "Logged In!"
Call ParseAccDetails
ElseIf InStr(1, strHTML, "This account has") <> 0 Then
'FROZEN
lblStatus.Caption = "Frozen Account"
Call Unlocker
Exit Sub
End If
End Sub
Private Sub cmdUpdate_Click()
Call ParseAccDetails
End Sub
Private Sub txtPass_Change()
txtPass.PasswordChar = "*"
End Sub
Function Unlocker()
cmdLogin.Enabled = True
txtUser.Locked = False
txtPass.Locked = False
End Function
Function ParseAccDetails()
Dim strUser, strPet, strNP As String
'visit petcentral
strHTML = wrapper.GetWrapper("http://www.neopets.com/petcentral.phtml", wrapper.LastPage)
'get values for the 3 strings
strUser = iBetween(strHTML, "/userlookup.phtml?user=", Chr(34))
strPet = iBetween(strHTML, "/quickref.phtml" & Chr(34) & "><b>", "</b></a>")
strNP = iBetween(strHTML, "/objects.phtml?type=inventory" & Chr(34) & ">", "</a>")
'update labels
lblUser.Caption = strUser
lblPet.Caption = strPet
lblNP.Caption = strNP
End Function Credits to Cataliste for:
Tried to Many Times
Site Username Matches Email
Your Password's Not Secure Enough
-Andrew