Posted: Thu Feb 21, 2019 2:27 pm Post subject: Catch Value Change Event in MemoryRecord
So I know there is MemoryRecord.OnActivate & MemoryRecord.OnDeactivate to catch events when the record is activated & deactivated. But is there a property to catch events for when MemoryRecord.Value changes?[/code]
Edit: Something that could be used like:
Code:
local rec = getAddressList().getMemoryRecord(x)
rec.OnChange = function(sender)
print('New value: ' .. rec.Value)
end
Joined: 09 May 2003 Posts: 25796 Location: The netherlands
Posted: Thu Feb 21, 2019 2:47 pm Post subject:
You can use OnGetDisplayValue and use a variable to keep track of the addresses
e.g:
Code:
local oldvalue=nil
AddressList[0].OnGetDisplayValue=function(sender,displayedvalue)
local changed=oldvalue and (oldvalue~=displayedvalue)
oldvalue=displayedvalue
if changed then
print('New value: ' .. displayedvalue)
end
return false,displayedvalue --false because you don't want to change the displayed value
end
(It's still using a timer though, for faster, use a debug register breakpoint) _________________
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
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