Difference between revisions of "Lua:Class:Addresslist"

From Cheat Engine
Jump to navigation Jump to search
(Major overhaul of the post.)
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
 
[[Category:Lua]]
 
[[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]]'')
+
{{Class|'''class''' Addresslist ''':''' Panel}}
  
The AddressList class represents the list of memory records (cheat entries) in Cheat Engine
+
The Addresslist class represents Cheat Engine's main cheat table address list.
It provides access to all records, selection, appearance, and event handling for the address list.
 
  
== Properties ==
+
It contains [[Lua:Class:MemoryRecord|MemoryRecord]] entries and provides methods for selecting, creating, finding, editing, activating, and disabling records.
{| class="wikitable" style="width:100%"
+
 
! Property
+
===Inheritance===
! Type
+
{|width="85%" cellpadding="10%" cellspacing="0" border="0"
! Description
+
!align="left"|Class
 +
!align="left"|Inherits From
 +
!style="width: 80%;background-color:white;" align="left"|Description
 +
|-
 +
|Addresslist
 +
|[[Lua:Class:Panel|Panel]]
 +
|The main cheat table address list control.
 +
|-
 +
|[[Lua:Class:Panel|Panel]]
 +
|[[Lua:Class:WinControl|WinControl]]
 +
|Base class for panel controls.
 
|-
 
|-
| LoadedTableVersion
+
|[[Lua:Class:WinControl|WinControl]]
| Integer
+
|[[Lua:Class:Control|Control]]
| Returns the tableVersion of the last loaded table.
+
|Base class for windowed controls.
 
|-
 
|-
| Count
+
|[[Lua:Class:Control|Control]]
| Integer
+
|[[Lua:Class:Component|Component]]
| The number of records in the table.
+
|Base class for visual controls.
 
|-
 
|-
| SelCount
+
|[[Lua:Class:Component|Component]]
| Integer
+
|[[Lua:Class:Object|Object]]
| The number of records that are selected.
+
|Base class for components.
 +
|}
 +
 
 +
===Properties===
 +
{|width="85%" cellpadding="10%" cellspacing="0" border="0"
 +
!align="left"|Property
 +
!align="left"|Type
 +
!style="width: 80%;background-color:white;" align="left"|Description
 
|-
 
|-
| SelectedRecord
+
|LoadedTableVersion
| [[Lua:Class:MemoryRecord|MemoryRecord]]
+
|Integer
| The main selected record.
+
|Returns the table version of the last loaded table.
 
|-
 
|-
| MemoryRecord[]
+
|Count
| [[Lua:Class:MemoryRecord|MemoryRecord]]
+
|Integer
| Array to access the individual memory records.
+
|The number of records in the address list.
 
|-
 
|-
| [index]
+
|SelCount
| [[Lua:Class:MemoryRecord|MemoryRecord]]
+
|Integer
| Default accessor for memory records.
+
|The number of selected records.
 
|-
 
|-
| CheckboxActiveSelectedColor
+
|SelectedRecord
| Color
+
|[[Lua:Class:MemoryRecord|MemoryRecord]]
| Color for active and selected checkboxes.
+
|The main selected memory record.
 
|-
 
|-
| CheckboxActiveColor
+
|MemoryRecord[]
| Color
+
|[[Lua:Class:MemoryRecord|MemoryRecord]]
| Color for active checkboxes.
+
|Array-style accessor for individual memory records.
 
|-
 
|-
| CheckboxSelectedColor
+
|[]
| Color
+
|[[Lua:Class:MemoryRecord|MemoryRecord]]
| Color for selected checkboxes.
+
|Default accessor for individual memory records.
 
|-
 
|-
| CheckboxColor
+
|CheckboxActiveSelectedColor
| Color
+
|Color
| Color for checkboxes.
+
|The checkbox color used for records that are both active and selected.
 
|-
 
|-
| SelectedBackgroundColor
+
|CheckboxActiveColor
| Color
+
|Color
| Color for the selected row background.
+
|The checkbox color used for active records.
 
|-
 
|-
| SelectedSecondaryBackgroundColor
+
|CheckboxSelectedColor
| Color
+
|Color
| Secondary color for selected row background.
+
|The checkbox color used for selected records.
 
|-
 
|-
| ExpandSignColor
+
|CheckboxColor
| Color
+
|Color
| Color for the expand/collapse sign.
+
|The normal checkbox color.
 
|-
 
|-
| IncreaseArrowColor
+
|SelectedBackgroundColor
| Color
+
|Color
| Color for the increase arrow.
+
|The primary background color used for selected records.
 
|-
 
|-
| DecreaseArrowColor
+
|SelectedSecondaryBackgroundColor
| Color
+
|Color
| Color for the decrease arrow.
+
|The secondary background color used for selected records.
 +
|-
 +
|ExpandSignColor
 +
|Color
 +
|The color of the expand/collapse sign.
 +
|-
 +
|IncreaseArrowColor
 +
|Color
 +
|The color of the increase arrow.
 +
|-
 +
|DecreaseArrowColor
 +
|Color
 +
|The color of the decrease arrow.
 
|}
 
|}
  
