• Welcome to Valhalla Legends Archive.
 

D2GS

Started by LordNevar, August 17, 2004, 02:28 AM

Previous topic - Next topic

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.

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.

A good fortune may forbode a bad luck, which may in turn disguise a good fortune.
The greatest trick the Devil ever pulled, was convincing the world he didn't exsist.

Newby

#1
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.
- 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.

LordNevar


A good fortune may forbode a bad luck, which may in turn disguise a good fortune.
The greatest trick the Devil ever pulled, was convincing the world he didn't exsist.

UserLoser.

#3
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.

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.

A good fortune may forbode a bad luck, which may in turn disguise a good fortune.
The greatest trick the Devil ever pulled, was convincing the world he didn't exsist.

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!

LordNevar

FIXED: Thanxs for everyone's help, especially OnlyMeat, HackeZ, and Stealth. :)

A good fortune may forbode a bad luck, which may in turn disguise a good fortune.
The greatest trick the Devil ever pulled, was convincing the world he didn't exsist.