Valhalla Legends Forums Archive | Battle.net Bot Development | Basic VB Question

AuthorMessageTime
ChR0NiC
Private Sub Command3_click()
Listno = 0
Do
listrtn = List1.List(Loopno)
WebBrowser1.Navigate http://www.outwar.com/rankings.php?type= & listrtn & "&submit=Invite")
Pause delay5.Text
List1.RemoveItem (lstrtn)
listamt = listamt - 1
Label3.Caption = List1.ListCount
start1 = Timer
Do While Timer < (start1 + 3)
DoEvents
Loop
Loop While listamt > 0
End If
End Sub

Ok I am using this to remove one item from the list one by one, and it goes to the URL. Now I want to make a stop button to stop the looping and countdown. I have no idea how to do that. Can anyone help me out??
October 6, 2003, 6:49 AM
Arta
Hackish and unpleasent way but easy:

Add a global boolean variable to your project. Call it AbortLoop or somesuch. Set it to false when your countdown starts. Put a button on your form, call it 'Abort'. In your OnClick handler, set AbortLoop to true. In that loop you posted, add an if statement to see if AbortLoop is true or false. If it's false, carry on. If it's true, break out of the loop.
October 6, 2003, 11:57 AM
Adron
[quote author=Arta[vL] link=board=17;threadid=2972;start=0#msg23161 date=1065441434]
Hackish and unpleasent way but easy:

Add a global boolean variable to your project. Call it AbortLoop or somesuch. Set it to false when your countdown starts. Put a button on your form, call it 'Abort'. In your OnClick handler, set AbortLoop to true. In that loop you posted, add an if statement to see if AbortLoop is true or false. If it's false, carry on. If it's true, break out of the loop.
[/quote]

That seems like the right way to do it. Why don't you love it?
October 6, 2003, 3:59 PM
Kp
[quote author=ChR0NiC link=board=17;threadid=2972;start=0#msg23148 date=1065422998]
WebBrowser1.Navigate http://www./rankings.php?type= & listrtn & "&submit=Invite")[/quote]This domain is entirely bogus. It requests a top-level host named www, which does not exist. If you're trying to access a host named www in your current domain, you should either construct the hostname from system calls or leave off the trailing dot. When a name is supplied "bare" (that is, "www"), the resolver will first try it as a top-level name, then as the supplied name + ".current_domain", whatever that is. For someone on a Valhalla terminal, asking for host yoni would end up looking for "yoni.valhallalegends.com" after looking for a top-level computer named "yoni" failed. Supplying a trailing dot forces the resolver not to try guessing the host to be in the current domain if lookup as-specified fails.

Unfortunately, I've seen some resolvers which were implemented improperly and do not support the suppression behavior. Relying on this bug is a bad idea.
October 7, 2003, 3:43 PM
iago
[quote author=Kp link=board=17;threadid=2972;start=0#msg23290 date=1065541424]
[quote author=ChR0NiC link=board=17;threadid=2972;start=0#msg23148 date=1065422998]
WebBrowser1.Navigate http://www./rankings.php?type= & listrtn & "&submit=Invite")[/quote]This domain is entirely bogus. It requests a top-level host named www, which does not exist. If you're trying to access a host named www in your current domain, you should either construct the hostname from system calls or leave off the trailing dot. When a name is supplied "bare" (that is, "www"), the resolver will first try it as a top-level name, then as the supplied name + ".current_domain", whatever that is. For someone on a Valhalla terminal, asking for host yoni would end up looking for "yoni.valhallalegends.com" after looking for a top-level computer named "yoni" failed. Supplying a trailing dot forces the resolver not to try guessing the host to be in the current domain if lookup as-specified fails.

Unfortunately, I've seen some resolvers which were implemented improperly and do not support the suppression behavior. Relying on this bug is a bad idea.
[/quote]

My God, you wrote a lot for an obvious typo :P
October 8, 2003, 1:57 AM
Adron
[quote author=iago link=board=17;threadid=2972;start=0#msg23366 date=1065578230]
My God, you wrote a lot for an obvious typo :P
[/quote]

Or, for someone not wanting to reveal what page he's working with.
October 8, 2003, 3:51 PM
Kp
[quote author=Adron link=board=17;threadid=2972;start=0#msg23404 date=1065628305]
[quote author=iago link=board=17;threadid=2972;start=0#msg23366 date=1065578230]
My God, you wrote a lot for an obvious typo :P
[/quote]
Or, for someone not wanting to reveal what page he's working with.[/quote]Even so, his URL won't work. If he just wanted to reference it on the local domain, he ought to use "www" without the dot, like I told him. :)
October 8, 2003, 9:08 PM
iago
[quote author=Kp link=board=17;threadid=2972;start=0#msg23435 date=1065647317]
[quote author=Adron link=board=17;threadid=2972;start=0#msg23404 date=1065628305]
[quote author=iago link=board=17;threadid=2972;start=0#msg23366 date=1065578230]
My God, you wrote a lot for an obvious typo :P
[/quote]
Or, for someone not wanting to reveal what page he's working with.[/quote]Even so, his URL won't work. If he just wanted to reference it on the local domain, he ought to use "www" without the dot, like I told him. :)
[/quote]

I very much doubt he's trying to do that :-P
October 8, 2003, 9:25 PM
Myndfyr
[quote author=iago link=board=17;threadid=2972;start=0#msg23440 date=1065648324]
[quote author=Kp link=board=17;threadid=2972;start=0#msg23435 date=1065647317]
[quote author=Adron link=board=17;threadid=2972;start=0#msg23404 date=1065628305]
[quote author=iago link=board=17;threadid=2972;start=0#msg23366 date=1065578230]
My God, you wrote a lot for an obvious typo :P
[/quote]
Or, for someone not wanting to reveal what page he's working with.[/quote]Even so, his URL won't work. If he just wanted to reference it on the local domain, he ought to use "www" without the dot, like I told him. :)
[/quote]

I very much doubt he's trying to do that :-P
[/quote]

Yeah Kp - looks like he's just trying to not show you what site he's accessing.
October 8, 2003, 9:44 PM
Kp
[quote author=Myndfyre link=board=17;threadid=2972;start=0#msg23445 date=1065649454]
Yeah Kp - looks like he's just trying to not show you what site he's accessing.[/quote]That's still a very poor reason for posting a clearly bad hostname! :)
October 8, 2003, 9:59 PM
Arta
[quote author=Adron link=board=17;threadid=2972;start=0#msg23171 date=1065455965]
That seems like the right way to do it. Why don't you love it?
[/quote]

Just seems ugly. Using a global variable for flow control? Not to mention it's a solution that requires a multithreading.
October 8, 2003, 11:39 PM
Adron
[quote author=Arta[vL] link=board=17;threadid=2972;start=0#msg23473 date=1065656395]
Just seems ugly. Using a global variable for flow control? Not to mention it's a solution that requires a multithreading.
[/quote]

It doesn't. DoEvents will poll for mouse events and call the OnClick handler for the Cancel button if needed. And you're right that he doesn't need a global variable, a private one would do, but that's a minor change and most likely he'd do it with a private one even though you stated to use a global variable.
October 9, 2003, 12:03 AM

Search