== Methods ==
+
===Events===
{| class="wikitable" style="width:100%"
+
{|width="85%" cellpadding="10%" cellspacing="0" border="0"
! Method
+
!align="left"|Event
! Parameters
+
!align="left"|Callback
! Returns
+
!style="width: 80%;background-color:white;" align="left"|Description
! Description
 
 
|-
 
|-
| getCount
+
|OnDescriptionChange
| None
+
|function(addresslist, memrec): boolean
| Integer
+
|Called when the user initiates a description column change on a record. Return true if you handle it, false for normal behavior.
| Returns the number of memory records.
 
 
|-
 
|-
| getMemoryRecord
+
|OnAddressChange
| Integer (index)
+
|function(addresslist, memrec): boolean
| [[Lua:Class:MemoryRecord|MemoryRecord]]
+
|Called when the user initiates an address column change on a record. Return true if you handle it, false for normal behavior.
| Returns the memory record at the given index.
 
 
|-
 
|-
| getMemoryRecordByDescription
+
|OnTypeChange
| String (description)
+
|function(addresslist, memrec): boolean
| [[Lua:Class:MemoryRecord|MemoryRecord]]
+
|Called when the user initiates a type column change on a record. Return true if you handle it, false for normal behavior.
| Returns the memory record with the given description.
 
 
|-
 
|-
| getMemoryRecordByID
+
|OnValueChange
| Integer (ID)
+
|function(addresslist, memrec): boolean
| [[Lua:Class:MemoryRecord|MemoryRecord]]
+
|Called when the user initiates a value column change on a record. Return true if you handle it, false for normal behavior.
| Returns the memory record with the given ID.
+
|-
 +
|OnAutoAssemblerEdit
 +
|function(addresslist, memrec)
 +
|Called when the user initiates a [[Lua:Class:MemoryRecord|MemoryRecord]] Auto Assembler script edit. The callback is responsible for changing the memory record.
 +
|}
 +
 
 +
===Methods===
 +
{|width="85%" cellpadding="10%" cellspacing="0" border="0"
 +
!align="left"|Method
 +
!align="left"|Return Type
 +
!style="width: 80%;background-color:white;" align="left"|Description
 
|-
 
|-
| createMemoryRecord
+
|getCount()
| None
+
|Integer
| [[Lua:Class:MemoryRecord|MemoryRecord]]
+
|Returns the number of records in the address list.
| Creates a generic cheat table entry and adds it to the list.
 
 
|-
 
|-
| getSelectedRecords
+
|getMemoryRecord(index)
| None
+
|[[Lua:Class:MemoryRecord|MemoryRecord]]
| Table of [[Lua:Class:MemoryRecord|MemoryRecord]]
+
|Returns the memory record at the given index.
| Returns a table containing all the selected records.
 
 
|-
 
|-
| doDescriptionChange
+
|getMemoryRecordByDescription(description)
| None
+
|[[Lua:Class:MemoryRecord|MemoryRecord]]
| None
+
|Returns the first memory record with the given description.
| Shows the GUI window to change the description of the selected entry.
 
 
|-
 
|-
| doAddressChange
+
|getMemoryRecordByID(ID)
| None
+
|[[Lua:Class:MemoryRecord|MemoryRecord]]
| None
+
|Returns the memory record with the given ID.
| Shows the GUI window to change the address of the selected entry.
 
 
|-
 
|-
| doTypeChange
+
|createMemoryRecord()
| None
+
|[[Lua:Class:MemoryRecord|MemoryRecord]]
| None
+
|Creates a generic cheat table entry and adds it to the address list.
| Shows the GUI window to change the type of the selected entries.
 
 
|-
 
|-
| doValueChange
+
|getSelectedRecords()
| None
+
|Table
| None
+
|Returns a table containing all selected records.
| Shows the GUI window to change the value of the selected entries.
 
 
|-
 
|-
| getSelectedRecord
+
|doDescriptionChange()
| None
+
|void
| [[Lua:Class:MemoryRecord|MemoryRecord]]
+
|Shows the GUI window to change the description of the selected entry.
| Gets the main selected memory record.
 
 
|-
 
|-
| setSelectedRecord
+
|doAddressChange()
| [[Lua:Class:MemoryRecord|MemoryRecord]]
+
|void
| None
+
|Shows the GUI window to change the address of the selected entry.
| Sets the currently selected memory record (unselects all others).
 
 
|-
 
|-
| disableAllWithoutExecute
+
|doTypeChange()
| None
+
|void
| None
+
|Shows the GUI window to change the type of the selected entries.
| Disables all memory records without executing their [Disable] section.
 
 
|-
 
|-
| rebuildDescriptionCache
+
|doValueChange()
| None
+
|void
| None
+
|Shows the GUI window to change the value of the selected entries.
| Rebuilds the description-to-record lookup table.
 
|}
 
 
 
== Events / Callbacks ==
 
{| class="wikitable" style="width:100%"
 
! Event
 
! Parameters
 
! Description
 
 
|-
 
|-
| OnDescriptionChange
+
|getSelectedRecord()
| function(addresslist, memrec):boolean
+
|[[Lua:Class:MemoryRecord|MemoryRecord]]
| Called when the user initiates a description column change on a record. Return true if you handle it, false for normal behaviour.
+
|Gets the main selected memory record.
 
|-
 
|-
| OnAddressChange
+
|setSelectedRecord(memrec)
| function(addresslist, memrec):boolean
+
|void
| Called when the user initiates an address column change on a record. Return true if you handle it, false for normal behaviour.
+
|Sets the currently selected memory record. This unselects all other entries.
 
|-
 
|-
| OnTypeChange
+
|disableAllWithoutExecute()
| function(addresslist, memrec):boolean
+
|void
| Called when the user initiates a type column change on a record. Return true if you handle it, false for normal behaviour.
+
|Disables all memory records without executing their [Disable] sections.
 
|-
 
|-
| OnValueChange
+
|rebuildDescriptionCache()
| function(addresslist, memrec):boolean
+
|void
| Called when the user initiates a value column change on a record. Return true if you handle it, false for normal behaviour.
+
|Rebuilds the description-to-record lookup table.
 
|-
 
|-
| OnAutoAssemblerEdit
+
|MouseHighlightedRecord()
| function(addresslist, memrec)
+
|[[Lua:Class:MemoryRecord|MemoryRecord]]
| Called when the user initiates a memory record AA script edit. This function will be responsible for changing the memory record.
+
|Returns the memory record the mouse points at, or nil if nothing is highlighted.
 
|}
 
|}
  
