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 


How to populate the cheat engine table using lua?

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
KneeGrow
How do I cheat?
Reputation: 0

Joined: 12 Aug 2015
Posts: 6

PostPosted: Wed Feb 03, 2021 12:13 am    Post subject: How to populate the cheat engine table using lua? Reply with quote

By cheat engine table I mean the section that gets filled in when you double click an address
[Active][Description][Address][Type][Value]
(I'd show you a picture but I haven't reached a certain number of posts to paste URLs)

I am using a piece of player data, that I can find consistently, as a base (Z position) and want to populate the table with data near that base address

Example
Base: 0x12345678
Y position = Base + 0x04
X velocity = Base + 0x08
and so on...

I don't want to manually add new addresses and calculate base + offset each time I boot up CE and was hoping to use LUA to do that. However, I don't know how to add rows to CE using LUA.

I'm expecting there to be something along the lines of
Code:

-- Sudo code:
local z_position = {address = 0x12345678, type = "float"
local y_position = {address = z_position.address + 0x04, type = "float"}
local x_velocity = {address = z_position.address + 0x08, type = "float"}

CE.addRow(y_position.address, y_position.type)
CE.addRow(x_velocity.address, x_velocity.type)



Any ideas?

Thanks in advance.
Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 152

Joined: 06 Jul 2014
Posts: 4711

PostPosted: Wed Feb 03, 2021 12:24 am    Post subject: Reply with quote

See the Addresslist class in celua.txt. You may find the wiki preferable:
https://wiki.cheatengine.org/index.php?title=Lua:Class:Addresslist

You could also use child memory records with "+X" as the address.
https://forum.cheatengine.org/viewtopic.php?p=5769552#5769552

_________________
I don't know where I'm going, but I'll figure it out when I get there.
Back to top
View user's profile Send private message
KneeGrow
How do I cheat?
Reputation: 0

Joined: 12 Aug 2015
Posts: 6

PostPosted: Wed Feb 03, 2021 1:03 am    Post subject: Reply with quote

excellents, this is exactly what i was looking for
thank you
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 Lua Scripting 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