Valhalla Legends Archive

Programming => Battle.net Bot Development => Topic started by: LordNevar on August 17, 2004, 02:28 AM

Title: D2GS
Post by: LordNevar on August 17, 2004, 02:28 AM
I am having problems with 0xAE, and I been working for hours and I can't figure out what the exact problem is. I have an idea but could use some feedback on what you think.

Public Sub ParseD2GS(Data As String)
   Dim PacketID As Byte
       PacketID = Asc(Mid(Data, 1, 3)) <~~~~Is What I think problem is.
   Select Case PacketID
       Case &HAE
           With pBuffer
               .InsertBYTE &H4
               .InsertBYTE &HA
               .InsertDWORD &H0
               .InsertNTString MCP.CharName
               .InsertBYTE &H0
               .InsertBYTE &HAA
               .InsertNonNTString "ok"
               .InsertDWORD &H4
               .SendD2GSPacket &H67
               rtbAdd "We actually saw it" & vbNewLine, vbWhite
           End With
       End Select
End Sub


Any feedback would be much appreciated.
Title: Re:D2GS
Post by: Newby on August 17, 2004, 02:33 AM
Mid(str, start, length)

The Asc() will return the ascii of the first character only. And if your Data string is in the ascii of each byte (i.e the string holds the characters "FF ?? ?? ??"), then that isn't gonna work very well.

Perhaps something like this:

PacketID as Byte
PacketID = Val("&H" & Mid(Data, 1, 2))

Would fix the problem I think.
Title: Re:D2GS
Post by: LordNevar on August 17, 2004, 11:07 AM
Thanxs guy's.
Title: Re:D2GS
Post by: UserLoser. on August 17, 2004, 12:15 PM
So you're writing a game bot without decompressing the data?  I have, after decompressing the 0xae packet, it should actually be packet 0x86.  Although, I could be wrong on this and i'll go check my self. Btw, PacketId = Asc(Left$(Data, 1)), no?

Hmm, after doing very little work, it looks like the data is decompressed if it's > 1 in length, but like I said; I could be wrong.
Title: Re:D2GS
Post by: LordNevar on August 17, 2004, 01:19 PM
I'm not writing a bot designed to mimmic ingame play for D2, I could just script that using the actual game. I'm just making a bot that makes game's and sits in them so people can mule without 2 windows of D2 open.
Title: Re:D2GS
Post by: NiNe on August 20, 2004, 01:26 PM
0x67 has a fixed length of 29 bytes if i can remember. Need to Pad the D2 Char name, (15 bytes *Total*), IIRC You send The Values, MCP gives you in 0x04 values 1 & 2 , Then Your Char CLass (sorc, Barb, ect..) Then The Version Byte, Null Dword, Padded Char name, Make Sure It is a fixed length of 29 bytes befor you send it, Dont want to get ipbanned

Should = 29 bytes!
Title: Re:D2GS
Post by: LordNevar on August 22, 2004, 07:18 AM
FIXED: Thanxs for everyone's help, especially OnlyMeat, HackeZ, and Stealth. :)