Valhalla Legends Forums Archive | Battle.net Bot Development | Auto-Reconnect on Disconnection

AuthorMessageTime
FiReGoD
i was wondering how you can do a auto-reconnect function, i was thinking a timer and every so often seconds it checks to see if you are connected, but that would just waste memory,

i am using visual basics, and running csb(cleanslatebot).
April 8, 2003, 10:42 AM
haZe
On the BnetDisconnected event, call csb.connect I believe.
April 8, 2003, 11:07 AM
FiReGoD
i know but what if you disconnect from the mnuDisconnect() function

then when you do that it will just reconnect
April 8, 2003, 3:05 PM
Yoni
Have a boolean variable like "ShouldBeConnected".
This variable will be True when the bot should be connected, or False when the bot should be disconnected.

Then, when you disconnect intentionally (i.e. from the mnuDisconnect function):
[code]ShouldBeConnected = False
CSB.Close ' or whatever the function name is[/code]
And in the BnetDisconnected event:
[code]If ShouldBeConnected Then CSB.Connect[/code]
April 8, 2003, 3:53 PM
CupHead
If you're using CleanSlateBot1.Disconnect as part of your mnuDisconnect sub, then reconnecting on disconnect will be fine. The .Disconnect method intentionally does not raise the BnetDisconnected, RealmDisconnected, and/or BNLSDisconnected events.
April 8, 2003, 5:15 PM
St0rm.iD
I've never heard of visual basics.
April 9, 2003, 12:17 AM
Smurfling
This code i am using for VB.Net:

Handles the CleanSlateBot.OCX Event Disconnected:
[code]Private Sub BNET_Disconnected(ByVal sender As Object, ByVal e As System.EventArgs) Handles csb.BnetDisconnected

AddChat(Col.FromKnownColor(Color_Text_Error), "Disconnected from Battle.Net.")
csb.Connect()

End Sub[/code]

Handles your mnuDisconnect() Event:
[code]Private Sub mnuDisconnect_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuDisconnect.Click

If csb.Connected = True Then csb.Disconnect()

End Sub[/code]

csb = CleanSlateBot.ocx
April 10, 2003, 2:24 PM

Search