[Autoit]Char co-ords?

05/26/2009 14:03 |Jonny|#1
What I want to do is get my chars co-ords and click on co-ords to get my char to move(obviously) I have searched for this and what i found didn't seem to work for me. Could anyone help, maybe write a small guide or an example code?
05/27/2009 18:07 |Jonny|#2
bump

so now i know how to get the memory address and to read it but i still don't understand.

for example:
Code:
WinActivate("[Conquer2.0]")
$ID=_MemoryOpen(ProcessExists("conquer.exe"))
$X=0x02A90954
$Y=0x02A90958
$HP=0x11F1BBB

$CurrentX=_MemoryRead($X, $ID)
$CurrentY=_MemoryRead($Y, $ID)
but then i don't know how to click an actual X/Y position within the game.

Like lets say $X is 300 and $Y is 350 how do i make it click X 301 and Y 351?

I can't figure it out any advice?
05/27/2009 19:13 clintonselke#3
BTW those are dynamic memory addresses, when u restart conquer and run it again, they will no longer be at the same address.

(The memory addresses obtained from IAmHawtness's thread "Lets talk about the new changes")

$ID=_MemoryOpen(ProcessExists("conquer.exe"))
$PlayerBase = _MemoryRead(0x0064FF48, $ID)
$X=0x0298
$Y=0x029C

$CurrentX=_MemoryRead($PlayerBase + $X, $ID)
$CurrentY=_MemoryRead($PlayerBase + $Y, $ID)

The HP value will always change too, but i dont know an easy way to obtain that using only memory reads.

What it looks like u wanna do is convert map coordinates into mouse coordinates?, so u click in the right spot to jump to the right map coords?

What i would do is from ur player coords calculate the delta to the map coords u wanna move to.

deltaX = mapX - playerX
deltaY = mapY - playerY

And then try and convert those Delta map coordinates into Delta screen coordinates (using the centre of the screen as a reference).

One thing u know is a (0,+a) delta screen coords, causes a (+c,+c) delta map coords AND a (+b,0) delta screen coords, causes a (+d,-d) delta map coordinates... which means its possible to convert from delta screen coords to delta map coords, and what u need to do is convert it backwards (possibly by solving some linear equation).

Let dx be map delta x
Let dy be map delta y
Let mdx be mouse delta x (mouse x minus center x of screen)
Let mdy be mouse delta y (mouse y minus center y of screen)

dx = Q*mdx + R*mdy
dy = Q*mdx - R*mdy

so now take 2 sample datas from conquer in order to solve for Q & R

now after u have solved Q & R u can produce the following matrix formula.

PHP Code:
dx ]    [ Q    R ]    [ mdx ]
dy ] = [ Q   -mdy 
and solving for the inverse of the following matrix...

PHP Code:
Q   R]
Q  -R
u can use the inverse matrix to move from delta map coordinates to delta mouse coordinates and thus find out where u need to click in order to move to a certain map coordinate.

PHP Code:
         ( [ Q  R ] )                           [ R    R ]
inverse( [ -] ) =  (/ (2*Q*R)) Q  -
and forgive me if there are any errors... its 4am in the morning xD

Edit: I've done a similar thing b4 [Only registered and activated users can see links. Click Here To Register...]

The matrix equations might like look a bit crazy... they never seem to line up properly :p
05/27/2009 19:36 |Jonny|#4
thanks for your reply, i think i'll give that delta idea a go though, probably take a hell of a long time tho. and about what you said about the thread "Lets talk about the new changes" if i do the $X an $Y like that, is it static?
05/27/2009 19:43 clintonselke#5
Quote:
Originally Posted by |Jonny| View Post
thanks for your reply, i think i'll give that delta idea a go though, probably take a hell of a long time tho. and about what you said about the thread "Lets talk about the new changes" if i do the $X an $Y like that, is it static?
yeap thats static from that thread. It will only change if TQ patch their conquer.exe.
05/28/2009 17:22 clintonselke#6
$ID=_MemoryOpen(ProcessExists("conquer.exe"))
$PlayerBase = _MemoryRead(0x0064FF48, $ID)

$Base2 = _MemoryRead($PlayerBase + 0x800, $ID)

$CurrentHP = _MemoryRead($Base2 + 0x1D00, $ID)

that worked on my conquer when i opened and closed it a few times, i think its static accessing it that way.
05/29/2009 12:25 |Jonny|#7
Quote:
Originally Posted by clintonselke View Post
$ID=_MemoryOpen(ProcessExists("conquer.exe"))
$PlayerBase = _MemoryRead(0x0064FF48, $ID)

$Base2 = _MemoryRead($PlayerBase + 0x800, $ID)

$CurrentHP = _MemoryRead($Base2 + 0x1D00, $ID)

that worked on my conquer when i opened and closed it a few times, i think its static accessing it that way.
oh thanks i'm glad you found that, i needed it to finish a few of my bots off i don't like using pixels to pot


and jonny999 isnt me :/