Difference between revisions of "Lua:Class:MemoryRecord"

From Cheat Engine
Jump to navigation Jump to search
Line 108: Line 108:
 
: Returns the number of offsets for this memoryrecord
 
: Returns the number of offsets for this memoryrecord
  
; setOffsetCount(integer)
+
; setOffsetCount(''integer'')
 
: Lets you set the number of offsets
 
: Lets you set the number of offsets
  
; getOffset(index) : integer
+
; getOffset(''index'') : integer
 
: Gets the offset at the given index
 
: Gets the offset at the given index
  
; setOffset(index, value)
+
; setOffset(''index'', ''value'')
 
: Sets the offset at the given index
 
: Sets the offset at the given index
  
Line 120: Line 120:
 
: Returns the current address as an integer (the final result of the interpretable address and pointer offsets)
 
: Returns the current address as an integer (the final result of the interpretable address and pointer offsets)
  
; appendToEntry(memrec)
+
; appendToEntry(''memrec'')
 
: Appends the current memory record to the given memory record
 
: Appends the current memory record to the given memory record
  
; getHotkey(index) : [[GenericHotkey]]
+
; getHotkey(''index'') : [[GenericHotkey]]
 
: Returns the hotkey from the hotkey array
 
: Returns the hotkey from the hotkey array
  
; getHotkeyByID(integer) : [[GenericHotkey]]
+
; getHotkeyByID(''integer'') : [[GenericHotkey]]
 
: Returns the hotkey with the given id
 
: Returns the hotkey with the given id
  

Revision as of 07:39, 11 March 2017

MemoryRecord class: (Inheritance: Object)

The memory record objects are the entries you see in the address list.

Properties

ID : integer
Unique ID.
Index : integer
The index ID for this record. 0 is top. (ReadOnly)
Description : string- The description of the memory record.
Address : string
Get/set the interpretable address string. Useful for simple address settings.
OffsetCount : integer
The number of offsets. Set to 0 for a normal address.
Offset[index] : integer
Array to access each offset.
CurrentAddress : integer
The address the memoryrecord points to.
Type : ValueType
The variable type of this record. See vtByte to vtCustom
  • If the type is vtString then the following properties are available:
    • String.Size: Number of characters in the string
    • String.Unicode: boolean
  • If the type is vtBinary then the following properties are available
    • Binary.Startbit: First bit to start reading from
    • Binary.Size: Number of bits
  • If the type is vtByteArray then the following properties are available
    • Aob.Size: Number of bytes
CustomTypeName : string
If the type is vtCustomType this will contain the name of the CustomType
Script : string
If the type is vtAutoAssembler this will contain the auto assembler script
Value : string
The value in stringform.
Selected : boolean
Set to true if selected (ReadOnly)
Active : boolean
Set to true to activate/freeze, false to deactivate/unfreeze
Color : integer
The memory record's RBG color integer.
ShowAsHex : boolean
Self explanatory
ShowAsSigned : boolean
Self explanatory
AllowIncrease : boolean
Allow value increasing, unfreeze will reset it to false
AllowDecrease : boolean
Allow value decreasing, unfreeze will reset it to false
Count : integer
Number of children
Child[index] : MemoryRecord
Array to access the child records
HotkeyCount : integer
Number of hotkeys attached to this memory record.
Hotkey[index] : GenericHotkey
Array to index the hotkeys.
OnActivate : function(memoryrecord, before, currentstate) : boolean
The function to call when the memoryrecord will change (or changed) Active to true.
If before is true, not returning true will cause the activation to stop.
OnDeactivate : function(memoryrecord,before,currentstate) : boolean
The function to call when the memoryrecord will change (or changed) Active to false.
If before is true, not returning true will cause the deactivation to stop.
OnDestroy : function
Called when the memoryrecord is destroyed.
DontSave : boolean
Don't save this memoryrecord and it's children

Methods

getDescription() : string
Returns the memory record's dexcription.
setDescription()
Sets the memory record's dexcription.
getAddress() : integer - (integer, table)
Returns the interpretable addressstring of this record.
If it is a pointer, it returns a second result as a table filled with the offsets
setAddress(string)
Sets the interpretable address string, and if offsets are provided make it a pointer
getOffsetCount() : integer
Returns the number of offsets for this memoryrecord
setOffsetCount(integer)
Lets you set the number of offsets
getOffset(index) : integer
Gets the offset at the given index
setOffset(index, value)
Sets the offset at the given index
getCurrentAddress() : integer
Returns the current address as an integer (the final result of the interpretable address and pointer offsets)
appendToEntry(memrec)
Appends the current memory record to the given memory record
getHotkey(index) : GenericHotkey
Returns the hotkey from the hotkey array
getHotkeyByID(integer) : GenericHotkey
Returns the hotkey with the given id

Examples

local addressList = getAddressList()
local mrHealth = addressList.getMemoryRecordByDescription('Health')
print(mrHealth.Description)
print(mrHealth.Active and 'Ture' or 'False')

See also

Related Functions

Related Classes