• Welcome to Valhalla Legends Archive.
 

Bnet Bots

Started by titan0060, August 21, 2004, 09:14 AM

Previous topic - Next topic

titan0060

Hey, im tryin to make my first bot, i have Visual basic 6... i pretty much know my way arround VB, but i dont know what to do next.

I've got the main form laid out, but now i dont know what to do.

Please reach me at:
[ this forum ]

Removed contact info.  Ask your questions here so everyone can conveniently help you and others can benefit from the information.
- Spht

Kp

Quote from: titan0060 on August 21, 2004, 09:14 AMHey, im tryin to make my first bot, i have Visual basic 6... i pretty much know my way arround VB, but i dont know what to do next.
I've got the main form laid out, but now i dont know what to do.
Please reach me at:
[ this forum ]

Open a TCP socket to port 6112 on any of the active BNCS.  Send your connection select byte, then go into a net loop on the received data.  Beware of partial receipts as well as receiving multiple bncs messages in a single receive operation.  Consult BnetDocs for details of the individual packet formats.
[19:20:23] (BotNet) <[vL]Kp> Any idiot can make a bot with CSB, and many do!

TangoFour

QuoteBeware of partial receipts

Ummm - you mean packets getting scrambled? Didn't ever think of that as a possibility...

Ok, that means I gotta rewrite a part of my bot's connection code

Newby

I think he meant a packet that doesn't contain all the information it should, almost as if it had been cut off.
- Newby

Quote[17:32:45] * xar sets mode: -oooooooooo algorithm ban chris cipher newby stdio TehUser tnarongi|away vursed warz
[17:32:54] * xar sets mode: +o newby
[17:32:58] <xar> new rule
[17:33:02] <xar> me and newby rule all

Quote<TehUser> Man, I can't get Xorg to work properly.  This sucks.
<torque> you should probably kill yourself
<TehUser> I think I will.  Thanks, torque.

MyndFyre

Quote from: TangoFour on August 21, 2004, 01:20 PM
QuoteBeware of partial receipts

Ummm - you mean packets getting scrambled? Didn't ever think of that as a possibility...

Ok, that means I gotta rewrite a part of my bot's connection code

No -- what he means that, Battle.net will sometimes put more than one packet together:

Example: extremely unlikely, but it illustrates the point.

ff 00 04 00 ff 00 04 00


It will also sometimes not send an entire packet with one Receive callback:

ff 0b 4c 00 (P) (u) (b) (l) (i) (c) ( ) (C) (h) (a) (t) ( )
(U) (S) (A) (-) (1) 00 (O) (p) (e) (n) ( )


If you look at the length specifier (sorry, I was too lazy to look up hex codes for all the ASCII chars), you can see that the specified packet is supposed to be *much longer* than the data that was received (0x4c vs 0x1b).

That's what it means.  There's no "scrambling" of packet info.
QuoteEvery generation of humans believed it had all the answers it needed, except for a few mysteries they assumed would be solved at any moment. And they all believed their ancestors were simplistic and deluded. What are the odds that you are the first generation of humans who will understand reality?

After 3 years, it's on the horizon.  The new JinxBot, and BN#, the managed Battle.net Client library.

Quote from: chyea on January 16, 2009, 05:05 PM
You've just located global warming.

TangoFour

#5
So, more like: I receive a SID_PING, which should be 8 bytes long (1 for FF, 1 for Packet ID, 2 for length, 4 for Ping value), but I only receive 4 bytes - in that case I should wait for the other 4 bytes...

Is it possible then, that I receive 4 bytes for SID_PING, then receive a SID_AUTH_INFO, and then the rest of SID_PING?

My code already properly deals with packets that are "concatenated"

ChR0NiC

#6
Quote from: titan0060 on August 21, 2004, 09:14 AM
Hey, im tryin to make my first bot, i have Visual basic 6... i pretty much know my way arround VB, but i dont know what to do next.
This has to stop, you mods should make a sticky saying before asking this question use the search button and look in the Battle.net Bot Development References before you ask questions.

Thanks if any mods decide to do this.

Kp

Quote from: TangoFour on August 21, 2004, 01:35 PM
So, more like: I receive a SID_PING, which should be 8 bytes long (1 for FF, 1 for Packet ID, 2 for length, 4 for Ping value), but I only receive 4 bytes - in that case I should wait for the other 4 bytes...
Is it possible then, that I receive 4 bytes for SID_PING, then receive a SID_AUTH_INFO, and then the rest of SID_PING?

Yes.  No.  Therefore, you're ok.
[19:20:23] (BotNet) <[vL]Kp> Any idiot can make a bot with CSB, and many do!

Zakath

Indeed. You may get part of a packet, a whole packet, or multiple packets clumped together. Those are the situations you have to handle.
Quote from: iago on February 02, 2005, 03:07 PM
Yes, you can't have everybody...contributing to the main source repository.  That would be stupid and create chaos.

Opensource projects...would be dumb.

TangoFour

Alright, thank you very much

tA-Kane

So just to make sure it's clear, you should NEVER receive a partial packet, then another packet before receiving the rest of the partial packet.
Macintosh programmer and enthusiast.
Battle.net Bot Programming: http://www.bash.org/?240059
I can write programs. Can you right them?

http://www.clan-mac.com
http://www.eve-online.com