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 


Print all records of a table

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
bknight2602
Grandmaster Cheater
Reputation: 0

Joined: 08 Oct 2012
Posts: 612

PostPosted: Tue Nov 24, 2026 7:30 am    Post subject: Print all records of a table Reply with quote

I was organizing the records of an old table into groups. I was overzealous and moved a record into a group that should not have been. I asked the question how to print all records some time ago but have forgotten
Code:

 al= getAddressList()
for x =0,al.Count-1 do
print(al.Description)
end

doesn't print anything how should I edit to print the addresses of all the table's records?
While waiting I tinkered with different combinations and found success
Code:

al= getAddressList()
for x =0,al.Count-1 do
print(al.MemoryRecord[x].Description)
end

sorry for the inconvenience.
Back to top
View user's profile Send private message Yahoo Messenger
Corroder
Grandmaster Cheater Supreme
Reputation: 76

Joined: 10 Apr 2015
Posts: 1680

PostPosted: Wed Nov 25, 2026 5:23 am    Post subject: Reply with quote

Code:

al = getAddressList()
for x = 0, al.Count - 1 do
  local mr = al.MemoryRecord[x]
  print(string.format("%s: %X", mr.Description, mr.CurrentAddress))
end

_________________
Stealing Code From Stolen Code...
And Admit It.. Hmmm....Typically LOL
Back to top
View user's profile Send private message
bknight2602
Grandmaster Cheater
Reputation: 0

Joined: 08 Oct 2012
Posts: 612

PostPosted: Thu Nov 26, 2026 9:29 am    Post subject: Reply with quote

I'm not sure what
string.format("%s: %X"
means.
Back to top
View user's profile Send private message Yahoo Messenger
Corroder
Grandmaster Cheater Supreme
Reputation: 76

Joined: 10 Apr 2015
Posts: 1680

PostPosted: Thu Nov 26, 2026 9:53 am    Post subject: Reply with quote

bknight2602 wrote:
I'm not sure what
string.format("%s: %X"
means.


Then learn Lua syntax about string.format:
-> %s: Stands for String. It takes the first variable after the comma (mr.Description, for example, such as "Player Health") and inserts it as plain text.
-> : : A literal colon and space that are printed exactly as they appear.
-> %X: Stands for Uppercase Hexadecimal. It takes the second variable (mr.CurrentAddress) and formats the number as a base-16 hex address.

_________________
Stealing Code From Stolen Code...
And Admit It.. Hmmm....Typically LOL
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 475

Joined: 09 May 2003
Posts: 26035
Location: The netherlands

PostPosted: Thu Nov 26, 2026 11:36 am    Post subject: Reply with quote

you can also use printf for compacter code
Code:

printf("%s: %X", mr.Description, mr.CurrentAddress)

_________________
Tools give you results. Knowledge gives you control.

Like my help? Join me on Patreon so i can keep helping
Back to top
View user's profile Send private message MSN Messenger
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