Difference between revisions of "Lua:Class:Addresslist"

From Cheat Engine
Jump to navigation Jump to search
(Major overhaul of the post.)
 
(14 intermediate revisions by 5 users not shown)
Line 1: Line 1:
'''AddressLisr class''': (Inheritance: [[Panel]]->[[WinControl]]->[[Control]]->[[Component]]->[[Object]])
+
[[Category:Lua]]
 +
{{Class|'''class''' Addresslist ''':''' Panel}}
  
 +
The Addresslist class represents Cheat Engine's main cheat table address list.
  
The Addresslist class can be used to access information regarding the Cheat Engine table. It is commonly combined with [[MemoryRecord]].
+
It contains [[Lua:Class:MemoryRecord|MemoryRecord]] entries and provides methods for selecting, creating, finding, editing, activating, and disabling records.
  
 +
===Inheritance===
 +
{|width="85%" cellpadding="10%" cellspacing="0" border="0"
 +
!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.
 +
|-
 +
|[[Lua:Class:WinControl|WinControl]]
 +
|[[Lua:Class:Control|Control]]
 +
|Base class for windowed controls.
 +
|-
 +
|[[Lua:Class:Control|Control]]
 +
|[[Lua:Class:Component|Component]]
 +
|Base class for visual controls.
 +
|-
 +
|[[Lua:Class:Component|Component]]
 +
|[[Lua:Class:Object|Object]]
 +
|Base class for components.
 +
|}
  
 
===Properties===
 
===Properties===
  Count: Integer - The number of records in the table
+
{|width="85%" cellpadding="10%" cellspacing="0" border="0"
  SelCount: integer- The number of records that are selected
+
!align="left"|Property
  SelectedRecord: MemoryRecord - The main selected record
+
!align="left"|Type
  MemoryRecord[]: MemoryRecord - Array to access the individial memory records
+
!style="width: 80%;background-color:white;" align="left"|Description
  [] = MemoryRecord - Default accessor
+
|-
 +
|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
 +
|[[Lua:Class:MemoryRecord|MemoryRecord]]
 +
|The main selected memory record.
 +
|-
 +
|MemoryRecord[]
 +
|[[Lua:Class:MemoryRecord|MemoryRecord]]
 +
|Array-style accessor for individual memory records.
 +
|-
 +
|[]
 +
|[[Lua:Class:MemoryRecord|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===
 +
{|width="85%" cellpadding="10%" cellspacing="0" border="0"
 +
!align="left"|Event
 +
!align="left"|Callback
 +
!style="width: 80%;background-color:white;" align="left"|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 [[Lua:Class:MemoryRecord|MemoryRecord]] Auto Assembler script edit. The callback is responsible for changing the memory record.
 +
|}
  
 
===Methods===
 
===Methods===
  getCount()
+
{|width="85%" cellpadding="10%" cellspacing="0" border="0"
  getMemoryRecord(index)
+
!align="left"|Method
  getMemoryRecordByDescription(description): returns a MemoryRecord object
+
!align="left"|Return Type
  getMemoryRecordByID(ID)
+
!style="width: 80%;background-color:white;" align="left"|Description
  createMemoryRecord() : creates an generic cheat table entry and add it to the list
+
|-
 +
|getCount()
 +
|Integer
 +
|Returns the number of records in the address list.
 +
|-
 +
|getMemoryRecord(index)
 +
|[[Lua:Class:MemoryRecord|MemoryRecord]]
 +
|Returns the memory record at the given index.
 +
|-
 +
|getMemoryRecordByDescription(description)
 +
|[[Lua:Class:MemoryRecord|MemoryRecord]]
 +
|Returns the first memory record with the given description.
 +
|-
 +
|getMemoryRecordByID(ID)
 +
|[[Lua:Class:MemoryRecord|MemoryRecord]]
 +
|Returns the memory record with the given ID.
 +
|-
 +
|createMemoryRecord()
 +
|[[Lua:Class:MemoryRecord|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()
 +
|[[Lua:Class:MemoryRecord|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()
 +
|[[Lua:Class:MemoryRecord|MemoryRecord]]
 +
|Returns the memory record the mouse points at, or nil if nothing is highlighted.
 +
|}
 +
 
 +
===Examples===
 +
 
 +
====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"
 +
 
 +
  print("Changed " .. memrec.Description .. " from " .. oldValue .. " to " .. memrec.Value)
 +
 
 +
  return true
 +
end
 +
</syntaxhighlight>
 +
 
 +
====Handle Auto Assembler script edits====
 +
<syntaxhighlight lang="lua" line>
 +
local addresslist = getAddressList()
 +
 
 +
addresslist.OnAutoAssemblerEdit = function(sender, memrec)
 +
  print("Auto Assembler edit requested for: " .. memrec.Description)
 +
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" }
 +
}
 +
 
 +
for i, entry in ipairs(values) do
 +
  local record = addresslist.createMemoryRecord()
 +
 
 +
  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
  
  getSelectedRecords():  Returns a table containing all the selected records
+
local ammo = addresslist.createMemoryRecord()
 +
ammo.Description = "Ammo"
 +
ammo.Address = "game.exe+5678"
 +
ammo.Type = vtDword
 +
</syntaxhighlight>
  
  doDescriptionChange() : Will show the gui window to change the description of the selected entry
+
{{LuaSeeAlso}}
  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() : Gets the main selected memoryrecord
+
{{Forms}}
  setSelectedRecord(memrec) : Sets the currently selected memoryrecord. This will unselect all other entries
 

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