== Other Functions ==
+
===Examples===
* '''MouseHighlightedRecord()''' — Returns the memory record that the mouse points at, or nil if nothing.
+
 
 +
====Get the Addresslist object====
 +
<syntaxhighlight lang="lua" line>
 +
local addresslist = getAddressList()
 +
 
 +
print("Records: " .. tostring(addresslist.Count))
 +
</syntaxhighlight>
 +
 
 +
====Use the global AddressList variable====
 +
<syntaxhighlight lang="lua" line>
 +
local addresslist1 = getAddressList()
 +
local addresslist2 = AddressList
 +
 
 +
print(addresslist1 == addresslist2)
 +
</syntaxhighlight>
 +
 
 +
====Create a new MemoryRecord====
 +
<syntaxhighlight lang="lua" line>
 +
local addresslist = getAddressList()
 +
local record = addresslist.createMemoryRecord()
 +
 
 +
record.Description = "Player Health"
 +
record.Address = "game.exe+12345"
 +
record.Type = vtDword
 +
record.Value = "1000"
 +
</syntaxhighlight>
 +
 
 +
====Iterate through all records====
 +
<syntaxhighlight lang="lua" line>
 +
local addresslist = getAddressList()
 +
 
 +
for i = 0, addresslist.Count - 1 do
 +
  local record = addresslist[i]
 +
 
 +
  print(i .. ": " .. record.Description)
 +
