hi all,
I have a record that represents the categories of items in my game, and within each category, there are subRecords. I want to monitor the count of subRecords within each category to ensure it matches the corresponding value. For example, if I have 60 items, I expect there to be 60 subRecords. If the item count changes to 80, I want the subRecord count to increase to 80 as well.
I am aware of the timer-based approach to achieve this, but I'm interested in exploring alternative methods that do not rely on a timer. I would appreciate any suggestions or insights from the Cheat Engine community on different approaches to dynamically monitoring and adjusting the count of subRecords based on changes to the item count. If you have any code examples or alternative methods to propose, I would be grateful for your input. Thank you in advance for your assistance.
count of subrecords
Re: I need some help!
^
A general approach ( not LUA specific ) would be:
A general approach ( not LUA specific ) would be:
- a) find out what writes to the "record that represents the categories of items"
- b) hook it
- c) write the same value also to the subRecords field
Re: count of subrecords
Each record with 'Value' to be displayed (eg. not include script/group etc.) may attached a function to alter what it display.
The function is like an OnTimer function of a Timer, only enabled when the record can be 'seen', disabled when 'hidden' (eg. under a collapsed parent record). So it can be auto-update the displayed value in real time.
test: make a record with description 'DISP', of string type, len 0. put some other records under it.
Run this script:
This will display a time and the number of its child count.
You may also loop through all child record, check that it is valid <sum to validCount>, then display as
The function is like an OnTimer function of a Timer, only enabled when the record can be 'seen', disabled when 'hidden' (eg. under a collapsed parent record). So it can be auto-update the displayed value in real time.
Code: Select all
MemoryRecord Class:
...
OnGetDisplayValue: function(memoryrecord,valuestring):boolean,string -
This function gets called when rendering the value of a memory record.
Return true and a new string to override the value shown
Run this script:
Code: Select all
local al = GetAddressList()
local mr = al.getMemoryRecordByDescription'DISP'
if mr then
mr.OnGetDisplayValue = function(mr, val)
return true, os.date'%X : ' .. mr.Count
end
end
You may also loop through all child record, check that it is valid <sum to validCount>, then display as
Code: Select all
return true, validCount..' / '.. mr.Count
Who is online
Users browsing this forum: Google [Bot]