Valhalla Legends Archive

Programming => Battle.net Bot Development => Topic started by: Lenny on July 15, 2003, 12:45 AM

Title: Disconnect Problem
Post by: Lenny on July 15, 2003, 12:45 AM
Whenever I have a procedure with the disconnected command in it like wnsck.close
it always gets disconnected first...Any fixes?
Title: Re:Disconnect Problem
Post by: Soul Taker on July 15, 2003, 12:50 AM
Post some code please as I don't quite follow you.
Title: Re:Disconnect Problem
Post by: Lenny on July 15, 2003, 01:13 AM
Its just that any procedure i make it always seems to skip straight to the disconnect before doing the other commands
Title: Re:Disconnect Problem
Post by: CrAz3D on July 15, 2003, 08:32 AM
Quote from: Soul Taker on July 15, 2003, 12:50 AM
Post some code please as I don't quite follow you.
This might actually help, having some of what you're doing.
Title: Re:Disconnect Problem
Post by: Nub on July 15, 2003, 01:28 PM
Try adding a DoEvents before you close the socket

Example:


Socket.Senddata "blah blah blah im leaveing bnet... blah..." & VbCrLf
DoEvents
Socket.Close

Hope that helps...
Title: Re:Disconnect Problem
Post by: Lenny on July 15, 2003, 09:11 PM
Like
Cleanslatebot1.Send "Disconnected by " + User
Cleanslatebot1.Disconnect

It seems to disconnect first.....
Title: Re:Disconnect Problem
Post by: hismajesty on July 15, 2003, 10:22 PM
are you doing CSB? If so why did you post about winsock? Um...heres my code that seems to work fine....

Private Sub disc_Click()
AddChat "Disconnected " & vbNewLine, vbRed
CleanSlateBot1.Disconnect
Form1.lvChannel.ListItems.Clear
End Sub

Title: Re:Disconnect Problem
Post by: Lenny on July 15, 2003, 10:32 PM
The same problems goes for winsock
it seems to disconnected before sending the text to bnet...Is there some order of precedence I should know about between sending data and disconnecting?
Title: Re:Disconnect Problem
Post by: Camel on July 16, 2003, 01:45 AM
I hope you realise Nub already answered the question...
Title: Re:Disconnect Problem
Post by: Lenny on July 16, 2003, 03:05 AM
Any other way...that doesnt seem to work...
Title: Re:Disconnect Problem
Post by: Camel on July 16, 2003, 03:20 PM
Don't close it until the SendComplete event to fires.
Title: Re:Disconnect Problem
Post by: planterspeanuts on July 18, 2003, 03:43 PM
Quote from: Camel on July 16, 2003, 03:20 PM
Don't close it until the SendComplete event to fires.
Title: Re:Disconnect Problem
Post by: Camel on July 18, 2003, 04:17 PM
Quote from: planterspeanuts on July 18, 2003, 03:43 PM
Quote from: Camel on July 16, 2003, 03:20 PM
Don't close it until the SendComplete event to fires.

-to
/me sighs