Valhalla Legends Forums Archive | Battle.net Bot Development | D2GS

AuthorMessageTime
LordNevar
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.

[code]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[/code]

Any feedback would be much appreciated.[code][/code]
August 17, 2004, 7:28 AM
Newby
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:

[code]PacketID as Byte
PacketID = Val("&H" & Mid(Data, 1, 2))[/code]
Would fix the problem I think.
August 17, 2004, 7:33 AM
LordNevar
Thanxs guy's.
August 17, 2004, 4:07 PM
UserLoser.
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.
August 17, 2004, 5:15 PM
LordNevar
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.
August 17, 2004, 6:19 PM
NiNe
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!
August 20, 2004, 6:26 PM
LordNevar
FIXED: Thanxs for everyone's help, especially OnlyMeat, HackeZ, and Stealth. :)
August 22, 2004, 12:18 PM

Search