Advertisement
JadedDragoon

Untitled

Apr 28th, 2015
208
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Batch 1.53 KB | None | 0 0
  1. @ECHO off
  2. REM Set to folder name of robocraft.exe executable
  3. SET robodir=D:\games\SteamComLib\steamapps\common\Robocraft
  4. REM Will keep %logs% logs in addition to current log
  5. SET logs=10
  6.  
  7. REM === CODE START ===
  8. SET cur=%logs%
  9.  
  10. REM if there is no new output log there is no need to rename files
  11. IF NOT EXIST "%robodir%\RobocraftClient_Data\output_log.txt" (
  12.   ECHO Missing output log. Skipping.
  13.   GOTO game
  14. )
  15.  
  16. REM if exists, delete oldest backup to make room for new
  17. IF EXIST "%robodir%\RobocraftClient_Data\output_log.%cur%.txt" (
  18.   DEL "%robodir%\RobocraftClient_Data\output_log.%cur%.txt"
  19. )
  20.  
  21. REM loop through existing backup logs and increment file names by one until %logs% backups exist
  22. :loop
  23.  
  24. REM if output_log.%mone%.log exists rename log, incrementing %mone% to %cur% (where %mone% equals %cur% minus 1)
  25. SET /a mone=%cur%-1
  26. IF EXIST "%robodir%\RobocraftClient_Data\output_log.%mone%.txt" (
  27.   MOVE /Y "%robodir%\RobocraftClient_Data\output_log.%mone%.txt" "%robodir%\RobocraftClient_Data\output_log.%cur%.txt"
  28. )
  29.  
  30. REM decrement %cur% and restart loop
  31. SET /a cur-=1
  32. REM if final iteration escape loop to :fnsh
  33. IF %cur% LEQ 0 ( GOTO fnsh )
  34. GOTO loop
  35.  
  36. :fnsh
  37. REM if exists, make backup of most recent log
  38. IF EXIST "%robodir%\RobocraftClient_Data\output_log.txt" (
  39.   MOVE /Y "%robodir%\RobocraftClient_Data\output_log.txt" "%robodir%\RobocraftClient_Data\output_log.1.txt"
  40. )
  41.  
  42. :game
  43. REM clear variables (probably unnecessary)
  44. SET cur=
  45. SET mone=
  46.  
  47. REM change to robocraft directory and run game
  48. CD "%robodir%"
  49. Robocraft.exe
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement