Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ::------------------------------------------------------------------------------
- :: Starts a Killing Floor server with a randomly-selected ROM file.
- ::------------------------------------------------------------------------------
- @echo off
- :: Ordinarily I'd enable delayed expansion to make things easier, but I don't
- :: know for certain that none of your ROM files contain an exclamation point,
- :: which would break things. We absolutely want setlocal here, though.
- setlocal disabledelayedexpansion
- set "verbose=false"
- if /I "%~1"=="-v" set "verbose=true"
- set "workdir=D:\Apache24\htdocs"
- pushd "%workdir%"
- if "%verbose%"=="true" echo Current directory is: "%cd%"
- set "counter=0"
- for /f "delims=" %%i in ('dir /b /a:-d kf-*.rom') do (
- call set "rom_list[%%counter%%]=%%~i"
- set /a counter+=1
- if "%verbose%"=="true" call echo Rom file %%counter%% found: %%~i
- )
- set /a rnd_num=%RANDOM% %% %counter%
- call set "filename=%%rom_list[%rnd_num%]%%"
- if "%verbose%"=="true" (
- set rom_list
- set filename
- )
- popd
- if "%verbose%"=="true" echo Current directory is: "%cd%"
- call :start_kf_server
- exit /b
- ::------------------------------------------------------------------------------
- :: Start the Killing Floor server with the random map file
- ::
- :: Arguments: None
- :: Returns: None
- ::------------------------------------------------------------------------------
- :start_kf_server
- echo Starting Killing Floor server with file "%filename%"
- pause
- >>KFRandom.txt echo "%filename%"
- ucc server %fileName%?Mutator=MML.ML04?game=KFmod.KFGameType?VACSecured=true?MaxPlayers=12?MinPlayers=12?AdminName=nd2spd?AdminPassword=passwordhere -log=server.log
Advertisement
Add Comment
Please, Sign In to add comment