Difference between revisions of "Lua:Class:MemoryRecord"

From Cheat Engine
Jump to navigation Jump to search
Line 109: Line 109:
 
memoryrec2 = addresslist_getMemoryRecordByDescription(addresslist, description2)
 
memoryrec2 = addresslist_getMemoryRecordByDescription(addresslist, description2)
  
desc = memoryrecord_getDescription(memoryrec1)
+
desc = memoryrecord_getDescription(memoryrec1)   --Gets the current memroyrecord's description
 
print(desc)
 
print(desc)
  
memoryrecord_setDescription(memoryrec1, [[My new health description]])
+
memoryrecord_setDescription(memoryrec1, [[My new health description]]) --sets the memorydescription
  
  
value = memoryrecord_getValue(memoryrec2)
+
value = memoryrecord_getValue(memoryrec2)   --Gets the current value of the memory record.
 
print(value)
 
print(value)
  
 
newvalue = 66
 
newvalue = 66
memoryrecord_setValue(memoryrec2, newvalue)
+
memoryrecord_setValue(memoryrec2, newvalue)   --sets value for the memoryrecord
  
memoryrecord_freeze(memoryrec2)         -- to unfreeze use memoryrecord_freeze
+
if memoryrecord_isActive(memoryrecord) then  --Checks if memoryrecord is in frozen state or not
memoryrecord_setColor(memoryrec2,0x0000FF)     -- Color codes should in hex values (range: 0x000000 to 0xFFFFFF )     
+
memoryrecord_freeze(memoryrec2) -- freezes the memoryrecord, to unfreeze use memoryrecord_freeze
 +
end
 +
 
 +
memoryrecord_setColor(memoryrec2,0x0000FF) --Sets the color of the memoryrecord. Here Red. Color range {0x000000 to 0xFFFFFF)     
 
</pre>[[Image:Image.png|frame|CheatEngine Encyclopedia]]
 
</pre>[[Image:Image.png|frame|CheatEngine Encyclopedia]]
 
[[Image:Hotkey.png|frame|CheatEngine Encyclopedia]]
 
[[Image:Hotkey.png|frame|CheatEngine Encyclopedia]]

Revision as of 09:19, 14 April 2012

--Under Construction

MemoryRecord Class

 The Memoryrecord class object describes a Cheat Table's Cheat Entry.


memoryrecord_getID(memoryrecord)

 Returns the unique id of this memory record. Every memory record has an unique id


memoryrecord_getHotkeyCount(memoryrecord)

 Returns the number of hotkeys assigned to this Cheat Entry


memoryrecord_getHotkey(memoryrecord, index)

 Returns a memoryrecordhotkey class


memoryrecord_getHotkeyByID(memoryrecord, ID)

 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)


memoryrecord_setDescription(memoryrecord, description)

 Sets the specified description for this entry


memoryrecord_getDescription(memoryrecord)

 Gets the current description of this entry


memoryrecord_getAddress(memoryrecord)

 Returns the address and optional offsets for a pointer (note that in 64-bit kernelmode addresses will be rounded down...)


memoryrecord_setAddress(memoryrecord,address,offsets OPTIONAL)

 Sets the address of a entry. You can give as many offsets as you need


memoryrecord_getType(memoryrecord)

 Returns the Variable type. (vtByte to vtCustom)


memoryrecord_setType(memoryrecord, vartype)

 Sets the type of the entry


memoryrecord_getValue(memoryrecord)

 Returns the current value of the cheat table entry as a string


memoryrecord_setValue(memoryrecord, value)

 Sets the value of a cheat table entry


memoryrecord_getScript(memoryrecord)

 If the entry is of type vtAutoAssembler then you can get the script with this routine


memoryrecord_setScript(memoryrecord, script)


memoryrecord_isActive(memoryrecord)


memoryrecord_freeze(memoryrecord, updownfreeze OPTIONAL)

 Sets the entry to frozen state. updownfreeze is optional. 0=freeze, 1=allow increase, 2=allow decrease


memoryrecord_unfreeze(memoryrecord)

 Unfreezes an entry


memoryrecord_setColor(memoryrecord, colorrgb)

 Sets the color of the entry


memoryrecord_appendToEntry(memoryrecord,memoryrecord)

 Adds the entry to another entry


memoryrecord_delete(memoryrecord)

 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...


memoryrecord_onActivate(memoryrecord, function)

 Registers a function to be called when a cheat entry is Activated
   function (memoryrecord, before, currentstate) boolean
   If before is true returning false will cause the activation to stop


memoryrecord_onDeactivate(memoryrecord, function)

 Registers a function to be called when a cheat entry is Deactivated
   function (memoryrecord, before, currentstate) boolean
   If before is true returning false will cause the deactivation to stop


memoryrecord_onDestroy(memoryrecord, function)

 Registers a function to be called when a cheat entry is delete
   function (memoryrecord)


Example:

addresslist = getAddressList()
description1= [[Health]]
description2= [[Health Pointer]]
memoryrec1 = addresslist_getMemoryRecordByDescription(addresslist, description1)
memoryrec2 = addresslist_getMemoryRecordByDescription(addresslist, description2)

desc = memoryrecord_getDescription(memoryrec1)    --Gets the current memroyrecord's description
print(desc)

memoryrecord_setDescription(memoryrec1, [[My new health description]])  --sets the memorydescription


value = memoryrecord_getValue(memoryrec2)    --Gets the current value of the memory record.
print(value)

newvalue = 66
memoryrecord_setValue(memoryrec2, newvalue)   --sets value for the memoryrecord

if memoryrecord_isActive(memoryrecord) then   --Checks if memoryrecord is in frozen state or not
memoryrecord_freeze(memoryrec2)  -- freezes the memoryrecord, to unfreeze use memoryrecord_freeze
end

memoryrecord_setColor(memoryrec2,0x0000FF)  --Sets the color of the memoryrecord. Here Red. Color range {0x000000 to 0xFFFFFF)     
File:Image.png
CheatEngine Encyclopedia
File:Hotkey.png
CheatEngine Encyclopedia