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 


Lua Engine AUTO Bak file.

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

Joined: 28 Jun 2015
Posts: 432

PostPosted: Wed Jan 25, 2017 6:43 am    Post subject: Lua Engine AUTO Bak file. This post has 1 review(s) Reply with quote

When writing "Check For Active Injections On Close" I closed CE before I copied it over to Notepad++. SO had to write twice. I vowed for my stupidity to never ruin a session in the LUA Engine again.

1st Run ONLY:
It creates a folder in CE directory called "Lua_Bak".

Every Run After:
Launching CE it creates a "timestamp" of when the program was opened. If you open the Lua Engine and write anything in the script box it will auto save to a file by the name of the "timestamp.bak".


Super Simple and Helpful. Cool

And A Snap Shot.




LUA Engine Auto Bak.lua
 Description:

Download
 Filename:  LUA Engine Auto Bak.lua
 Filesize:  1.25 KB
 Downloaded:  1644 Time(s)


_________________
Back to top
View user's profile Send private message
++METHOS
I post too much
Reputation: 92

Joined: 29 Oct 2010
Posts: 4197

PostPosted: Wed Jan 25, 2017 7:18 am    Post subject: Reply with quote

Good work. Can I make a similar request? Very Happy

I have this script:

Code:
function autosavenow(t)
  saveTable(getCheatEngineDir().."autosave.ct")
end

autosavetimer=createTimer(nil)
timer_setInterval(autosavetimer, 1*60*1000)
timer_onTimer(autosavetimer, autosavenow)
timer_setEnabled(autosavetimer, true)


But I'd like to be able to do the following with it:

1. Save as tablename.bak
2. Save to folder where table resides

As it is now, it saves the current table to the CE directory every 60 seconds, and every backup is called autosave.ct, regardless of the table that you're working on. Since I'm dumb with LUA, I'm not sure how to go about setting this up, or if it's even possible.

If you're not interested, I'll understand - I'll create a thread in that case.

Thanks!
Back to top
View user's profile Send private message
akumakuja28
Master Cheater
Reputation: 16

Joined: 28 Jun 2015
Posts: 432

PostPosted: Wed Jan 25, 2017 7:44 am    Post subject: This post has 1 review(s) Reply with quote

Yeah i can do tht. Getting the table name might be tricky but i think mgr already wrote a "grab" for tht.

WE can make it create a folder of the Table name too and dump all edit in there.

I can also make it scan the current table and ONLY save if differences are found.

Eitherway hit me back.


I gotta ask. Are you asking because of CE not checking if scripts have been edited on closed. If so we can tackle tht a different way.

_________________
Back to top
View user's profile Send private message
++METHOS
I post too much
Reputation: 92

Joined: 29 Oct 2010
Posts: 4197

PostPosted: Wed Jan 25, 2017 2:57 pm    Post subject: Reply with quote

Awesome! Thanks so much for your consideration.

Regarding the creation of a new folder, I don't think that's necessary for my needs. I simply would like to have CE write a backup of my entire table every minute or so (writing over the previous backup for the specific table that I'm working on), because sometimes CE freezes up or crashes before I remember to save my work.

So, as an example, let's say that I keep all of my cheat tables at:

"C:\Users\METHOS\Documents\My Cheat Tables"

Or, maybe somewhere else, it doesn't matter, wherever the current table that I am working on is located, that's where the backup should be created.

And...

If I am working on table awesomegame.ct, then the backup should be awesomegame.bak (or whatever readable extension, it doesn't matter). Then, if I switch out the table and start working on boringgame.ct, then a backup should start being made for that, called boringgame.bak etc..

Whether or not the backup times are every 60 seconds, or only when changes occur, that doesn't matter so much to me - either would work great, I think.

Thanks, again!
Back to top
View user's profile Send private message
jgoemat
Master Cheater
Reputation: 22

Joined: 25 Sep 2011
Posts: 252

PostPosted: Wed Jun 06, 2018 3:35 pm    Post subject: Reply with quote

Thanks to a post I found by mgr.inz.Player, you can get the current path to your table like this:

Code:
return getMainForm().SaveDialog1.Filename


Actually you can get the directory that a save will show as (with trailing \) with this:

Code:
return getMainForm().SaveDialog1.InitialDir
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