Valhalla Legends Forums Archive | Battle.net Bot Development | [VB6] D2GS Run packet 0x03 - Check this.

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

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 ...
January 29, 2009, 7:47 PM
zeroirc
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)
January 30, 2009, 5:30 AM
fataly
Thaks for reply,
I will test it when im @ home :)
January 30, 2009, 5:45 AM
fataly
My code need "hexi" to work, so.. not working
January 30, 2009, 6:58 PM
zeroirc
[QUOTE]
03 50 50 43 50          'you sent this?
[/QUOTE]

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

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
January 31, 2009, 3:44 PM
fataly
It works if i manually write coords, like
[code]
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
[/code]

and this works when i use showchat only to see what coords i have tell to MyX
[code]
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
[/code]

BUT, if i try get x and y coords and send it like this:
[code]
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
[/code]

I just get "Byref argument type mismatch" - and this means i declared something  wrong or not even declared ?

Btw thanks for posting :)
January 31, 2009, 5:54 PM
fataly
The code is working, but it dosent move my char.... help me please this is SIMPLE packet but i fail it :FFFF
[code]
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
[/code]


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

And packet logs..
[code]
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.
[/code]
February 5, 2009, 6:08 PM
Spht
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:

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

[code]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[/code]
February 5, 2009, 6:44 PM
fataly
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.
February 5, 2009, 7:17 PM
Archangel
maybe you should compare it?
February 14, 2009, 7:30 AM

Search