Difference between revisions of "Lua:Class:Addresslist"

From Cheat Engine
Jump to navigation Jump to search
m
m (Reverted edits by This content is not available (Talk) to last revision by TheyCallMeTim13)
 
(13 intermediate revisions by 3 users not shown)
Line 1: Line 1:
The Addresslist class can be used to access information regarding the Cheat Engine table. It is commonly combined with [[MemoryRecord]].
+
[[Category:Lua]]
 +
Addresslist '''class''': ('''Inheritance''': ''[[Lua:Class:Panel|Panel]]''->''[[Lua:Class:WinControl|WinControl]]''->''[[Lua:Class:Control|Control]]''->''[[Lua:Class:Component|Component]]''->''[[Lua:Class:Object|Object]]'')
  
'''addresslist_getCount'''(addresslist)
+
Class for manipulating the Cheat Engine form's address list.
  
Returns the ammount of entires in the addresslist.
+
== Properties ==
 +
; Count : integer
 +
: The number of records in the table.
  
Example:
+
; SelCount : integer
  --Assume the table is empty
+
: The number of records that are selected.
  table=getAddressList()
 
  address=0x2031a3ac
 
  --Create 2 entires
 
  for i=1,2 do
 
    mr=addresslist_createMemoryRecord(table)
 
    memoryrecord_setAddress(mr,address)
 
 
 
    address=address+1
 
  end
 
  entries=addresslist_getCount(table) -- entries now has the value 2
 
  
 +
; SelectedRecord : [[Lua:Class:MemoryRecord|MemoryRecord]]
 +
: The main selected record.
  
'''addresslist_getMemoryRecord'''(addresslist, index)
+
; MemoryRecord[''index''] : [[Lua:Class:MemoryRecord|MemoryRecord]]
 +
: Array to access the individual memory records.
  
Returns the [[MemoryRecord]] entry. The first object is indexed by 0.
+
; [''index''] : [[Lua:Class:MemoryRecord|MemoryRecord]]
 +
: Default accessor.
  
Example:
+
== Methods ==
  table=getAddressList()
+
; getCount() : integer
  memory_record1=addresslist_getMemoryRecord(table,0)
+
: Returns the number of memory records in the address list.
  
 +
; getMemoryRecord(''index'') : [[Lua:Class:MemoryRecord|MemoryRecord]]
 +
: returns a [[Lua:Class:MemoryRecord|MemoryRecord]] object based on it's index.
  
'''addresslist_getMemoryRecordByDescription'''(addresslist, string)
+
; getMemoryRecordByDescription(''description'') : [[Lua:Class:MemoryRecord|MemoryRecord]]
 +
: returns a [[Lua:Class:MemoryRecord|MemoryRecord]] object based on it's description.
  
Returns the [[MemoryRecord]] entry matched by the string. The description has to be an exact match, but is case-insensitive
+
; getMemoryRecordByID(''ID'') : [[Lua:Class:MemoryRecord|MemoryRecord]]
 +
: returns a [[Lua:Class:MemoryRecord|MemoryRecord]] object based on it's ID.
  
Example:
+
; createMemoryRecord() : [[Lua:Class:MemoryRecord|MemoryRecord]]
  --Assume we have a entry in the cheat table with the description "Health"
+
: creates an generic cheat table entry and add it to the list
  table=getAddressList()
 
  memory_record=addresslist_getMemoryRecordByDescription(table,"Health")
 
  
 +
; getSelectedRecords() : [[Lua:Class:MemoryRecord|MemoryRecord]]
 +
: Returns a table containing all the selected records
  
'''addresslist_getMemoryRecordByID'''(addresslist, ID)
+
; doDescriptionChange()
 +
: Will show the GUI window to change the description of the selected entry
  
Returns the [[MemoryRecord]] entry matched by the unique ID.
+
; doAddressChange()
 +
: Will show the GUI window to change the address of the selected entry
  
Example:
+
; doTypeChange()
  --Assume we have a entry in the cheat table with the description "Health"