end
 +
</syntaxhighlight>
 +
 
 +
====Access a record with getMemoryRecord====
 +
<syntaxhighlight lang="lua" line>
 +
local addresslist = getAddressList()
 +
 
 +
if addresslist.Count > 0 then
 +
  local record = addresslist.getMemoryRecord(0)
 +
 
 +
  print(record.Description)
 +
end
 +
</syntaxhighlight>
 +
 
 +
====Find a record by description====
 +
<syntaxhighlight lang="lua" line>
 +
local addresslist = getAddressList()
 +
local record = addresslist.getMemoryRecordByDescription("Player Health")
 +
 
 +
if record ~= nil then
 +
  print("Found: " .. record.Description)
 +
end
 +
</syntaxhighlight>
 +
 
 +
====Find a record by ID====
 +
<syntaxhighlight lang="lua" line>
 +
local addresslist = getAddressList()
 +
local record = addresslist.getMemoryRecordByID(10)
 +
 
 +
if record ~= nil then
 +
  print("Found ID 10: " .. record.Description)
 +
end
 +
</syntaxhighlight>
 +
 
 +
====Get the selected record====
 +
<syntaxhighlight lang="lua" line>
 +
local addresslist = getAddressList()
 +
local record = addresslist.getSelectedRecord()
 +
 
 +
if record ~= nil then
 +
  print("Selected: " .. record.Description)
 +
end
 +
</syntaxhighlight>
 +
 
 +
====Use the SelectedRecord property====
 +
<syntaxhighlight lang="lua" line>
 +
local addresslist = getAddressList()
 +
 
 +
if addresslist.SelCount > 0 then
 +
  local record = addresslist.SelectedRecord
 +
 
 +
  print("Selected: " .. record.Description)
 +
end
 +
</syntaxhighlight>
 +
 
 +
====Set the selected record====
 +
<syntaxhighlight lang="lua" line>
 +
local addresslist = getAddressList()
 +
local record = addresslist.getMemoryRecordByDescription("Player Health")
 +
 
 +
if record ~= nil then
 +
  addresslist.setSelectedRecord(record)
 +
end
 +
</syntaxhighlight>
 +
 
 +
====Get all selected records====
 +
<syntaxhighlight lang="lua" line>
 +
local addresslist = getAddressList()
 +
local selectedRecords = addresslist.getSelectedRecords()
 +
 
 +
for i, record in ipairs(selectedRecords) do
 +
  print(i .. ": " .. record.Description)
 +
end
 +
</syntaxhighlight>
 +
 
 +
====Show the description change dialog====
 +
<syntaxhighlight lang="lua" line>
 +
