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 


Adding Records to tables

 
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: 577

PostPosted: Sun Oct 23, 2016 12:16 pm    Post subject: Adding Records to tables Reply with quote

This morning I attempted to code adding records to a table
Code:
AL = getAddressList()
memrec = 0x0789B84C
for x = 1,2 do
mr = addresslist_createMemoryRecord(AL)
mr.Description = "Item " .. x+72 .. " Type"
mr.Address = memrec +x+2
mr.Type = vtByte
end


I got these results:
1. Records added at the bottom of the table--Expected that as I don't know how to add it as a child under "Items" folder
2. Addresses looked like decimal instead of hexadecimal, but right clicking them to show as hexadecimal did not change the appearance of the records.

How does one code this to correctly to have the records as a child and have hexadecimal addresses?
Back to top
View user's profile Send private message Yahoo Messenger
Zanzer
I post too much
Reputation: 126

Joined: 09 Jun 2013
Posts: 3278

PostPosted: Sun Oct 23, 2016 12:42 pm    Post subject: Reply with quote

Code:
local AL = getAddressList()
local items = AL.getMemoryRecordByDescription("Items")
local memrec = 0x0789B84C
for x = 1, 2 do
  mr = AL.createMemoryRecord()
  mr.Description = "Item " .. x + 72 .. " Type"
  mr.Address = string.format("%X", memrec + x + 2)
  mr.Type = vtByte
  mr.appendToEntry(items)
end
Back to top
View user's profile Send private message
bknight2602
Grandmaster Cheater
Reputation: 0

Joined: 08 Oct 2012
Posts: 577

PostPosted: Sun Oct 23, 2016 1:21 pm    Post subject: Reply with quote

Thanks Zanzer
Back to top
View user's profile Send private message Yahoo 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