Valhalla Legends Forums Archive | Battle.net Bot Development | vb bot help

AuthorMessageTime
haro
when i receive Login Failed. i can't get it to reconnect.  
March 7, 2003, 11:46 PM
St0rm.iD
That sucks.
March 8, 2003, 12:07 AM
ILurker
After the login error line, (probably addchat/addtext)
put in the following, while subsituting the name of your winsock
[code]
Winsock1.Close
[/code]
not too hard  :P

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

[code]
Winsock1.close
Connect_click
[/code]
March 8, 2003, 12:34 AM
haro
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
March 8, 2003, 12:47 AM
ILurker
[quote]when i receive Login Failed. i can't get it to reconnect.,
[/quote]

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

sry, i dont know much about parsing, learning though

[quote]test1[code]test2[/code][code]test3[/code]test4[/quote]
March 8, 2003, 1:04 AM
tA-Kane
[quote]i don't know how to parse it out[/quote]
You don't know how to parse which out? The term of "parsing it" is quite broad.

[CODE]
if txtchat = "Login Failed" Then
wins.close
wins.connect
end if
[/CODE]
Where is this code?
March 8, 2003, 8:30 AM
haZe
that should be in txtchat_change (what kane said)
March 8, 2003, 1:10 PM
tA-Kane
[quote]what kain said[/quote]
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).

[CODE]
If Mid(txtchat,Len(txtchat)-Len("Login Failed")) = "Login Failed" Then
[/CODE]

Though, that code is quite inefficient.
March 8, 2003, 5:40 PM
Etheran
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.
March 8, 2003, 6:18 PM

Search