FreeER Grandmaster Cheater Supreme
Reputation: 53
Joined: 09 Aug 2013 Posts: 1091
|
Posted: Wed Apr 26, 2017 5:29 am Post subject: |
|
|
Sure, though you do need some way to tell how many monsters there are so that you know when to stop.
1 way is to assume you know (or can find) a length:
Code: | -- get numeric address
local enemyBase = getAddress("[game.exe]+220")
-- loop over each enemy
for i=0,length-1 do
r=readInteger(enemyBase+0x1c68*i)
-- do something with r, eg. table.insert(enemyList, r) or writeInteger(enemyBase+0x1c68*i, r-100)
end |
you could also assume that there's a 0 value after the last enemy (like how C strings are 0 terminated) eg,
Code: | local i=0
while true do
local strAddress = "[game.exe]+" .. string.format('%X', 0x220 +0x1C68*i)
r=readInteger(strAddress)
i=i+1
if r == 0 then break end -- stop the loop if done
-- do something with r
end |
|
|