giannis Report post Posted August 5, 2008 (edited) Hello there, I am making a bot In basic (or at least i am trying), and thus far I’ve managed to connect. I am receiving a ping request from the server (or so I think) immediately after my connection. I try to log in and then….. BOOM…. I immediately disconnect. Does anyone of you super programmers, knows why I disconnect? I am using winsock. And in my attempt to log in I send to the server the message Msg$ length_of_Msg = LEN(MyName$)+ LEN(Mypassword$) +1 +1 + 1 Msg$= CHR$(140) + CHR$(length_of_Msg) + MyName$ + “ “ + Mypassword$ + CHR$ (0) I believe CHR$(0) is the NULL character correct? DO I disconnect because I don’t reply to the server’s ping request? ( I’ve been completely ignoring it and going straight for the log-in. Or I disconect because I'am sending nonsense to the server? [EDIT]: TYPOS Edited August 5, 2008 by giannis Share this post Link to post Share on other sites
LabRat Report post Posted August 5, 2008 (edited) If you don't send a keepalive packet regularly (schedule a thread for once every 25 seconds) the bot will grue. going back old school to my basic days I would have done this, hope it helps. function login%(username$,password$) { l% = len(username$) + len(password$) + 3 $packet$=chr$(140) + chr$(l% mod 256) + username$ + " " + password$ + chr$(0) login% = sendpacket%(packet$) } retval% = login%(username$,password$) A quick rundown: % means word (2 bytes, 16 bits) $ means string (any length up to 32k) mod means modulo (repeatedly deduct the mod value until the number is between 0 and mod value-1) An example would be 25 mod 10 returns 5 (25-10-10) len means length of string Can't help you with the winsock stuff, all my basic coding was done in QuickBasic 7.1 PDS. ----------------- edit: Meh why have BBCODE indent when it doesn't work? :/ Edited August 5, 2008 by LabRat Share this post Link to post Share on other sites
Marr Report post Posted August 7, 2008 AFAIK you need to reply to PING_REQUEST, too. Its not enough to send HEART_BEAT. Share this post Link to post Share on other sites
DarElik Report post Posted August 13, 2008 AFAIK you need to reply to PING_REQUEST, too. Its not enough to send HEART_BEAT. No, HEART_BEAT is all you need. PING, PING_REQUEST, and PING_RESPONSE have all been unused by my bot from the beginning. Share this post Link to post Share on other sites
giannis Report post Posted September 9, 2008 thanks Labrat It didn't work, but i appriciate the effort..... Share this post Link to post Share on other sites
Vegar Report post Posted September 14, 2008 length_of_Msg = LEN(MyName$)+ LEN(Mypassword$) +1 +1 + 1 Msg$= CHR$(140) + CHR$(length_of_Msg) + MyName$ + “ “ + Mypassword$ + CHR$ (0) length_of_Msg should be a 16 bit integer (two bytes). You can try this, it should work as long as your message is shorter than 255 bytes. Msg$= CHR$(140) + CHR$(length_of_Msg) + CHR$(0) + MyName$ + “ “ + Mypassword$ + CHR$ (0) Share this post Link to post Share on other sites