Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Cheat Engine Forum Index
PostGo back to topic
FreeER
Grandmaster Cheater Supreme
Reputation: 53
Joined: 09 Aug 2013
Posts: 1091

PostPosted: 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
Back to top
View user's profile Send private message
Post reviews:   Approve 1
Author Review
Twistedfate
Review: Approve
Post reference:
ReviewPosted: Wed Apr 26, 2017 5:54 am

thnx man <3
Back to top
View user's profile Send private message
Display:  
Cheat Engine Forum Index


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites