Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Copy everything from @echo off (below the line) to the bottom then place it in a text document and save it as .bat
- Then simply just run it and enjoy playing with the safety of backups.
- --------------------------------------------------------------------------------
- @echo off
- set GameName=Project Zomboid
- ::Change this by opening "Run" and typing %userprofile% then press enter.
- ::Navigate to Zomboid/Saves/ pick multiplayer or a singleplayer mode and
- ::find a save that you want to keep regular backups of and copy the folder name
- ::and replace the "127.0.0.1_16261_SomeAccount" example.
- :: Sandbox, Multiplayer, etc.
- set Folder="Multiplayer"
- set SaveName="127.0.0.1_16261_SomeAccount"
- ::Default timeout is 300 (5 minutes).
- ::How often do you want backups to be made? (SECONDS)
- set Timeout=300
- echo Starting %GameName%...
- ::If you wish to use 64bit comment out the 32 bit section and uncomment the 64bit section. Java.exe is intentional.
- ::--------------------------32Bit--------------------------
- set Game=ProjectZomboid32.exe
- start steam://run/108600
- ::--------------------------64Bit--------------------------
- ::set Game=java.exe
- ::set GameDirectory=D:\Steam\steamapps\common\ProjectZomboid
- ::start cmd /c %GameDirectory%\ProjectZomboid64.bat
- ::---------------------------------------------------------
- ::---------------------------------------------------------------------------------------------------
- :: No need to edit anything beyond this point. ::
- ::---------------------------------------------------------------------------------------------------
- ::Checks for backup folder. If it doesn't exist, it'll make one.
- if not exist "%userprofile%\Zomboid\Saves\Backups\%SaveName%" mkdir "%userprofile%\Zomboid\Saves\Backups\%SaveName%"
- ::Waits until the game is running, then continues.
- :Check
- cls
- echo Checking if %GameName% is running before making backups...
- Timeout 10 /NOBREAK
- tasklist /FI "IMAGENAME eq %Game%" 2>NUL | find /I /N "%Game%">NUL
- if "%ERRORLEVEL%"=="1" Goto Finish
- cls
- echo %GameName% is running.
- Goto Backup1
- ::Checks if game is running and then makes a backup. If game isn't running, it will NOT make a backup.
- :Backup1
- tasklist /FI "IMAGENAME eq %Game%" 2>NUL | find /I /N "%Game%">NUL
- if "%ERRORLEVEL%"=="1" Goto Finish
- copy "%userprofile%\Zomboid\Saves\%Folder%\%SaveName%\map_p.bin" "%userprofile%\Zomboid\Saves\Backups\%SaveName%\map_p.bin.backup1"
- cls
- echo %GameName% is running.
- Timeout %Timeout% /NOBREAK
- Goto Backup2
- :Backup2
- tasklist /FI "IMAGENAME eq %Game%" 2>NUL | find /I /N "%Game%">NUL
- if "%ERRORLEVEL%"=="1" Goto Finish
- copy "%userprofile%\Zomboid\Saves\%Folder%\%SaveName%\map_p.bin" "%userprofile%\Zomboid\Saves\Backups\%SaveName%\map_p.bin.backup2"
- cls
- echo %GameName% is running.
- Timeout %Timeout% /NOBREAK
- Goto Backup1
- ::Stops script from making any more backups.
- :Finish
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement