Public Sub D2GSsend0x03()
Dim hexi As String
hexi = "&H"
myx = px
myY = py
myx = myx + 2 ' This is just test , idea is the move char to Right 2 spaces.
Call iClear
Call iWORD(hexi & myx)
Call iWORD(hexi & myY)
Call iHEADER(&H3, D2GS_HEADER)
Call iPacket(Form1.Winsock3.SocketHandle)
ShowChat vbGreen, "Moving character from " & px & " : " & py & " To: " & myx & " : " & myY
End Sub
Packet log send 0x03:
03 50 50 43 50 .PPCP
And coord in my form:
(i recv location on 0x15)
[21:44:04] location X : 5048
[21:44:04] location y : 5043
So, whats wrong? I tried solve this on 1 week now. And imnot sure why this sends packets wrong order? or does it need ?;F
EDIT: Looks like these are reversed, does some1 got proof of this?
also i regonize the UID ( like npc ) must make to hex ...
Call iClear
Call iWORD(myx) - hexi & myx its incorrect.
Call iWORD(myY) - hexi & myy its incorrect.
Call iHEADER(&H3, D2GS_HEADER)
Call iPacket(Form1.Winsock3.SocketHandle)
Thaks for reply,
I will test it when im @ home :)
My code need "hexi" to work, so.. not working
Quote
03 50 50 43 50 'you sent this?
50 5C - X (its 20560, incorrect)
43 50 - Y (its 17232, incorrect)
Quote
[21:44:04] location X : 5048
[21:44:04] location y : 5043
Use this code.
Call iClear
Call iWORD(5050) - no use hexi
Call iWORD(5043) - no use hexi
Call iHEADER(&H3, D2GS_HEADER)
Call iPacket(Form1.Winsock3.SocketHandle)
sorry poor english
It works if i manually write coords, like
Public Sub D2GSsend0x03(ByVal myx As Long, ByVal myy As Long)
myx = px + 2
myy = py
Call iClear
Call iWORD(form1.text1.text)
Call iWORD(form1.text2.text)
Call iHEADER(&H3, D2GS_HEADER)
Call iPacket(Form1.Winsock3.SocketHandle)
ShowChat vbGreen, "Moving character from " & px & " : " & py & " To: " & px & " : " & py
End Sub
and this works when i use showchat only to see what coords i have tell to MyX
Public Sub D2GSsend0x03(ByVal myx As Long, ByVal myy As Long)
myx = px + 2
myy = py
Call iClear
ShowChat vbGreen, myx & myy
Call iHEADER(&H3, D2GS_HEADER)
Call iPacket(Form1.Winsock3.SocketHandle)
ShowChat vbGreen, "Moving character from " & px & " : " & py & " To: " & px & " : " & py
End Sub
BUT, if i try get x and y coords and send it like this:
Public Sub D2GSsend0x03(ByVal myx As Long, ByVal myy As Long)
myx = px + 2
myy = py
Call iClear
call iWORD(myx)
Call iWORD(myy)
ShowChat vbGreen, myx & myy
Call iHEADER(&H3, D2GS_HEADER)
Call iPacket(Form1.Winsock3.SocketHandle)
ShowChat vbGreen, "Moving character from " & px & " : " & py & " To: " & px & " : " & py
End Sub
I just get "Byref argument type mismatch" - and this means i declared something wrong or not even declared ?
Btw thanks for posting :)
The code is working, but it dosent move my char.... help me please this is SIMPLE packet but i fail it :FFFF
Public Sub D2GSsend0x03(ByVal px As Integer, ByVal py As Integer)
Dim myx As Integer
Dim myy As Integer
'Left = X-
'Right = X+
'Down = Y-
'Up = Y+
myx = px + 2
myy = py
Call iClear
Call iWORD(myx)
Call iWORD(myy)
Call iHEADER(&H3, D2GS_HEADER)
Call iPacket(Form1.Winsock3.SocketHandle)
ShowChat vbGreen, "Moving character from " & px & " : " & myx & " To: " & px & " : " & myy
End Sub
Quote
[20:18:07] Object type : 0
[20:18:07] Object id : 184990981
[20:18:07] location X : 5813
[20:18:07] location y : 4723
[20:18:07] Boolean : 1
[20:18:08] Moving character from 5813 : 4723 To: 5815 : 4723
And packet logs..
63.240.202.62:4000 80.222.42.161:4754 Recv
0D 58 0C C7 80 1A 5E 05 A6 C3 9A 65 A0 .X....^....e.
63.240.202.62:4000 80.222.42.161:4754 Recv
0C 58 3A 9F 0D 92 83 C3 61 E9 32 D0 .X:.....a.2.
80.222.42.161:4754 63.240.202.62:4000 Send
03 B7 16 73 12 ...s.
I don't recall this be particularly hard thing to do... i wrote a simple gsclient in vb over a year ago when i was first learning the protocol and one of the things it did was follow a player and attack everything it attacked
Here's an excerpt from the source:
Case &HF
'D2GS_PLAYERMOVE
p(0) = Asc(Mid$(s, 1, 1))
p(1) = GetDWORD(Mid$(s, 2, 4))
p(2) = Asc(Mid$(s, 6, 1))
p(3) = GetWORD(Mid$(s, 7, 2))
p(4) = GetWORD(Mid$(s, 9, 2))
p(5) = Asc(Mid$(s, 11, 1))
p(6) = GetWORD(Mid$(s, 12, 2))
p(7) = GetWORD(Mid$(s, 14, 2))
UpdatePlayer p(0), p(1), vbNullString, 0, p(3), p(4)
If FollowId = p(1) Then DoMove p(3), p(4)
Public Sub DoMove(ByVal x As Integer, ByVal y As Integer)
If MyInfo.MyId <> -1 Then
PacketBuf.InsertWORD x
PacketBuf.InsertWORD y
If Sqr(((MyInfo.MyX - x) ^ 2) + ((MyInfo.MyY - y) ^ 2)) > 5 Then
'Run to catch up
PacketBuf.SendPacket Connection.wsGSClient, 3
Else
'Walk
PacketBuf.SendPacket Connection.wsGSClient, 1
End If
UpdatePlayer 0, MyInfo.MyId, vbNullString, 0, x, y
End If
End Sub
Thanks for answer, but this dont give me help :( i got my own d2gs pmove allready, only think is that 0x03 what does not work. But i will try.
maybe you should compare it?