5bitesofcookies

SEBackups

Nov 24th, 2015
163
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ;Originally by https://www.reddit.com/user/Stembolt_Sealer , edited to add timestamping by https://www.reddit.com/user/AI221/
  2.  
  3. #NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
  4. ; #Warn  ; Enable warnings to assist with detecting common errors.
  5. SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
  6. ;space engineers periodic save file copier
  7. one_minute=60000 ;definition - one minute is 60000ms
  8. sleep_time:=one_minute*5 ;initialize sleep_time (default is 5 minutes)
  9. ShowWhenSaved:= 1
  10.  
  11. save_directory_original=C:\Users\Jackson\AppData\Roaming\SpaceEngineers\Saves
  12. save_directory_backup=D:\Backups\SpaceEngineers
  13.  
  14. while 1
  15. {
  16.     Process, Exist, spaceengineers.exe
  17.     ;ErrorLevel is the process_id, if it exists, if it is 0 the process does not exist
  18.     If (ErrorLevel=0)
  19.     {
  20.         ;TrayTip Nop,SpaceEngineers isnt running
  21.         ;do nothing! the process doesn't exist!
  22.     }
  23.     else{
  24.         ;FileCopyDir Documetation - https://www.autohotkey.com/docs/commands/FileCopyDir.htm
  25.         FileCopyDir, %save_directory_original%, %save_directory_backup%/%A_NowUTC%, 0
  26.         if (ShowWhenSaved)
  27.         {
  28.             TrayTip SEBackups,Backup was created!
  29.         }
  30.     }
  31.     sleep, %sleep_time% ;wait for a set time
  32. }
Add Comment
Please, Sign In to add comment