local addresslist = getAddressList()
 +
 
 +
if addresslist.SelCount > 0 then
 +
  addresslist.doDescriptionChange()
 +
end
 +
</syntaxhighlight>
 +
 
 +
====Show the address change dialog====
 +
<syntaxhighlight lang="lua" line>
 +
local addresslist = getAddressList()
 +
 
 +
if addresslist.SelCount > 0 then
 +
  addresslist.doAddressChange()
 +
end
 +
</syntaxhighlight>
 +
 
 +
====Show the type change dialog====
 +
<syntaxhighlight lang="lua" line>
 +
local addresslist = getAddressList()
 +
 
 +
if addresslist.SelCount > 0 then
 +
  addresslist.doTypeChange()
 +
end
 +
</syntaxhighlight>
 +
 
 +
====Show the value change dialog====
 +
<syntaxhighlight lang="lua" line>
 +
local addresslist = getAddressList()
 +
 
 +
if addresslist.SelCount > 0 then
 +
  addresslist.doValueChange()
 +
end
 +
</syntaxhighlight>
 +
 
 +
====Disable all records without executing [Disable] sections====
 +
<syntaxhighlight lang="lua" line>
 +
local addresslist = getAddressList()
 +
 
 +
addresslist.disableAllWithoutExecute()
 +
</syntaxhighlight>
 +
 
 +
====Rebuild the description cache====
 +
<syntaxhighlight lang="lua" line>
 +
local addresslist = getAddressList()
 +
 
 +
addresslist.rebuildDescriptionCache()
 +
</syntaxhighlight>
 +
 
 +
====Get the mouse-highlighted record====
 +
<syntaxhighlight lang="lua" line>
 +
local addresslist = getAddressList()
 +
local record = addresslist.MouseHighlightedRecord()
 +
 
 +
if record ~= nil then
 +
  print("Mouse is over: " .. record.Description)
 +
end
 +
</syntaxhighlight>
 +
 
 +
====Change address list colors====
 +
<syntaxhighlight lang="lua" line>
 +
local addresslist = getAddressList()
 +
 
 +
addresslist.CheckboxActiveColor = 0x00FF00
 +
addresslist.CheckboxColor = 0x808080
 +
addresslist.SelectedBackgroundColor = 0x202020
 +
addresslist.SelectedSecondaryBackgroundColor = 0x303030
 +
addresslist.ExpandSignColor = 0xFFFFFF
 +
</syntaxhighlight>
 +
 
 +
====Handle description changes====
 +
<syntaxhighlight lang="lua" line>
 +
local addresslist = getAddressList()
 +
 
 +
addresslist.OnDescriptionChange = function(sender, memrec)
 +
  print("Description change requested for: " .. memrec.Description)
 +
 
 +
  return false
 +
end
 +
</syntaxhighlight>
 +
 
 +
====Handle address changes====
 +
<syntaxhighlight lang="lua" line>
 +
local addresslist = getAddressList()
 +
 
 +
addresslist.OnAddressChange = function(sender, memrec)
 +
  print("Address change requested for: " .. memrec.Description)
 +
 
 +
  return false
 +
end
 +
</syntaxhighlight>
 +
 
 +
====Handle value changes manually====
 +
<syntaxhighlight lang="lua" line>
 +
local addresslist = getAddressList()
 +
 
 +
addresslist.OnValueChange = function(sender, memrec)
 +
  local oldValue = memrec.Value
 +
 
 +
  memrec.Value = "999"
  
== Examples ==
+
   print("Changed " .. memrec.Description .. " from " .. oldValue .. " to " .. memrec.Value)
<pre>
+
 
-- Print all memory record descriptions
+
  return true
for i = 0, AddressList.Count - 1 do
 
   print(AddressList[i].Description)
 
 
end
 
end
 +
</syntaxhighlight>
  
