Difference between revisions of "Lua:Class:Addresslist"

From Cheat Engine
Jump to navigation Jump to search
m
(Major overhaul of the post.)
 
(16 intermediate revisions by 5 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]]
 +
{{Class|'''class''' Addresslist ''':''' Panel}}
  
'''addresslist_getCount'''(addresslist)
+
The Addresslist class represents Cheat Engine's main cheat table address list.
  
Returns the ammount of entires in the addresslist.
+
It contains [[Lua:Class:MemoryRecord|MemoryRecord]] entries and provides methods for selecting, creating, finding, editing, activating, and disabling records.
  
Example:
+
===Inheritance===
  --Assume the table is empty
+
{|width="85%" cellpadding="10%" cellspacing="0" border="0"
  table=getAddressList()
+
!align="left"|Class
  address=0x2031a3ac
+
!align="left"|Inherits From
  --Create 2 entires
+
!style="width: 80%;background-color:white;" align="left"|Description
  for i=1,2 do
+
|-
    mr=addresslist_createMemoryRecord(table)
+
|Addresslist
    memoryrecord_setAddress(mr,address)
+
|[[Lua:Class:Panel|Panel]]
 
+
|The main cheat table address list control.
    address=address+1
+
|-
  end
+
|[[Lua:Class:Panel|Panel]]
  entries=addresslist_getCount(table) -- entries now has the value 2
+
|[[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===
 +
{|width="85%" cellpadding="10%" cellspacing="0" border="0"
 +
!align="left"|Property
 +
!align="left"|Type
 +
!style="width: 80%;background-color:white;" align="left"|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
 +
|[[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.
 +
|}
  
'''addresslist_getMemoryRecord'''(addresslist, index)
+
===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.
 +
|}
  
Returns the [[MemoryRecord]] entry. The first object is indexed by 0.
+
===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
 +
|-
 +
|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.
 +
|}
  
Example:
+
===Examples===
  table=getAddressList()
 
  memory_record1=addresslist_getMemoryRecord(table,0)
 
  
 +
====Get the Addresslist object====
 +
<syntaxhighlight lang="lua" line>
 +
local addresslist = getAddressList()
  
'''addresslist_getMemoryRecordByDescription'''(addresslist, string)
+
print("Records: " .. tostring(addresslist.Count))
 +
</syntaxhighlight>
  
Returns the [[MemoryRecord]] entry matched by the string. The description has to be an exact match, but is case-insensitive
+
====Use the global AddressList variable====
 +
<syntaxhighlight lang="lua" line>
 +
local addresslist1 = getAddressList()
 +
local addresslist2 = AddressList
  
Example:
+
print(addresslist1 == addresslist2)
  --Assume we have a entry in the cheat table with the description "Health"
+
</syntaxhighlight>
  table=getAddressList()
 
  memory_record=addresslist_getMemoryRecordByDescription(table,"Health")
 
  
 +
====Create a new MemoryRecord====
 +
<syntaxhighlight lang="lua" line>
 +
local addresslist = getAddressList()
 +
local record = addresslist.createMemoryRecord()
  
'''addresslist_getMemoryRecordByID'''(addresslist, ID)
+
record.Description = "Player Health"
 +
record.Address = "game.exe+12345"
 +
record.Type = vtDword
 +
record.Value = "1000"
 +
</syntaxhighlight>
  
Returns the [[MemoryRecord]] entry matched by the unique ID.
+
====Iterate through all records====
 +
<syntaxhighlight lang="lua" line>
 +
local addresslist = getAddressList()
  
Example:
+
for i = 0, addresslist.Count - 1 do
  --Assume we have a entry in the cheat table with the description "Health"
+
   local record = addresslist[i]
  table=getAddressList()
 
  id=memoryrecord_getID(addresslist_getMemoryRecordByDescription(table,"Health"))
 
   memory_record=addresslist_getMemoryRecordByID(table,id)
 
  
 +
  print(i .. ": " .. record.Description)
 +
end
 +
</syntaxhighlight>
  
'''addresslist_createMemoryRecord'''(addresslist)
+
====Access a record with getMemoryRecord====
 +
<syntaxhighlight lang="lua" line>
 +
local addresslist = getAddressList()
  
Creates an empty memory record at the end of the addresslist.
+
if addresslist.Count > 0 then
This function also returns the empty [[MemoryRecord]] entry, which can be used to immediately access the [[MemoryRecord]].
+
  local record = addresslist.getMemoryRecord(0)
  
Example:
+
   print(record.Description)
   --Assume we have a entry in the cheat table with the description "Health"
+
end
  table=getAddressList()
+
</syntaxhighlight>
  memory_record=addresslist_createMemoryRecord(table)
 
  memoryrecord_setAddress(memory_record,0x00400000)
 
  
 +
====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====
Don't know what these are:
+
<syntaxhighlight lang="lua" line>
 +
local addresslist = getAddressList()
 +
local record = addresslist.getMemoryRecordByID(10)
  
'''addresslist_getSelectedRecords'''(addresslist)
+
if record ~= nil then
Returns a array of selected Cheat Table entires. (??)
+
  print("Found ID 10: " .. record.Description)
 +
end
 +
</syntaxhighlight>
  
'''addresslist_doDescriptionChange'''(addresslist)
+
====Get the selected record====
Change description(??)
+
<syntaxhighlight lang="lua" line>
 +
local addresslist = getAddressList()
 +
local record = addresslist.getSelectedRecord()
  
'''addresslist_doAddressChange'''(addresslist)
+
if record ~= nil then
 +
  print("Selected: " .. record.Description)
 +
end
 +
</syntaxhighlight>
  
'''addresslist_doTypeChange'''(addresslist)
+
====Use the SelectedRecord property====
 +
<syntaxhighlight lang="lua" line>
 +
local addresslist = getAddressList()
  
'''addresslist_doValueChange'''(addresslist)
+
if addresslist.SelCount > 0 then
 +
  local record = addresslist.SelectedRecord
  
'''addresslist_getSelectedRecord'''(addresslist)
+
  print("Selected: " .. record.Description)
 +
end
 +
</syntaxhighlight>
  
'''addresslist_setSelectedRecord'''(addresslist)
+
====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
 +
 
 +
local ammo = addresslist.createMemoryRecord()
 +
ammo.Description = "Ammo"
 +
ammo.Address = "game.exe+5678"
 +
ammo.Type = vtDword
 +
</syntaxhighlight>
 +
 
 +
{{LuaSeeAlso}}
 +
 
 +
{{Forms}}

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

See Also[edit]

Main Pages

Form Related Pages