» Site Navigation | | | » Advertisement | | | » Recent Threads | | | | | | | | | | | |  | |  | VB6 - Help meee D: |  |
01-21-2008, 09:57 AM
|
#1 (permalink)
| | Underground
Nub is offline
Join Date: Jan 2007 Posts: 139 Rep Power: 6 | VB6 - Help meee D: I'm trying to make a program for a pokemon rpg (specifically, a pokemon grabber) and my vb6 knowledge is extremely lacking so.. can anyone help me out here? Code: Private Sub cmdLogin_Click()
Dim strHTML As String
strHTML = Wrapper.PostWrapper("http://srpg.myircshells.com/login.php", "user=" & txtUser.Text & "&pass=" & txtPass.Text)
If InStr(1, strHTML, "failed") Then
lblStatus.Caption = "Bad password."
ElseIf InStr(1, strHTML, "logged") Then
lblStatus.Caption = "Logged In."
Else
lblStatus.Caption = "Unknown Error."
End If
If lblStatus.Caption = "Logged In." Then
strHTML = Wrapper.GetWrapper("http://srpg.myircshells.com/index.php", "http://srpg.myircshells.com/login.php")
End If
If InStr(1, strHTML, "Shadow RPG") Then
strHTML = Wrapper.GetWrapper("http://srpg.myircshells.com/promo.php", "http://srpg.myircshells.com/index.php")
End If
strHTML = Wrapper.GetWrapper("http://srpg.myircshells.com/promo.php?action=explore", "http://srpg.myircshells.com/promo.php")
lblStatus.Caption = "Working."
If InStr(1, strHTML, "Try again") Then
strHTML = Wrapper.GetWrapper("http://srpg.myircshells.com/promo.php?action=explore", "http://srpg.myircshells.com/promo.php?action=explore")
ElseIf InStr(1, strHTML, "Unown") Then
strHTML = Wrapper.GetWrapper("http://srpg.myircshells.com/promo.php?action=catch", "http://srpg.myircshells.com/promo.php?action=explore")
Else
lblStatus.Caption = "?"
End If
End Sub The actual logging in seems to be working flawlessly, but I just dunno how to make it loop to catch a pokemon (and if it doesn't find one, continue searching). You'll most likely have to take a look at the site if you're gonna try and help :x
__________________ Successful Trades: 4 - Legend and Duckii and iOwnurazz and Matt://, no MM :]
| |
| |  |
01-21-2008, 11:36 AM
|
#2 (permalink)
| | Underground
second2none is offline
Join Date: Sep 2006 Location: BrisBANE <---- Age: 19 Posts: 5,025 Rep Power: 15 | Just do a Loop or something.
Private Sub Command1_Click()
Dim OnOff As Boolean
'Make On true and False Off
OnOff = True
Do While OnOff = True
strHTML = wrapper.GetWrapper("URL")
If InStr(1, strHTML, "FOUND POKEMON") Then
CATCHING CODE
ElseIf InStr(1, strHTML, "No More PokeBalls") Then
OnOff = False
End If
Loop
End Sub
__________________ This is from:
Screenies Of A Mod Code: How did you do it? FLP , jotform, some other form of hacking? - First Class Noob Lawl.. funny shit.
Quote: |
Originally Posted by Kore By k[ore] on Today, 08:44 AM
i'll give you rep alright, but it won't be positive. | Lawl Ownt
Hoes forgot to eat a dick and shut the FUCK UP! | |
| |  | |  |
01-21-2008, 03:07 PM
|
#3 (permalink)
| | Underground
Nub is offline
Join Date: Jan 2007 Posts: 139 Rep Power: 6 | Quote:
Originally Posted by second2none Just do a Loop or something.
Private Sub Command1_Click()
Dim OnOff As Boolean
'Make On true and False Off
OnOff = True
Do While OnOff = True
strHTML = wrapper.GetWrapper("URL")
If InStr(1, strHTML, "FOUND POKEMON") Then
CATCHING CODE
ElseIf InStr(1, strHTML, "No More PokeBalls") Then
OnOff = False
End If
Loop
End Sub | Thanks :] I don't get the OnOff bit though, what does that do?
Nvm I get it, lemme try this.
I tried: Code: Private Sub cmdLogin_Click()
Dim strHTML As String, OnOff As Boolean
strHTML = Wrapper.PostWrapper("http://srpg.myircshells.com/login.php", "user=" & txtUser.Text & "&pass=" & txtPass.Text)
If InStr(1, strHTML, "failed") Then
lblStatus.Caption = "Bad password."
ElseIf InStr(1, strHTML, "logged") Then
lblStatus.Caption = "Logged In."
Else
lblStatus.Caption = "Unknown Error."
End If
If lblStatus.Caption = "Logged In." Then
strHTML = Wrapper.GetWrapper("http://srpg.myircshells.com/index.php", "http://srpg.myircshells.com/login.php")
End If
strHTML = Wrapper.GetWrapper("http://srpg.myircshells.com/promo.php?action=explore", "http://srpg.myircshells.com/index.php")
OnOff = True
Do While OnOff = True
strHTML = Wrapper.GetWrapper("http://srpg.myircshells.com/promo.php?action=explore")
If InStr(1, strHTML, "You found a") Then
strHTML = Wrapper.GetWrapper("http://srpg.myircshells.com/promo.php?action=catch")
ElseIf InStr(1, strHTML, "You did not find") Then
OnOff = True
End If
Loop
End Sub and it gets stuck at 'Logged in'. I even tried doing a lblStatus.Text = "Nothing found" or "Pokemon Caught!" to check if it got that far but the label never changed from logged in.
Also, when I x'd out of the 'Run' trial thingy, I got some error about Client Site not available or something, and when I hit debug it takes me to a part of the wrapper's code about 'time'. :/
__________________ Successful Trades: 4 - Legend and Duckii and iOwnurazz and Matt://, no MM :]
Last edited by Tyler; 01-21-2008 at 06:09 PM.
| |
| |  |  | |  |
01-21-2008, 05:59 PM
|
#4 (permalink)
| | Banned
Alex is offline
Join Date: Jun 2007 Posts: 34 Rep Power: 0 | This should work. Although I just edited in a text editor, so I'm not 100% sure. Fixed up your indentation as well ;) Code: Private Sub cmdLogin_Click()
Dim strHTML As String
Dim OnOff As Boolean
strHTML = Wrapper.PostWrapper("http://srpg.myircshells.com/login.php", "user=" & txtUser.Text & "&pass=" & txtPass.Text)
If InStr(1, strHTML, "failed") Then
lblStatus.Caption = "Bad password."
ElseIf InStr(1, strHTML, "logged") Then
lblStatus.Caption = "Logged In."
Else
lblStatus.Caption = "Unknown Error."
End If
If lblStatus.Caption = "Logged In." Then
strHTML = Wrapper.GetWrapper("http://srpg.myircshells.com/index.php", "http://srpg.myircshells.com/login.php")
End If
strHTML = Wrapper.GetWrapper("http://srpg.myircshells.com/promo.php?action=explore", "http://srpg.myircshells.com/index.php")
OnOff = True
Do While OnOff = True
strHTML = Wrapper.GetWrapper("http://srpg.myircshells.com/promo.php?action=explore")
If InStr(1, strHTML, "You found a") Then
strHTML = Wrapper.GetWrapper("http://srpg.myircshells.com/promo.php?action=catch")
OnOff=false
ElseIf InStr(1, strHTML, "You did not find") Then
OnOff = True
End If
Loop
MsgBox "We successfully could a pokemon", vbInformation, "Yay"
End Sub | |
| |  |
01-21-2008, 06:06 PM
|
#5 (permalink)
| | Banned
Alex is offline
Join Date: Jun 2007 Posts: 34 Rep Power: 0 | "and it gets stuck at 'Logged in'. I even tried doing a lblStatus.Text = "Nothing found" or "Pokemon Caught!" to check if it got that far but the label never changed from logged in."
I just read what you wrote. It's most likely doing that since neither of the strings you are searching for are in the page. Do a general else statement to cover everything else. | |
| |
01-21-2008, 06:34 PM
|
#6 (permalink)
| | Underground
Nub is offline
Join Date: Jan 2007 Posts: 139 Rep Power: 6 | Yeah I tried that and it went to the else statement.. I don't get it though, the strings are on the page. Or maybe I'm picking the strings wrong..
__________________ Successful Trades: 4 - Legend and Duckii and iOwnurazz and Matt://, no MM :]
| |
| |
01-21-2008, 07:16 PM
|
#7 (permalink)
| | Banned
Alex is offline
Join Date: Jun 2007 Posts: 34 Rep Power: 0 | Add: Code: Else
Debug.Print strHTML
End And show me the source. | |
| |
01-22-2008, 03:22 AM
|
#8 (permalink)
| | Underground
second2none is offline
Join Date: Sep 2006 Location: BrisBANE <---- Age: 19 Posts: 5,025 Rep Power: 15 | the OnOff part is telling the program whether it should continue the loop... do you know what a Boolean is? if not google it.
You can change it to anything...
__________________ This is from:
Screenies Of A Mod Code: How did you do it? FLP , jotform, some other form of hacking? - First Class Noob Lawl.. funny shit.
Quote: |
Originally Posted by Kore By k[ore] on Today, 08:44 AM
i'll give you rep alright, but it won't be positive. | Lawl Ownt
Hoes forgot to eat a dick and shut the FUCK UP! | |
| |
01-22-2008, 03:54 AM
|
#9 (permalink)
| | Underground
Blade-Saw is offline
Join Date: Nov 2007 Location: Australia Age: 15 Posts: 260 Rep Power: 3 | how do u get the finnished product? | |
| |
01-22-2008, 05:03 AM
|
#10 (permalink)
| | Underground
Nub is offline
Join Date: Jan 2007 Posts: 139 Rep Power: 6 | I tried the Debug.Print thing but nothing changed. Stayed at 'Logged In.' What exactly is it supposed to do?
__________________ Successful Trades: 4 - Legend and Duckii and iOwnurazz and Matt://, no MM :]
| |
| |  | | |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | | | | Thread Tools | | | | Display Modes | Linear Mode |
Posting Rules
| You may not post new threads You may not post replies You may not post attachments You may not edit your posts HTML code is Off | | | |