-- Create a new memory record
+
====Handle Auto Assembler script edits====
local newrec = AddressList:createMemoryRecord()
+
<syntaxhighlight lang="lua" line>
newrec.Description = "My New Entry"
+
local addresslist = getAddressList()
newrec.Address = "00400000"
 
  
-- Get all selected records
+
addresslist.OnAutoAssemblerEdit = function(sender, memrec)
local selected = AddressList:getSelectedRecords()
+
   print("Auto Assembler edit requested for: " .. memrec.Description)
for i, rec in ipairs(selected) do
 
   print("Selected:", rec.Description)
 
 
end
 
end
 +
</syntaxhighlight>
 +
 +
====Create multiple records====
 +
<syntaxhighlight lang="lua" line>
 +
local addresslist = getAddressList()
 +
 +
local values = {
 +
  { description = "Health", address = "game.exe+1000" },
 +
  { description = "Ammo", address = "game.exe+2000" },
 +
  { description = "Score", address = "game.exe+3000" }
 +
}
  
-- Change the selected record
+
for i, entry in ipairs(values) do
AddressList:setSelectedRecord(AddressList[0])
+
  local record = addresslist.createMemoryRecord()
</pre>
+
 
 +
  record.Description = entry.description
 +
  record.Address = entry.address
 +
  record.Type = vtDword
 +
end
 +
</syntaxhighlight>
 +
 
 +
====Clear and rebuild the table====
 +
<syntaxhighlight lang="lua" line>
 +
local addresslist = getAddressList()
 +
 
 +
addresslist.clear()
 +
 
 +
local health = addresslist.createMemoryRecord()
 +
health.Description = "Health"
 +
health.Address = "game.exe+1234"
 +
health.Type = vtDword
 +
 
 +
local ammo = addresslist.createMemoryRecord()
 +
ammo.Description = "Ammo"
 +
ammo.Address = "game.exe+5678"
 +
ammo.Type = vtDword
 +
</syntaxhighlight>
  
 
{{LuaSeeAlso}}
 
{{LuaSeeAlso}}
  
=== Related Functions ===
+
{{Forms}}
* [[Lua:getMainForm|getMainForm]]
 
* [[Lua:getAddressList|getAddressList]]
 
 
 
=== Related Classes ===
 
* [[Lua:Class:MemoryRecord|MemoryRecord]]
 

Latest revision as of 18:44, 25 June 2026

{} Class

class Addresslist : Panel

The Addresslist class represents Cheat Engine's main cheat table address list.

It contains MemoryRecord entries and provides methods for selecting, creating, finding, editing, activating, and disabling records.

Inheritance[edit]

Class Inherits From Description
Addresslist Panel The main cheat table address list control.
Panel WinControl Base class for panel controls.
WinControl Control Base class for windowed controls.
Control Component Base class for visual controls.
Component Object Base class for components.

Properties[edit]

Property Type Description
LoadedTableVersion Integer Returns the table version of the last loaded table.
Count Integer The number of records in the address list.
SelCount Integer The number of selected records.
SelectedRecord MemoryRecord The main selected memory record.
MemoryRecord[] MemoryRecord Array-style accessor for individual memory records.
[] MemoryRecord Default accessor for individual memory records.
CheckboxActiveSelectedColor Color The checkbox color used for records that are both active and selected.
CheckboxActiveColor Color The checkbox color used for active records.
CheckboxSelectedColor Color The checkbox color used for selected records.
CheckboxColor Color The normal checkbox color.
SelectedBackgroundColor Color The primary background color used for selected records.
SelectedSecondaryBackgroundColor Color The secondary background color used for selected records.
ExpandSignColor Color The color of the expand/collapse sign.
IncreaseArrowColor Color The color of the increase arrow.
DecreaseArrowColor Color The color of the decrease arrow.

Events[edit]

