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 


Loading/Saving Text files or lua

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Extensions
View previous topic :: View next topic  
Author Message
jgoemat
Master Cheater
Reputation: 22

Joined: 25 Sep 2011
Posts: 252

PostPosted: Sat Jul 21, 2018 3:17 am    Post subject: Loading/Saving Text files or lua Reply with quote

I wrote a couple functions to help loading and saving text files. They default to on disk, but you can pass a flag to load/save to a TableFile. When loading a file that doesn't exist on disk it will fall back to a TableFile.

I found a pretty good serialization library and wanted something like this to store settings, like what cheats you want enabled by default. Actually for some mono work I'm doing so you can specify classes you want to ignore.

Code:
-- save config object to table file 'config.lua'
saveTextFile('config.lua', serialize.toString(config), true)

-- load config from disk file, fall back to table file
config = loadstring(loadTextFile('config.lua'))()



TextFiles.lua
 Description:

Download
 Filename:  TextFiles.lua
 Filesize:  3.61 KB
 Downloaded:  822 Time(s)

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 Extensions 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