Sign in to follow this  
Followers 0

Writing to a Pointer

2 posts in this topic

Hello all,

I'm kind of new in AutoIt so i need some help,

I did this script

#include <NomadMemory.au3>

Global $OffsetX1[2], $OffsetX2[2], $OffsetY1[2],$OffsetY2[2], $hOpen, $iFinal, $iPID, $X1

$iPID = ProcessExists("game.exe")
If $iPID = 0 Then
    MsgBox (0, "Game not found", "Open Game")

SetPrivilege("SeDebugPrivilege", 1)

; X
$OffsetX1[1] = Dec("4")
$OffsetX2[1] = Dec("8")

$X1 = _MemoryPointerRead($iFinal, $hOpen, $OffsetX1, "word")
ConsoleWrite ("Value = " & $X1[1] & @CRLF)

$X2 = _MemoryPointerRead($iFinal, $hOpen, $OffsetX2, "word")
ConsoleWrite ("Value = " & $X2[1] & @CRLF)

; Y
$OffsetY1[1] = Dec("6")
$OffsetY2[1] = Dec("A")

$Y1 = _MemoryPointerRead($iFinal, $hOpen, $OffsetY1, "word")
ConsoleWrite ("Value = " & $Y1[1] & @CRLF)
$Y2 = _MemoryPointerRead($iFinal, $hOpen, $OffsetY2, "word")
ConsoleWrite ("Value = " & $Y2[1] & @CRLF)

It works well for reading position of a character in a game based on pointer.

But now i want to write to a pointer this way :

If X1[1] is superior to X2[2] add -2 to X1

if it is inferior add +2.

(And then same for Y)

I tried with MemoryPointerWrite but I didn't manage to make it work.

Thanks for your Help!

Share this post

Link to post
Share on other sites

This topic is now closed to further replies.
Sign in to follow this  
Followers 0