Event Callback Description
OnDescriptionChange function(addresslist, memrec): boolean Called when the user initiates a description column change on a record. Return true if you handle it, false for normal behavior.
OnAddressChange function(addresslist, memrec): boolean Called when the user initiates an address column change on a record. Return true if you handle it, false for normal behavior.
OnTypeChange function(addresslist, memrec): boolean Called when the user initiates a type column change on a record. Return true if you handle it, false for normal behavior.
OnValueChange function(addresslist, memrec): boolean Called when the user initiates a value column change on a record. Return true if you handle it, false for normal behavior.
OnAutoAssemblerEdit function(addresslist, memrec) Called when the user initiates a MemoryRecord Auto Assembler script edit. The callback is responsible for changing the memory record.

Methods[edit]

Method Return Type Description
getCount() Integer Returns the number of records in the address list.
getMemoryRecord(index) MemoryRecord Returns the memory record at the given index.
getMemoryRecordByDescription(description) MemoryRecord Returns the first memory record with the given description.
getMemoryRecordByID(ID) MemoryRecord Returns the memory record with the given ID.
createMemoryRecord() MemoryRecord Creates a generic cheat table entry and adds it to the address list.
getSelectedRecords() Table Returns a table containing all selected records.
doDescriptionChange() void Shows the GUI window to change the description of the selected entry.
doAddressChange() void Shows the GUI window to change the address of the selected entry.
doTypeChange() void Shows the GUI window to change the type of the selected entries.
doValueChange() void Shows the GUI window to change the value of the selected entries.
getSelectedRecord() MemoryRecord Gets the main selected memory record.
setSelectedRecord(memrec) void Sets the currently selected memory record. This unselects all other entries.
disableAllWithoutExecute() void Disables all memory records without executing their [Disable] sections.
rebuildDescriptionCache() void Rebuilds the description-to-record lookup table.
MouseHighlightedRecord() MemoryRecord Returns the memory record the mouse points at, or nil if nothing is highlighted.

Examples[edit]

Get the Addresslist object[edit]

1 local addresslist = getAddressList()
2 
3 print("Records: " .. tostring(addresslist.Count))

Use the global AddressList variable[edit]

1 local addresslist1 = getAddressList()
2 local addresslist2 = AddressList
3 
4 print(addresslist1 == addresslist2)

Create a new MemoryRecord[edit]

1 local addresslist = getAddressList()
2 local record = addresslist.createMemoryRecord()
3 
4 record.Description = "Player Health"
5 record.Address = "game.exe+12345"
6 record.Type = vtDword
7 record.Value = "1000"

Iterate through all records[edit]

1 local addresslist = getAddressList()
2 
3 for i = 0, addresslist.Count - 1 do
4   local record = addresslist[i]
5 
6   print(i .. ": " .. record.Description)
7 end

Access a record with getMemoryRecord[edit]

1 local addresslist = getAddressList()
2 
3 if addresslist.Count > 0 then
4   local record = addresslist.getMemoryRecord(0)
5 
6   print(record.Description)
7 end

Find a record by description[edit]

1 local addresslist = getAddressList()
2 local record = addresslist.getMemoryRecordByDescription("Player Health")
3 
4 if record ~= nil then
5   print("Found: " .. record.Description)
6 end

Find a record by ID[edit]

1 local addresslist = getAddressList()
2 local record = addresslist.getMemoryRecordByID(10)
3 
4 if record ~= nil then
5   print("Found ID 10: " .. record.Description)
6 end

Get the selected record[edit]

1 local addresslist = getAddressList()
2 local record = addresslist.getSelectedRecord()
3 
4 if record ~= nil then
5   print("Selected: " .. record.Description)
6 end

Use the SelectedRecord property[edit]

1 local addresslist = getAddressList()
2 
3 if addresslist.SelCount > 0 then
4   local record = addresslist.SelectedRecord
5 
6   print("Selected: " .. record.Description)
7 end

Set the selected record[edit]

1 local addresslist = getAddressList()
2 local record = addresslist.getMemoryRecordByDescription("Player Health")
3 
4 if record ~= nil then
5   addresslist.setSelectedRecord(record)
6 end

Get all selected records[edit]

