Go Back   Gaming Gutter > Non-Gaming > Programming


Programming - All general programming discussion in here.

» Site Navigation
» Home
» FAQ
» Log in
User Name:

Password:

Not a member yet?
Register Now!
» Advertisement
» Recent Threads
Go to first new post Fair trade? (maple and...
Today 03:12 PM
by Lanbo
Last post by drdd10
Today 03:17 PM
1 Replies, 2 Views
Go to first new post Selling Legit Gaia items...
Today 03:17 PM
by Icee
Last post by Icee
Today 03:17 PM
0 Replies, 1 Views
Go to first new post Transfering Money to...
08-10-2008 06:03 PM
by Saint
Last post by Saint
Today 03:13 PM
7 Replies, 8 Views
Go to first new post Google Chrome
Today 03:10 PM
by Saint
Last post by Connor
Today 03:11 PM
1 Replies, 2 Views
Go to first new post Photoshop Creative...
09-01-2008 08:47 AM
by Connor
Last post by Connor
Today 03:10 PM
2 Replies, 3 Views
Closed Thread
 
LinkBack Thread Tools Display Modes

 VB6 - Help meee D:
Old 01-21-2008, 09:57 AM   #1 (permalink)
Nub Nub is offline Gender Male
Underground
 
Nub's Avatar
 
Nub is offline
Join Date: Jan 2007
Posts: 139
iTrader: 0 / 0%
Nub Is gaining popularity
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 :]
 

 
Old 01-21-2008, 11:36 AM   #2 (permalink)
second2none second2none is offline Gender Male
Underground
 
second2none is offline
Join Date: Sep 2006
Location: BrisBANE <----
Age: 19
Posts: 5,025
iTrader: 1 / 100%
second2none Is a Party Captainsecond2none Is a Party Captainsecond2none Is a Party Captain
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!
 

 
Old 01-21-2008, 03:07 PM   #3 (permalink)
Nub Nub is offline Gender Male
Underground
 
Nub's Avatar
 
Nub is offline
Join Date: Jan 2007
Posts: 139
iTrader: 0 / 0%
Nub Is gaining popularity
Rep Power: 6
Quote:
Originally Posted by second2none View Post
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.
 

 
Old 01-21-2008, 05:59 PM   #4 (permalink)
Alex Alex is offline
Banned
 
Alex is offline
Join Date: Jun 2007
Posts: 34
iTrader: 0 / 0%
Alex Is gaining popularity
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
 

 
Old 01-21-2008, 06:06 PM   #5 (permalink)
Alex Alex is offline
Banned
 
Alex is offline
Join Date: Jun 2007
Posts: 34
iTrader: 0 / 0%
Alex Is gaining popularity
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.
 

 
Old 01-21-2008, 06:34 PM   #6 (permalink)
Nub Nub is offline Gender Male
Underground
 
Nub's Avatar
 
Nub is offline
Join Date: Jan 2007
Posts: 139
iTrader: 0 / 0%
Nub Is gaining popularity
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 :]
 

 
Old 01-21-2008, 07:16 PM   #7 (permalink)
Alex Alex is offline
Banned
 
Alex is offline
Join Date: Jun 2007
Posts: 34
iTrader: 0 / 0%
Alex Is gaining popularity
Rep Power: 0
Add:
Code:
Else
       Debug.Print strHTML
       End
And show me the source.
 

 
Old 01-22-2008, 03:22 AM   #8 (permalink)
second2none second2none is offline Gender Male
Underground
 
second2none is offline
Join Date: Sep 2006
Location: BrisBANE <----
Age: 19
Posts: 5,025
iTrader: 1 / 100%
second2none Is a Party Captainsecond2none Is a Party Captainsecond2none Is a Party Captain
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!
 

 
Old 01-22-2008, 03:54 AM   #9 (permalink)
Blade-Saw Blade-Saw is offline Gender Male
Underground
 
Blade-Saw's Avatar
 
Blade-Saw is offline
Join Date: Nov 2007
Location: Australia
Age: 15
Posts: 260
iTrader: 0 / 0%
Blade-Saw Is Recognizable
Rep Power: 3
how do u get the finnished product?
 

 
Old 01-22-2008, 05:03 AM   #10 (permalink)
Nub Nub is offline Gender Male
Underground
 
Nub's Avatar
 
Nub is offline
Join Date: Jan 2007
Posts: 139
iTrader: 0 / 0%
Nub Is gaining popularity
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 :]
 
Closed Thread

Bookmarks



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Powered by vBadvanced CMPS v3.0 RC2

All times are GMT -7. The time now is 03:21 PM.


vBulletin skin developed by: eXtremepixels
The contents of this webpage are copyright © 2006-2008 GamingGutter.com. All Rights Reserved.

Page generated in 0.13707995 seconds (100.00% PHP - 0% MySQL) with 19 queries