Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Dynamically add addresses to table?

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine
View previous topic :: View next topic  
Author Message
Praefator
Newbie cheater
Reputation: 0

Joined: 26 Feb 2016
Posts: 10

PostPosted: Mon Mar 28, 2016 11:16 am    Post subject: Dynamically add addresses to table? Reply with quote

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)


What do you guys think?

_________________
Use simple words. I'm new at making cheats.
Back to top
View user's profile Send private message
Zanzer
I post too much
Reputation: 126

Joined: 09 Jun 2013
Posts: 3278

PostPosted: Mon Mar 28, 2016 11:29 am    Post subject: Reply with quote

Can use LUA:
Code:
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]
Back to top
View user's profile Send private message
Praefator
Newbie cheater
Reputation: 0

Joined: 26 Feb 2016
Posts: 10

PostPosted: Mon Mar 28, 2016 11:31 am    Post subject: Reply with quote

Shocked Can I do that? I've been looking everywhere for a way to do that.
I'll try this.
Thank you! Smile

_________________
Use simple words. I'm new at making cheats.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites