Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ::hey, stop bullying my source code and just use this boi
- ::made by Paradigm#0001
- @echo off
- SETLOCAL EnableDelayedExpansion
- title FTL save backer upper
- set confignotexist=0
- if not exist "%cd%\config.ini" (
- set confignotexist=1 & goto introskip
- )
- set /p config1=<"%cd%\config.ini"
- ( for /L %%A in (1,1,1) do (
- set /p =
- )
- set /p config2=
- ) <"%cd%\config.ini"
- set !config1!
- set !config2!
- if exist !SAVDUMPDIR! (
- goto skip1
- )
- :introskip
- if not exist "%SystemDrive%\Users\%USERNAME%\Documents\My Games\FasterThanLight" (
- MSG %USERNAME% The current FTL save directory could not be found
- goto invalidFTLDIR
- )
- set "FTLSAVDIR=%SystemDrive%\Users\%USERNAME%\Documents\My Games\FasterThanLight"
- goto skip1
- :invalidFTLDIR
- set /p FTLSAVDIR="Please enter the current FTL save directory:"
- if not exist "!FTLSAVDIR!" (
- cls & choice /m "The current directory you entered does not exist, Would you like to try again?"
- if !ERRORLEVEL!==1 (
- cls & goto invalidFTLDIR
- )
- )
- :skip1
- if %confignotexist%==1 (
- goto pollingratechoice
- )
- choice /m "Would you like to change the polling rate?"
- if !ERRORLEVEL!==2 (
- cls & goto savdirerror
- )
- :pollingratechoice
- cls
- echo 1. 1000ms
- echo 2. 500ms
- echo 3. 250ms
- echo 4. 100ms
- echo 5. Custom
- choice /c 12345 /n /m "Please select the update rate at which your save will checked for changes and backed up:"
- if %ERRORLEVEL%==1 (
- set RATE=1000
- ) else if %ERRORLEVEL%==2 (
- set RATE=500
- ) else if %ERRORLEVEL%==3 (
- set RATE=250
- ) else if %ERRORLEVEL%==4 (
- set RATE=100
- ) else if %ERRORLEVEL%==5 (
- :RATEerror
- cls
- set /p RATE="Please enter [in milliseconds] the update rate: "
- set /a RATE+=0
- if !RATE! LEQ 75 (
- echo:
- echo The value entered cannot be a string[text] or below 75ms
- pause
- cls
- goto RATEerror
- )
- )
- set "config1=POLLINGRATE=!RATE!"
- set RETURN=Pollingratereturn
- goto configsave
- :Pollingratereturn
- set !config1!
- set RETURN=savdirerror
- goto configsave
- :savdirerror
- cls
- if %confignotexist%==1 (
- goto SAVDUMPDIRchoice
- )
- choice /m "Would you like to change the save location?"
- iz`f !ERRORLEVEL!==2 (
- goto skip2
- )
- :SAVDUMPDIRchoice
- cls
- set /p SAVDUMPDIR="Please enter a directory to save updated .sav files to: "
- if not exist "!SAVDUMPDIR!" (
- cls & echo !SAVDUMPDIR! does not exist, Please enter another directory. & pause & goto SAVDUMPDIRchoice
- )
- set config2=SAVDUMPDIR=!SAVDUMPDIR!
- set RETURN=skip2
- goto configsave
- :skip2
- cls
- chdir /D !FTLSAVDIR!
- :update1
- for %%a in (continue.sav) do set continueChange=%%~tza
- :update2
- ping -n 2 -w !POLLINGRATE! localhost >nul
- for %%a in (continue.sav) do if "!continueChange!"=="%%~tza" (
- goto update2
- )
- for %%a in (continue.sav) do set continueChange=%%~tza
- copy /y "continue.sav" "!SAVDUMPDIR!"
- goto update1
- :configsave
- del "%CD%\config.ini" >nul 2>&1
- (for %%A in (
- "!config1!"
- "!config2!"
- ) do echo.%%~A)> "%CD%\config.ini"
- goto !RETURN!
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement