View previous topic :: View next topic |
Author |
Message |
abahbob Advanced Cheater Reputation: 0
Joined: 14 Aug 2007 Posts: 63
|
Posted: Sat Dec 08, 2012 3:35 pm Post subject: Print out value every time it changes |
|
|
So, pretty much I want a script that will print out a value at a specific address everytime it changes. I can't manage to get it to print out correctly, as it is 4 Byte Big Endian. So pretty much I would like it to get printed out to the console or some way I can put it into a spreadsheet, already converted.
_________________
|
|
Back to top |
|
|
Dark Byte Site Admin Reputation: 458
Joined: 09 May 2003 Posts: 25295 Location: The netherlands
|
Posted: Sat Dec 08, 2012 4:57 pm Post subject: |
|
|
Since ce's lua doesn't have support for readCustomTypeAsInt()/readCustomTypeAsFloat() yet you'll need to add the big endian address to the addresslist using the big endian custom type ( http://forum.cheatengine.org/viewtopic.php?t=544988 ) and then use lua to read it as a string
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)
|
to stop execute
_________________
Do not ask me about online cheats. I don't know any and wont help finding them.
Like my help? Join me on Patreon so i can keep helping |
|
Back to top |
|
|
abahbob Advanced Cheater Reputation: 0
Joined: 14 Aug 2007 Posts: 63
|
Posted: Sat Dec 08, 2012 6:06 pm Post subject: |
|
|
Wow Dark Byte, thanks a ton!
_________________
|
|
Back to top |
|
|
engineer_professor Newbie cheater Reputation: 0
Joined: 31 Jan 2013 Posts: 10
|
Posted: Thu Jan 31, 2013 1:12 am Post subject: |
|
|
How can I make this script check the address more often?
It is missing at least 50% of the values. This means it is not printing 50% of the values.
Thanks!!
EDIT:
I found that changing the setinterval to 10 now prints all values.
Dark Byte wrote: |
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)
|
to stop execute
|
|
|
Back to top |
|
|
|