Valhalla Legends Archive

Programming => Battle.net Bot Development => Topic started by: haro on March 07, 2003, 05:46 PM

Title: vb bot help
Post by: haro on March 07, 2003, 05:46 PM
when i receive Login Failed. i can't get it to reconnect.  
Title: Re: vb bot help
Post by: Banana fanna fo fanna on March 07, 2003, 06:07 PM
That sucks.
Title: Re: vb bot help
Post by: ILurker on March 07, 2003, 06:34 PM
After the login error line, (probably addchat/addtext)
put in the following, while subsituting the name of your winsock
Winsock1.Close
not too hard  :P

to reconnect, just put the following while subsituting the name of your button/menu name.

Winsock1.close
Connect_click
Title: Re: vb bot help
Post by: haro on March 07, 2003, 06:47 PM
im not an idiot like that lurker
i don't know how to parse it out and to tell it to reconnect
I tried
if txtchat = "Login Failed" Then
wins.close
wins.connect
end if
also alot of other things
Title: Re: vb bot help
Post by: ILurker on March 07, 2003, 07:04 PM
Quotewhen i receive Login Failed. i can't get it to reconnect.,

you werent specific, no where in that did you say anything about parsing

sry, i dont know much about parsing, learning though

Quotetest1test2test3test4
Title: Re: vb bot help
Post by: tA-Kane on March 08, 2003, 02:30 AM
Quotei don't know how to parse it out
You don't know how to parse which out? The term of "parsing it" is quite broad.

if txtchat = "Login Failed" Then
wins.close
wins.connect
end if
Where is this code?
Title: Re: vb bot help
Post by: haZe on March 08, 2003, 07:10 AM
that should be in txtchat_change (what kane said)
Title: Re: vb bot help
Post by: tA-Kane on March 08, 2003, 11:40 AM
Quotewhat kain said
My name is spelled "Kane", thank you very much.

It makes more sense to do a reconnect in the disconnected event handler, not in the text changed event.

By the way, if it *is* in the text changed event, and txtchat is all of the text of the chat field, then you need to modify the checking code, so that it checks the last message added to the text, instead of checking the whole text (which means, it would only return true of the ONLY message is the last message).

If Mid(txtchat,Len(txtchat)-Len("Login Failed")) = "Login Failed" Then

Though, that code is quite inefficient.
Title: Re: vb bot help
Post by: Etheran on March 08, 2003, 12:18 PM
You're using a winsock control so why don't you put this on your winsock_close event.  Maybe you can have a disconnect bool and check if the disconnect was deliberate or not.