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 


[simple] How to display highest value?

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
engineer_professor
Newbie cheater
Reputation: 0

Joined: 31 Jan 2013
Posts: 10

PostPosted: Thu Jan 31, 2013 12:46 am    Post subject: [simple] How to display highest value? Reply with quote

Hi,
I've written lua scripts before, but never before with cheat engine so I'm a bit lost Smile

I would like a simple script that looks at the value at address 094E0001 and then tells me what the highest value it has seen.
(can it use my custom type which is 4 byte big endian?)

OR, it simply writes all of the values it has seen at that address.

It seems this should be really simple, but I'm totally lost how to accomplish this.

Could you please advise me to accomplish this simple script in this great program? Smile

Thanks!

EDIT:

I just found the answer in this forum:

Code:
al=getAddressList()
mr=addresslist_getMemoryRecord(al,0) --get the first entry in the list
lastValue=memoryrecord_getValue(mr)

print(lastValue)

function readValueTimer(t)
  local currentValue=memoryrecord_getValue(mr)
  if currentValue ~= lastValue then --value changed
    print(currentValue)
    lastValue=currentValue
  end
end

t1=createTimer(nil)
timer_setInterval(t1,100) --check every 1/100th second if the value has changed
timer_onTimer(t1,readValueTimer)


Thanks admin! Very Happy
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites