[codeing] XYZ packet process ?

01/10/2011 21:50 acer20006#1
hii all
i don't know if this the right section for my question or i should post in code corner section
so any way
i have problem with XYZ packets , i cant figure out how to change it from HEx to the numbers that's appear at the game client windows

her's a part of the packets which include the XYZ

hex = 01855CDF066E007800 (from game X=-209 y=11)
X = 01855CDF
Y = 066E0078
Z = 00

so i hope any one explain how to change HEX to XY
thanks
01/10/2011 22:21 [Wicked]#2
HEX -> INT ?
01/10/2011 22:25 DaxterSoul#3
Your packet seems wrong?!
The position always looks like this
Byte XSec
Byte YSec
Float XOffset
Float ZOffset
Float YOffset
Word Rotation

How to converrt offset into gamecoord
(XSec - 135) * 192 + (XOffset / 10)
(YSec - 92) * 192 + (YOffset / 10)
01/10/2011 22:40 acer20006#4
Quote:
Originally Posted by DaxterSoul View Post
Your packet seems wrong?!
The position always looks like this
Byte XSec
Byte YSec
Float XOffset
Float ZOffset
Float YOffset
Word Rotation

How to converrt offset into gamecoord
(XSec - 135) * 192 + (XOffset / 10)
(YSec - 92) * 192 + (YOffset / 10)
is that's want y mean ?

Byte XSec 01
Byte YSec 06
Float XOffset 855CDF
Float ZOffset 6E0078
Float YOffset 00
01/10/2011 23:20 illstar#5
Code:
[byte] Flag		0x01 --> click on ground
[byte] Xsection		0x85 --> 133 
[byte] Ysection		0x52 --> 92
[short] Xoffset		0xdf06 --> 1756
[short] Zcoord		0x6e00 --> 110
[short] Yoffset		0x7800 --> 120
X = (Xsection - 135) * 192 + (Xoffset / 10)
Y = (Ysection - 92) * 192 + (Yoffset / 10)

X= -208,1
Y= 12
01/10/2011 23:36 acer20006#6
Quote:
Originally Posted by illstar View Post
Code:
[byte] Flag		0x01 --> click on ground
[byte] Xsection		0x85 --> 133 
[byte] Ysection		0x52 --> 92
[short] Xoffset		0xdf06 --> 1756
[short] Zcoord		0x6e00 --> 110
[short] Yoffset		0x7800 --> 120
X = (Xsection - 135) * 192 + (Xoffset / 10)
Y = (Ysection - 92) * 192 + (Yoffset / 10)

X= -208,1
Y= 12
that's great thanks , but just one last question , you used(( DEC ))to change y,x section ,,, but how you change Xoffset from 0xdf06 to 1756 ??


how to edit it in autoit ?
01/11/2011 00:12 illstar#7
Change byte order from Littel-endian to Big-endian

[Only registered and activated users can see links. Click Here To Register...]


and use windows calc to convert it from hex to dez
0xdf06 --> Hex(06fd) --> Dez(1789)
01/11/2011 00:20 acer20006#8
Quote:
Originally Posted by illstar View Post
Change byte order from Littel-endian to Big-endian

[Only registered and activated users can see links. Click Here To Register...]


and use windows calc to convert it from hex to dez
0xdf06 --> Hex(06fd) --> Dez(1789)
my wrong i shoud not type 7800 in calculator
thx for help , i really appreciate your help ^^
problem solved
01/16/2011 22:51 acer20006#9
1st special thx to illstar and DaxterSoul for help
i have new problem in how to change X,Y ingame to packets again (section-offset)
DaxterSoul help me with code of how to change it
XSec =(Round((pX / 192) + 135.0))
Xpac =((pX - ((XSec) - 135) * 192) * 10)
X,Ysec no problem in then , my real problem is in Xpac
of exm~
hex = 01855CDF066E007800
pX = -208,1
[byte] Flag 0x01 --> click on ground
[byte] Xsection 0x85 --> 133
[short] Xoffset 0xdf06 --> 1756

Xpac =((208,1- ((133 ) - 135) * 192) * 10) it's supposed to be = 1756
but i get 5921

any help ??/
01/17/2011 12:14 illstar#10
GetSector
XSec =(Round((pX / 192) + 135.0)) <--- rounddown

GetOffset
offset = pX mod 192 --> (-16,1)
if offset < 0 then then offset =192 + offset -->(175,9)
xPax = offset *10 -->(1759)

------------------------------
that should do the job
01/17/2011 20:57 acer20006#11
Quote:
Originally Posted by illstar View Post
GetSector
XSec =(Round((pX / 192) + 135.0)) <--- rounddown

GetOffset
offset = pX mod 192 --> (-16,1)
if offset < 0 then then offset =192 + offset -->(175,9)
xPax = offset *10 -->(1759)

------------------------------
that should do the job
thx bro ^^
09/19/2012 15:14 AymanEG#12
So can you post the working script to get the x , y, z position ? :D