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 


Grouping Addresses

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
Game Hacking Dojo
Master Cheater
Reputation: 1

Joined: 17 Sep 2023
Posts: 250

PostPosted: Tue Oct 08, 2024 8:02 am    Post subject: Grouping Addresses Reply with quote

Is there a way to automate the creation of a miniature entity structure?

Code:
for i = 0, 10 do
  local group = getAddressList().createMemoryRecord()
  group.IsGroupHeader = true
  --create an entity under this group
    local entry = getAddressList().createMemoryRecord()
    entry.description = "Entity #"..i
    entry.address = "address_get_entity"
    entry.OffsetCount = 1
    entry.Offset[0] = 4 * i
    entry.type = 2
end
Back to top
View user's profile Send private message Visit poster's website
ParkourPenguin
I post too much
Reputation: 152

Joined: 06 Jul 2014
Posts: 4706

PostPosted: Tue Oct 08, 2024 11:42 am    Post subject: Reply with quote

Is `appendToEntry` what you're looking for?

You should probably move the header outside the for loop

Use one of the constants in defines.lua for the type

The group can be set to hide children when inactive as well
Code:
local group = getAddressList().createMemoryRecord()
group.Description = 'Entities'
group.IsGroupHeader = true
group.Options = '[moHideChildren]'

for i = 0, 10 do
  local entry = getAddressList().createMemoryRecord()
  entry.description = "Entity #"..i
  entry.address = "address_get_entity"
  entry.OffsetCount = 1
  entry.Offset[0] = 4 * i
  entry.type = vtDword
  entry.appendToEntry(group)
end

_________________
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
Game Hacking Dojo
Master Cheater
Reputation: 1

Joined: 17 Sep 2023
Posts: 250

PostPosted: Tue Oct 08, 2024 12:01 pm    Post subject: Reply with quote

Thank you man you always save me.

Is there a benefit to using a variable (a constant from defines.lua) instead of its representation?
Back to top
View user's profile Send private message Visit poster's website
ParkourPenguin
I post too much
Reputation: 152

Joined: 06 Jul 2014
Posts: 4706

PostPosted: Tue Oct 08, 2024 12:29 pm    Post subject: Reply with quote

It's easier to read the code.
Code:
memrec.type = 5
memrec.type = vtDouble
The first line has no meaning to people when read. The second clearly means the type of the memrec is a double.
_________________
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
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