Valhalla Legends Forums Archive | Battle.net Bot Development | WAR3 Bot Questions

AuthorMessageTime
Anubis
I've been playing around with soe WAR3 connection code and I'm having trouble figuring out how to send text to Battle.net (such as "/away" or "hello"). I've tried "Winsock.SendData Text1.Text & vbCrLf" but its not working - it disconnects me every time. Can anyone help me with this problem, please?

Also, after playing around with the code, it now decides to connect with -1 ping... Is there a packet or something I changed that would cause this? If so, which one would I need to add back in/take out?

If there's any code or anything that I need to post here, please let me know.

Any help is much appreciated. Thanks
May 3, 2004, 1:33 AM
Eli_1
[quote author=Anubis link=board=17;threadid=6631;start=0#msg58183 date=1083548009]
I've been playing around with soe WAR3 connection code and I'm having trouble figuring out how to send text to Battle.net (such as "/away" or "hello"). I've tried "Winsock.SendData Text1.Text & vbCrLf" but its not working - it disconnects me every time. Can anyone help me with this problem, please?
[/quote]
That is how you send data with the CHAT protocol, WAR3 is much different.

[quote author=Anubis link=board=17;threadid=6631;start=0#msg58183 date=1083548009]
Also, after playing around with the code, it now decides to connect with -1 ping... Is there a packet or something I changed that would cause this? If so, which one would I need to add back in/take out?[/quote]
That is caused when you send packet 0x25 before receiving it, or not sending it at all -- I don't remember which one right now though.
May 3, 2004, 1:43 AM
Anubis
What's the way to send data with WAR3? And, Battle.net sends a packet (0x25) before the bot should send it's 0x25, right? or am I a little off here?...
May 3, 2004, 1:52 AM
Null
Your ping time is calculated by replying to 0x25 , with 0x25 (The amount of time it takes for you to reply to the server sending of 0x25).
May 3, 2004, 2:25 AM
Anubis
I set it to send 0x25 after it receives 0x25 from the server, but it still connects with -1... Do I need to add some sort of wait time to get an actual ping?
May 3, 2004, 2:30 AM
Null
I dont believe the UDP Plug has anything to do with 0x25 , i may be out of the loop here but i believe its 0x14.

PS. This could be totally wrong for Warcraft 3
May 3, 2004, 2:32 AM
Anubis
Hmm... I'll play with the code and see what I can find on the ping problem... But can anyone help me with the sending issue please? What would be the code to send the text in the textbox Text1 to bnet through a winsock control named Winsock? Or would I put this through the packet buffer?
May 3, 2004, 2:37 AM
Null
[code]Winsock.sendData text1.text[/code]
May 3, 2004, 3:08 AM
Anubis
[quote author=effect link=board=17;threadid=6631;start=0#msg58198 date=1083553681]
[code]Winsock.sendData text1.text[/code]
[/quote]

Tried that...it disconnects me
May 3, 2004, 3:11 AM
Null
I dont believe its the sendData function causing you problems (well directly) something else is causing your disconnect (Possibly trying to send data before your logged on?)
May 3, 2004, 3:16 AM
Anubis
I'm sure it's completely logged on because I'm using other bots that are in the same channel and they see it...I'm also waiting about 5-10 seconds after it connects to send anything (text)...
May 3, 2004, 3:20 AM
Null
I think its time you show some code? from the point of origin of your problem.
May 3, 2004, 3:21 AM
Anubis
lol...That's the problem...I don't know the code for sending text... All I know is that when i try to send it using the following code, it disconnects me.

[code]
Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
If Winsock.State = sckConnected Then Winsock.SendData Text1.Text
Text1.Text = ""
KeyAscii = 0
End If
End Sub
[/code]
May 3, 2004, 3:27 AM
FuzZ
[quote author=Anubis link=board=17;threadid=6631;start=0#msg58183 date=1083548009]
I've been playing around with soe WAR3 connection code and I'm having trouble figuring out how to send text to Battle.net (such as "/away" or "hello"). I've tried "Winsock.SendData Text1.Text & vbCrLf" but its not working - it disconnects me every time. Can anyone help me with this problem, please?

Also, after playing around with the code, it now decides to connect with -1 ping... Is there a packet or something I changed that would cause this? If so, which one would I need to add back in/take out?

If there's any code or anything that I need to post here, please let me know.

Any help is much appreciated. Thanks
[/quote]

Let me guess.. Flawed source?

I don't understand how someone could write a bot to work with war3, and not know how to send a chat event.
May 3, 2004, 3:33 AM
Anubis
I just used a packet thingy on a Stealth Bot and the 1 I'm having truoble with and heres what it came up with (by sending the text "testing"):

From the Stealth Bot:
FF 0E 0C 00 74 65 73 74 69 6E 67 00 ....testing

From the other one:
74 65 73 74 69 6E 67 testing

I can't help but notice the missing bytes: FF 0E 0C 00
What do I need to add to the bot to make it send those?

Yea, you're right...but I'm attempting to learn from it... (I learn better by reverse-engineering things...)
May 3, 2004, 3:36 AM
FuzZ
[quote author=Anubis link=board=17;threadid=6631;start=0#msg58216 date=1083555405]
I just used a packet thingy on a Stealth Bot and the 1 I'm having truoble with and heres what it came up with (by sending the text "testing"):

From the Stealth Bot:
FF 0E 0C 00 74 65 73 74 69 6E 67 00 ....testing

From the other one:
74 65 73 74 69 6E 67 testing

I can't help but notice the missing bytes: FF 0E 0C 00
What do I need to add to the bot to make it send those?

Yea, you're right...but I'm attempting to learn from it... (I learn better by reverse-engineering things...)
[/quote]

do this
[code]
Dim p as new packetbuffer
p.insertntstring "Testing 1 2 3 4"
p.sendpacket &HE
[/code]

put that in a menu or something, then click the menu when you're connected.
May 3, 2004, 3:45 AM
Stealth
[quote author=Anubis link=board=17;threadid=6631;start=0#msg58216 date=1083555405]
I just used a packet thingy on a Stealth Bot and the 1 I'm having truoble with and heres what it came up with (by sending the text "testing"):

From the Stealth Bot:
FF 0E 0C 00 74 65 73 74 69 6E 67 00 ....testing

From the other one:
74 65 73 74 69 6E 67 testing

I can't help but notice the missing bytes: FF 0E 0C 00
What do I need to add to the bot to make it send those?

Yea, you're right...but I'm attempting to learn from it... (I learn better by reverse-engineering things...)
[/quote]

You're missing the packet header.

From BNetDocs:
[quote]
(BYTE) StartPacket - always 0xFF
(BYTE) Packet ID
(WORD) Packet length, including this header
(VOID) Packet Data

The BNCS protocol is aggresively enforced by Battle.net - at least, for clients - and violations of the protocol generally result in an IPBan.
[/quote]

People tend to use packet buffers such as DarkMinion's ubiquitous sample to create these headers on demand.
May 3, 2004, 3:45 AM
Zakath
Your send function doesn't automatically calculate and add the packet header to the packet. That's a pretty serious flaw, and is why you're being disconnected. If you send Battle.net something that doesn't have any packet header whatsoever, it'll just boot you from their servers.

All packets in a binary connection should be assembled using your packetbuffer, if that's the method you've employed for setting up the data to be sent to Bnet.
May 3, 2004, 2:13 PM
Adron
[quote author=Anubis link=board=17;threadid=6631;start=0#msg58216 date=1083555405]
(I learn better by reverse-engineering things...)
[/quote]

Does that mean "trying to read source code I didn't write myself", or "analyzing applications for which there is no source code available"?
May 3, 2004, 5:45 PM
Anubis
[quote author=Adron link=board=17;threadid=6631;start=15#msg58265 date=1083606348]
[quote author=Anubis link=board=17;threadid=6631;start=0#msg58216 date=1083555405]
(I learn better by reverse-engineering things...)
[/quote]

Does that mean "trying to read source code I didn't write myself", or "analyzing applications for which there is no source code available"?
[/quote]

Haha, no... I just like to reverse-engineer the source code to learn what line does what...not dismantling applications...
May 3, 2004, 11:04 PM
Myndfyr
[quote author=Anubis link=board=17;threadid=6631;start=15#msg58315 date=1083625475]
[quote author=Adron link=board=17;threadid=6631;start=15#msg58265 date=1083606348]
[quote author=Anubis link=board=17;threadid=6631;start=0#msg58216 date=1083555405]
(I learn better by reverse-engineering things...)
[/quote]

Does that mean "trying to read source code I didn't write myself", or "analyzing applications for which there is no source code available"?
[/quote]

Haha, no... I just like to reverse-engineer the source code to learn what line does what...not dismantling applications...
[/quote]

But see... Reverse-engineering is a process by which we learn how something works by breaking down its component functions from the outside (a "black box"), not by analyzing source code.
May 3, 2004, 11:31 PM
Adron
[quote author=Anubis link=board=17;threadid=6631;start=15#msg58315 date=1083625475]
[quote author=Adron link=board=17;threadid=6631;start=15#msg58265 date=1083606348]
Does that mean "trying to read source code I didn't write myself", or "analyzing applications for which there is no source code available"?
[/quote]

Haha, no... I just like to reverse-engineer the source code to learn what line does what...not dismantling applications...
[/quote]

Ah, I thought that might be the case. "Reading someone else's source code" isn't the most common definition of reverse-engineering.
May 4, 2004, 1:16 AM
FuzZ
[quote author=Anubis link=board=17;threadid=6631;start=15#msg58315 date=1083625475]
[quote author=Adron link=board=17;threadid=6631;start=15#msg58265 date=1083606348]
[quote author=Anubis link=board=17;threadid=6631;start=0#msg58216 date=1083555405]
(I learn better by reverse-engineering things...)
[/quote]

Does that mean "trying to read source code I didn't write myself", or "analyzing applications for which there is no source code available"?
[/quote]

Haha, no... I just like to reverse-engineer the source code to learn what line does what...not dismantling applications...
[/quote]

Thanks, now I know why I don't bother posting help for people anymore.

You're welcome.
May 4, 2004, 4:40 AM

Search