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 import lua script file and add it to the cheat table

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

Joined: 15 Dec 2016
Posts: 31

PostPosted: Tue Jun 11, 2024 12:06 am    Post subject: How to import lua script file and add it to the cheat table Reply with quote

I have an Auto Assemble Script stored as a file. Code1.lua Code2.lua, etc.
I can open the file with io.open("Code1.lua") and I can read the code out.

But I'm not sure how to add it to the Cheat Table so it shows up like Code1 <>script<> so I can just enable/disable it using the checkbox.

Thanks for any help given.

I figured it out. I can now open Code1.lua and use .Script to import it to an empty script entry on the table. So that part is working. I also figured out how to generate a new entry and import everything. I'm good now!

Code:
      local ImportLUA = io.open(TrainerOrigin .. GameVersion.Value .. ".lua")
      local CreateLUAEntry = AddressList.createMemoryRecord()
      CreateLUAEntry.Description = "Name"
      CreateLUAEntry.Type = vtAutoAssembler
      CreateLUAEntry.Script = ImportLUA:read("*a")
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