Posted: Mon Mar 28, 2016 11:16 am Post subject: Dynamically add addresses to table?
I'd like to see a way to add addresses dynamically from within a script.
For instance let's say the inventory of the character is an array/list thingy.
We can deduce the address of the array and it's size, but we don't know what items and in which order are located in the inventory.
Also the items might appear multiple times in the array with different stack sizes (amounts).
Looping through the array, identifying each element and assigning it to a table "variable" then going back to the table and adding addresses manually is a chore.
I feel like there should be a procedural way of doing it.
Maybe something like:
Code:
// Adding an address
addAddress(address, type, label)
// Adding a pointer
addPointer(address, offsets[], type, label)
local list = getAddressList()
local rec = list.createMemoryRecord()
rec.setAddress(address)
rec.setDescription(description)
If you want to put it inside a regular script:
Code:
[ENABLE]
{$lua}
local list = getAddressList()
local rec = list.createMemoryRecord()
rec.setAddress(address)
rec.setDescription(description)
{$asm}
[DISABLE]
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum