❓ ReadMemory [help]
i've searched online how i can readMemory with ahk, i had to put this in my library so i can use this function in the future.
now i've wrote the following code but it always gives me maxhp 0 curHP 0.
the win activate for trove.exe is to see if i can activate the window (it doesnt work) :/
Code:
ReadMemory(MADDRESS,PROGRAM)
{
winget, pid, PID, %PROGRAM%
VarSetCapacity(MVALUE,4,0)
ProcessHandle := DllCall("OpenProcess", "Int", 24, "Char", 0, "UInt", pid, "UInt")
;DllCall("ReadProcessMemory","UInt",ProcessHandle,"UInt",MADDRESS,"Str",MVALUE,"UInt",4,"UInt *",0)
DllCall("ReadProcessMemory", "UInt", ProcessHandle, "Ptr", MADDRESS, "Ptr", &MVALUE, "Uint",4)
Loop 4
result += *(&MVALUE + A_Index-1) << 8*(A_Index-1)
return, result
}
the win activate for trove.exe is to see if i can activate the window (it doesnt work) :/
Code:
^s:: WinActivate trove.exe maxHP := ReadMemory(2164BEA0, "Trove") currHP := ReadMemory(2164BE9C, "Trove") MsgBox maxhp %maxHP% currHP %currHP% esc::exitapp r::Reload