+
: Will show the GUI window to change the type of the selected entries
  table=getAddressList()
 
  id=memoryrecord_getID(addresslist_getMemoryRecordByDescription(table,"Health"))
 
  memory_record=addresslist_getMemoryRecordByID(table,id)
 
  
 +
; doValueChange()
 +
: Will show the GUI window to change the value of the selected entries
  
'''addresslist_createMemoryRecord'''(addresslist)
+
; getSelectedRecord() : [[Lua:Class:MemoryRecord|MemoryRecord]]
 +
: Gets the main selected memory record.
  
Creates an empty memory record at the end of the addresslist.
+
; setSelectedRecord(''memrec'')
This function also returns the empty [[MemoryRecord]] entry, which can be used to immediately access the [[MemoryRecord]].
+
: Sets the currently selected memory record. This will unselect all other entries.
  
Example:
+
== Examples ==
  --Assume we have a entry in the cheat table with the description "Health"
+
local addressList = getAddressList()
  table=getAddressList()
+
if addressList.Count >= 1 then
  memory_record=addresslist_createMemoryRecord(table)
+
  local mrHealth = addressList.getMemoryRecordByDescription('Health')
  memoryrecord_setAddress(memory_record,0x00400000)
+
end
 +
local mrMana = addressList.createMemoryRecord()
  
 +
{{LuaSeeAlso}}
  
 +
=== Related Functions ===
 +
* [[Lua:getMainForm|getMainForm]]
 +
* [[Lua:getAddressList|getAddressList]]
  
----
+
=== Related Classes ===
Don't know what these are:
+
* [[Lua:Class:MemoryRecord|MemoryRecord]]
 
 
'''addresslist_getSelectedRecords'''(addresslist)
 
Returns a array of selected Cheat Table entires. (??)
 
 
 
'''addresslist_doDescriptionChange'''(addresslist)
 
Change description(??)
 
 
 
'''addresslist_doAddressChange'''(addresslist)
 
 
 
'''addresslist_doTypeChange'''(addresslist)
 
 
 
'''addresslist_doValueChange'''(addresslist)
 
 
 
'''addresslist_getSelectedRecord'''(addresslist)
 
 
 
'''addresslist_setSelectedRecord'''(addresslist)
 

Latest revision as of 19:08, 18 March 2019

Addresslist class: (Inheritance: Panel->WinControl->Control->Component->Object)

Class for manipulating the Cheat Engine form's address list.

Properties[edit]

Count : integer
The number of records in the table.
SelCount : integer
The number of records that are selected.
SelectedRecord : MemoryRecord
The main selected record.
MemoryRecord[index] : MemoryRecord
Array to access the individual memory records.
[index] : MemoryRecord
Default accessor.

Methods[edit]

getCount() : integer
Returns the number of memory records in the address list.
getMemoryRecord(index) : MemoryRecord
returns a MemoryRecord object based on it's index.
getMemoryRecordByDescription(description) : MemoryRecord
returns a MemoryRecord object based on it's description.
getMemoryRecordByID(ID) : MemoryRecord
returns a MemoryRecord object based on it's ID.
createMemoryRecord() : MemoryRecord
creates an generic cheat table entry and add it to the list
getSelectedRecords() : MemoryRecord
Returns a table containing all the selected records
doDescriptionChange()
Will show the GUI window to change the description of the selected entry
doAddressChange()
Will show the GUI window to change the address of the selected entry
doTypeChange()
Will show the GUI window to change the type of the selected entries
doValueChange()
Will show the GUI window to change the value of the selected entries
getSelectedRecord() : MemoryRecord
Gets the main selected memory record.
setSelectedRecord(memrec)
Sets the currently selected memory record. This will unselect all other entries.

Examples[edit]

local addressList = getAddressList()
if addressList.Count >= 1 then
  local mrHealth = addressList.getMemoryRecordByDescription('Health')
end
local mrMana = addressList.createMemoryRecord()

See also[edit]

Related Functions[edit]

Related Classes[edit]