• Welcome to Valhalla Legends Archive.
 

WAR3 Bot Questions

Started by Anubis, May 02, 2004, 08:33 PM

Previous topic - Next topic

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

Eli_1

#1
Quote from: Anubis on May 02, 2004, 08:33 PM
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?
That is how you send data with the CHAT protocol, WAR3 is much different.

Quote from: Anubis on May 02, 2004, 08:33 PM
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?
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.

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?...

effect

#3
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).
Quote from: Mangix on March 22, 2005, 03:03 AM
i am an expert Stealthbot VBScript. Recognize Bitch.

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?

effect

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
Quote from: Mangix on March 22, 2005, 03:03 AM
i am an expert Stealthbot VBScript. Recognize Bitch.

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?

effect

Winsock.sendData text1.text
Quote from: Mangix on March 22, 2005, 03:03 AM
i am an expert Stealthbot VBScript. Recognize Bitch.

Anubis

Quote from: effect on May 02, 2004, 10:08 PM
Winsock.sendData text1.text

Tried that...it disconnects me

effect

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?)
Quote from: Mangix on March 22, 2005, 03:03 AM
i am an expert Stealthbot VBScript. Recognize Bitch.

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)...

effect

I think its time you show some code? from the point of origin of your problem.
Quote from: Mangix on March 22, 2005, 03:03 AM
i am an expert Stealthbot VBScript. Recognize Bitch.

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.


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

FuzZ

Quote from: Anubis on May 02, 2004, 08:33 PM
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

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.

Anubis

#14
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...)