1 local addresslist = getAddressList()
2 local selectedRecords = addresslist.getSelectedRecords()
3 
4 for i, record in ipairs(selectedRecords) do
5   print(i .. ": " .. record.Description)
6 end

Show the description change dialog[edit]

1 local addresslist = getAddressList()
2 
3 if addresslist.SelCount > 0 then
4   addresslist.doDescriptionChange()
5 end

Show the address change dialog[edit]

1 local addresslist = getAddressList()
2 
3 if addresslist.SelCount > 0 then
4   addresslist.doAddressChange()
5 end

Show the type change dialog[edit]

1 local addresslist = getAddressList()
2 
3 if addresslist.SelCount > 0 then
4   addresslist.doTypeChange()
5 end

Show the value change dialog[edit]

1 local addresslist = getAddressList()
2 
3 if addresslist.SelCount > 0 then
4   addresslist.doValueChange()
5 end

Disable all records without executing [Disable] sections[edit]

1 local addresslist = getAddressList()
2 
3 addresslist.disableAllWithoutExecute()

Rebuild the description cache[edit]

1 local addresslist = getAddressList()
2 
3 addresslist.rebuildDescriptionCache()

Get the mouse-highlighted record[edit]

1 local addresslist = getAddressList()
2 local record = addresslist.MouseHighlightedRecord()
3 
4 if record ~= nil then
5   print("Mouse is over: " .. record.Description)
6 end

Change address list colors[edit]

1 local addresslist = getAddressList()
2 
3 addresslist.CheckboxActiveColor = 0x00FF00
4 addresslist.CheckboxColor = 0x808080
5 addresslist.SelectedBackgroundColor = 0x202020
6 addresslist.SelectedSecondaryBackgroundColor = 0x303030
7 addresslist.ExpandSignColor = 0xFFFFFF

Handle description changes[edit]

1 local addresslist = getAddressList()
2 
3 addresslist.OnDescriptionChange = function(sender, memrec)
4   print("Description change requested for: " .. memrec.Description)
5 
6   return false
7 end

Handle address changes[edit]

1 local addresslist = getAddressList()
2 
3 addresslist.OnAddressChange = function(sender, memrec)
4   print("Address change requested for: " .. memrec.Description)
5 
6   return false
7 end

Handle value changes manually[edit]

 1 local addresslist = getAddressList()
 2 
 3 addresslist.OnValueChange = function(sender, memrec)
 4   local oldValue = memrec.Value
 5 
 6   memrec.Value = "999"
 7 
 8   print("Changed " .. memrec.Description .. " from " .. oldValue .. " to " .. memrec.Value)
 9 
10   return true
11 end

Handle Auto Assembler script edits[edit]

1 local addresslist = getAddressList()
2 
3 addresslist.OnAutoAssemblerEdit = function(sender, memrec)
4   print("Auto Assembler edit requested for: " .. memrec.Description)
5 end

Create multiple records[edit]

 1 local addresslist = getAddressList()
 2 
 3 local values = {
 4   { description = "Health", address = "game.exe+1000" },
 5   { description = "Ammo", address = "game.exe+2000" },
 6   { description = "Score", address = "game.exe+3000" }
 7 }
 8 
 9 for i, entry in ipairs(values) do
10   local record = addresslist.createMemoryRecord()
11 
12   record.Description = entry.description
13   record.Address = entry.address
14   record.Type = vtDword
15 end

Clear and rebuild the table[edit]

 1 local addresslist = getAddressList()
 2 
 3 addresslist.clear()
 4 
 5 local health = addresslist.createMemoryRecord()
 6 health.Description = "Health"
 7 health.Address = "game.exe+1234"
 8 health.Type = vtDword
 9 
10 local ammo = addresslist.createMemoryRecord()
11 ammo.Description = "Ammo"
12 ammo.Address = "game.exe+5678"
13 ammo.Type = vtDword

Main Pages

Core Lua documentation entry points

Lua
Script Engine

Form Related Classes