https://wiki.cheatengine.org/api.php?action=feedcontributions&user=SoftICE&feedformat=atomCheat Engine - User contributions [en]2024-03-29T15:35:43ZUser contributionsMediaWiki 1.32.0https://wiki.cheatengine.org/index.php?title=Lua:Class:MemoryRecord&diff=1546Lua:Class:MemoryRecord2012-05-18T23:00:41Z<p>SoftICE: added a simple description...</p>
<hr />
<div>--Under Construction<br />
<br />
The class MemoryRecord are the entries in Cheat tables. This class is commonly used with [[Addresslist]].<br />
<br />
----<br />
<br />
<br />
'''MemoryRecord Class'''<br />
The Memoryrecord class object describes a Cheat Table's Cheat Entry.<br />
<br />
<br />
'''memoryrecord_getID'''(memoryrecord)<br />
Returns the unique id of this memory record. Every memory record has an unique id<br />
<br />
<br />
'''memoryrecord_getHotkeyCount'''(memoryrecord)<br />
Returns the number of hotkeys assigned to this Cheat Entry<br />
<br />
<br />
'''memoryrecord_getHotkey'''(memoryrecord, index)<br />
Returns a memoryrecordhotkey class<br />
<br />
<br />
'''memoryrecord_getHotkeyByID'''(memoryrecord, ID) <br />
Every hotkey in a memoryrecord gets an unique ID. This way you can always find the hotkey even if the order of hotkeys has changed (or deleted)<br />
<br />
<br />
'''memoryrecord_setDescription'''(memoryrecord, description) <br />
Sets the specified description for this entry<br />
<br />
<br />
'''memoryrecord_getDescription'''(memoryrecord) <br />
Gets the current description of this entry<br />
<br />
<br />
'''memoryrecord_getAddress'''(memoryrecord) <br />
Returns the address and optional offsets for a pointer (note that in 64-bit kernelmode addresses will be rounded down...)<br />
<br />
<br />
'''memoryrecord_setAddress'''(memoryrecord,address,offsets OPTIONAL) <br />
Sets the address of a entry. You can give as many offsets as you need<br />
<br />
<br />
'''memoryrecord_getType'''(memoryrecord) <br />
Returns the Variable type. (vtByte to vtCustom)<br />
<br />
<br />
'''memoryrecord_setType'''(memoryrecord, vartype) <br />
Sets the type of the entry<br />
<br />
<br />
'''memoryrecord_getValue'''(memoryrecord) <br />
Returns the current value of the cheat table entry as a string<br />
<br />
<br />
'''memoryrecord_setValue'''(memoryrecord, value) <br />
Sets the value of a cheat table entry<br />
<br />
<br />
'''memoryrecord_getScript'''(memoryrecord) <br />
If the entry is of type vtAutoAssembler then you can get the script with this routine<br />
<br />
<br />
'''memoryrecord_setScript'''(memoryrecord, script)<br />
<br />
<br />
'''memoryrecord_isActive'''(memoryrecord)<br />
<br />
<br />
'''memoryrecord_freeze'''(memoryrecord, updownfreeze OPTIONAL)<br />
Sets the entry to frozen state. updownfreeze is optional. 0=freeze, 1=allow increase, 2=allow decrease<br />
<br />
<br />
'''memoryrecord_unfreeze'''(memoryrecord) <br />
Unfreezes an entry<br />
<br />
<br />
'''memoryrecord_setColor'''(memoryrecord, colorrgb) <br />
Sets the color of the entry<br />
<br />
<br />
'''memoryrecord_appendToEntry'''(memoryrecord,memoryrecord) <br />
Adds the entry to another entry<br />
<br />
<br />
'''memoryrecord_delete'''(memoryrecord) <br />
It's unknown what this function does, all that is known is that after using this command other memrec routines with this table entry value don't work anymore...<br />
<br />
<br />
'''memoryrecord_onActivate'''(memoryrecord, function) <br />
Registers a function to be called when a cheat entry is Activated<br />
function (memoryrecord, before, currentstate) boolean<br />
If before is true returning false will cause the activation to stop<br />
<br />
<br />
'''memoryrecord_onDeactivate'''(memoryrecord, function)<br />
Registers a function to be called when a cheat entry is Deactivated<br />
function (memoryrecord, before, currentstate) boolean<br />
If before is true returning false will cause the deactivation to stop<br />
<br />
<br />
'''memoryrecord_onDestroy'''(memoryrecord, function) <br />
Registers a function to be called when a cheat entry is delete<br />
function (memoryrecord)<br />
<br />
<br />
<br />
Example:<br />
<pre><br />
addresslist = getAddressList()<br />
description1= [[Health]]<br />
description2= [[Health Pointer]]<br />
memoryrec1 = addresslist_getMemoryRecordByDescription(addresslist, description1)<br />
memoryrec2 = addresslist_getMemoryRecordByDescription(addresslist, description2)<br />
<br />
desc = memoryrecord_getDescription(memoryrec1) --Gets the current memroyrecord's description<br />
print(desc)<br />
<br />
memoryrecord_setDescription(memoryrec1, [[My new health description]]) --sets the memorydescription<br />
<br />
<br />
value = memoryrecord_getValue(memoryrec2) --Gets the current value of the memory record.<br />
print(value)<br />
<br />
newvalue = 66<br />
memoryrecord_setValue(memoryrec2, newvalue) --sets value for the memoryrecord<br />
<br />
if memoryrecord_isActive(memoryrecord) then --Checks if memoryrecord is in frozen state or not<br />
else<br />
memoryrecord_freeze(memoryrec2) -- freezes the memoryrecord, to unfreeze use memoryrecord_freeze<br />
end<br />
<br />
memoryrecord_setColor(memoryrec2,0x0000FF) --Sets the color of the memoryrecord. Here Red. Color range {0x000000 to 0xFFFFFF)<br />
<br />
count = memoryrecord_getHotkeyCount(memoryrec2) --Gets number of hotkeys associated with memoryrecord<br />
print(count) --From the image, We can see it is 2. <br />
</pre>[[Image:Image.png|frame|CheatEngine Encyclopedia]]<br />
[[Image:Hotkey.png|frame|CheatEngine Encyclopedia]]</div>SoftICEhttps://wiki.cheatengine.org/index.php?title=Lua:Class:Addresslist&diff=1545Lua:Class:Addresslist2012-05-18T22:55:04Z<p>SoftICE: </p>
<hr />
<div>The Addresslist class can be used to access information regarding the Cheat Engine table. It is commonly combined with [[MemoryRecord]].<br />
<br />
'''addresslist_getCount'''(addresslist)<br />
<br />
Returns the ammount of entires in the addresslist.<br />
<br />
Example:<br />
--Assume the table is empty<br />
table=getAddressList()<br />
address=0x2031a3ac<br />
--Create 2 entires<br />
for i=1,2 do <br />
mr=addresslist_createMemoryRecord(table) <br />
memoryrecord_setAddress(mr,address) <br />
<br />
address=address+1 <br />
end <br />
entries=addresslist_getCount(table) -- entries now has the value 2<br />
<br />
<br />
'''addresslist_getMemoryRecord'''(addresslist, index)<br />
<br />
Returns the [[MemoryRecord]] entry. The first object is indexed by 0.<br />
<br />
Example:<br />
table=getAddressList()<br />
memory_record1=addresslist_getMemoryRecord(table,0)<br />
<br />
<br />
'''addresslist_getMemoryRecordByDescription'''(addresslist, string)<br />
<br />
Returns the [[MemoryRecord]] entry matched by the string. The description has to be an exact match, but is case-insensitive<br />
<br />
Example:<br />
--Assume we have a entry in the cheat table with the description "Health"<br />
table=getAddressList()<br />
memory_record=addresslist_getMemoryRecordByDescription(table,"Health")<br />
<br />
<br />
'''addresslist_getMemoryRecordByID'''(addresslist, ID)<br />
<br />
Returns the [[MemoryRecord]] entry matched by the unique ID.<br />
<br />
Example:<br />
--Assume we have a entry in the cheat table with the description "Health"<br />
table=getAddressList()<br />
id=memoryrecord_getID(addresslist_getMemoryRecordByDescription(table,"Health"))<br />
memory_record=addresslist_getMemoryRecordByID(table,id)<br />
<br />
<br />
'''addresslist_createMemoryRecord'''(addresslist)<br />
<br />
Creates an empty memory record at the end of the addresslist.<br />
This function also returns the empty [[MemoryRecord]] entry, which can be used to immediately access the [[MemoryRecord]].<br />
<br />
Example:<br />
--Assume we have a entry in the cheat table with the description "Health"<br />
table=getAddressList()<br />
memory_record=addresslist_createMemoryRecord(table)<br />
memoryrecord_setAddress(memory_record,0x00400000)<br />
<br />
<br />
<br />
----<br />
Don't know what these are:<br />
<br />
'''addresslist_getSelectedRecords'''(addresslist)<br />
Returns a array of selected Cheat Table entires. (??)<br />
<br />
'''addresslist_doDescriptionChange'''(addresslist)<br />
Change description(??)<br />
<br />
'''addresslist_doAddressChange'''(addresslist)<br />
<br />
'''addresslist_doTypeChange'''(addresslist)<br />
<br />
'''addresslist_doValueChange'''(addresslist)<br />
<br />
'''addresslist_getSelectedRecord'''(addresslist)<br />
<br />
'''addresslist_setSelectedRecord'''(addresslist)</div>SoftICEhttps://wiki.cheatengine.org/index.php?title=Lua:Class:Addresslist&diff=1544Lua:Class:Addresslist2012-05-18T22:51:41Z<p>SoftICE: </p>
<hr />
<div>The Addresslist class can be used to access information regarding the Cheat Engine table. It is commonly combined with [[MemoryRecord]].<br />
<br />
'''addresslist_getCount'''(addresslist)<br />
<br />
Returns the ammount of entires in the addresslist.<br />
<br />
Example:<br />
--Assume the table is empty<br />
table=getAddressList()<br />
address=0x2031a3ac<br />
--Create 2 entires<br />
for i=1,2 do <br />
mr=addresslist_createMemoryRecord(table) <br />
memoryrecord_setAddress(mr,address) <br />
<br />
address=address+1 <br />
end <br />
entries=addresslist_getCount(table) -- entries now has the value 2<br />
<br />
'''addresslist_getMemoryRecord'''(addresslist, index)<br />
<br />
Returns the [[MemoryRecord]] entry. The first object is indexed by 0.<br />
<br />
Example:<br />
table=getAddressList()<br />
memory_record1=addresslist_getMemoryRecord(table,0)<br />
<br />
'''addresslist_getMemoryRecordByDescription'''(addresslist, string)<br />
<br />
Returns the [[MemoryRecord]] entry matched by the string. The description has to be an exact match, but is case-insensitive<br />
<br />
Example:<br />
--Assume we have a entry in the cheat table with the description "Health"<br />
table=getAddressList()<br />
memory_record=addresslist_getMemoryRecordByDescription(table,"Health")<br />
<br />
'''addresslist_getMemoryRecordByID'''(addresslist, ID)<br />
<br />
Returns the [[MemoryRecord]] entry matched by the unique ID.<br />
<br />
Example:<br />
--Assume we have a entry in the cheat table with the description "Health"<br />
table=getAddressList()<br />
id=memoryrecord_getID(addresslist_getMemoryRecordByDescription(table,"Health"))<br />
memory_record=addresslist_getMemoryRecordByID(table,id)<br />
<br />
'''addresslist_createMemoryRecord'''(addresslist)<br />
<br />
Creates an empty memory record at the end of the addresslist.<br />
This function also returns the empty [[MemoryRecord]] entry, which can be used to immediately access the [[MemoryRecord]].<br />
<br />
Example:<br />
--Assume we have a entry in the cheat table with the description "Health"<br />
table=getAddressList()<br />
memory_record=addresslist_createMemoryRecord(table)<br />
memoryrecord_setAddress(memory_record,0x00400000)<br />
<br />
<br />
<br />
----<br />
Don't know what these are:<br />
<br />
'''addresslist_getSelectedRecords'''(addresslist)<br />
Returns a array of selected Cheat Table entires. (??)<br />
<br />
'''addresslist_doDescriptionChange'''(addresslist)<br />
Change description(??)<br />
<br />
'''addresslist_doAddressChange'''(addresslist)<br />
<br />
'''addresslist_doTypeChange'''(addresslist)<br />
<br />
'''addresslist_doValueChange'''(addresslist)<br />
<br />
'''addresslist_getSelectedRecord'''(addresslist)<br />
<br />
'''addresslist_setSelectedRecord'''(addresslist)</div>SoftICEhttps://wiki.cheatengine.org/index.php?title=Lua:Class:Addresslist&diff=1543Lua:Class:Addresslist2012-05-18T22:50:15Z<p>SoftICE: Well I created a stub atleast...</p>
<hr />
<div>'''Work in progress'''<br />
<br />
The Addresslist class can be used to access information regarding the Cheat Engine table. It is commonly combined with [[MemoryRecord]].<br />
<br />
'''addresslist_getCount'''(addresslist)<br />
<br />
Returns the ammount of entires in the addresslist.<br />
<br />
Example:<br />
--Assume the table is empty<br />
table=getAddressList()<br />
address=0x2031a3ac<br />
--Create 2 entires<br />
for i=1,2 do <br />
mr=addresslist_createMemoryRecord(table) <br />
memoryrecord_setAddress(mr,address) <br />
<br />
address=address+1 <br />
end <br />
entries=addresslist_getCount(table) -- entries now has the value 2<br />
<br />
'''addresslist_getMemoryRecord'''(addresslist, index)<br />
<br />
Returns the [[MemoryRecord]] entry. The first object is indexed by 0.<br />
<br />
Example:<br />
table=getAddressList()<br />
memory_record1=addresslist_getMemoryRecord(table,0)<br />
<br />
'''addresslist_getMemoryRecordByDescription'''(addresslist, string)<br />
<br />
Returns the [[MemoryRecord]] entry matched by the string. The description has to be an exact match, but is case-insensitive<br />
<br />
Example:<br />
--Assume we have a entry in the cheat table with the description "Health"<br />
table=getAddressList()<br />
memory_record=addresslist_getMemoryRecordByDescription(table,"Health")<br />
<br />
'''addresslist_getMemoryRecordByID'''(addresslist, ID)<br />
<br />
Returns the [[MemoryRecord]] entry matched by the unique ID.<br />
<br />
Example:<br />
--Assume we have a entry in the cheat table with the description "Health"<br />
table=getAddressList()<br />
id=memoryrecord_getID(addresslist_getMemoryRecordByDescription(table,"Health"))<br />
memory_record=addresslist_getMemoryRecordByID(table,id)<br />
<br />
'''addresslist_createMemoryRecord'''(addresslist)<br />
<br />
Creates an empty memory record at the end of the addresslist.<br />
This function also returns the empty [[MemoryRecord]] entry, which can be used to immediately access the [[MemoryRecord]].<br />
<br />
Example:<br />
--Assume we have a entry in the cheat table with the description "Health"<br />
table=getAddressList()<br />
memory_record=addresslist_createMemoryRecord(table)<br />
memoryrecord_setAddress(memory_record,0x00400000)<br />
<br />
<br />
<br />
----<br />
Don't know what these are:<br />
<br />
'''addresslist_getSelectedRecords'''(addresslist)<br />
Returns a array of selected Cheat Table entires. (??)<br />
<br />
'''addresslist_doDescriptionChange'''(addresslist)<br />
Change description(??)<br />
<br />
'''addresslist_doAddressChange'''(addresslist)<br />
<br />
'''addresslist_doTypeChange'''(addresslist)<br />
<br />
'''addresslist_doValueChange'''(addresslist)<br />
<br />
'''addresslist_getSelectedRecord'''(addresslist)<br />
<br />
'''addresslist_setSelectedRecord'''(addresslist)</div>SoftICEhttps://wiki.cheatengine.org/index.php?title=Lua:Class:Addresslist&diff=1542Lua:Class:Addresslist2012-05-18T22:19:16Z<p>SoftICE: Still working just saving just incase of crash</p>
<hr />
<div>'''Work in progress'''<br />
The Addresslist class can be used to access information regarding the Cheat Engine table.<br />
<br />
'''addresslist_getCount'''(addresslist)<br />
<br />
Returns the ammount of entires in the addresslist.<br />
<br />
<br />
'''addresslist_getMemoryRecord'''(addresslist, index)<br />
<br />
Returns the [[MemoryRecord]] entry. The first object is indexed by 0.<br />
<br />
<br />
'''addresslist_getMemoryRecordByDescription'''(addresslist, string)<br />
<br />
Returns the [[MemoryRecord]] entry matched by the string. The description has to be an exact match, but is case-insensitive<br />
<br />
<br />
'''addresslist_getMemoryRecordByID'''(addresslist_getMemoryRecordByID)<br />
<br />
'''addresslist_createMemoryRecord'''(addresslist_createMemoryRecord)<br />
<br />
'''addresslist_getSelectedRecords'''(addresslist_getSelectedRecords)<br />
<br />
<br />
'''addresslist_doDescriptionChange'''(addresslist_doDescriptionChange)<br />
<br />
'''addresslist_doAddressChange'''(addresslist_doAddressChange)<br />
<br />
'''addresslist_doTypeChange'''(addresslist_doTypeChange)<br />
<br />
'''addresslist_doValueChange'''(addresslist_doValueChange)<br />
<br />
'''addresslist_getSelectedRecord'''(addresslist_getSelectedRecord)<br />
<br />
'''addresslist_setSelectedRecord'''(addresslist_setSelectedRecord)</div>SoftICE