Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- :: put this script in "..\steamapps\common\SovietRepublic\media_soviet\buildings_types\buildings_types.bat"
- :: run it once before launching the game if new buildings added and wait until end
- CLS
- @ECHO OFF
- SETLOCAL EnableDelayedExpansion
- SET /A count=0
- SET "$New_line=$HARBOR_EXTEND_AREA_WHEN_BULDING -500"
- :: list files to be changed
- ECHO Preparing list of files...
- DIR /B /S *.ini >> list.txt
- :: count lines in list.txt to variable "lines"
- SET _File=list.txt
- SET /a lines=0
- FOR /f %%H in ('FIND "" /V /C ^< %_File%') DO SET /a lines=%%H
- :: main task - edit files
- FOR /F "tokens=*" %%G IN (list.txt) DO (
- SET /A "count=!count!+1"
- :: search for line
- FIND "$HARBOR_EXTEND_AREA_WHEN_BULDING" %%~nG.ini >NUL
- :: line not found so edit file
- IF ERRORLEVEL 1 (
- ECHO %$New_line% > "New_%%~nG.ini"
- TYPE "%%G" >> "New_%%~nG.ini"
- DEL "%%~nG.ini" >NUL
- REN "New_%%~nG.ini" "%%~nG.ini"
- )
- CLS
- ECHO Total !count! of !lines! files ready.
- ECHO made in 2021 by Emil Sawicki
- )
- DEL list.txt >NUL
- PAUSE
Add Comment
Please, Sign In to add comment