Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @echo off
- rem ------ Syntax ------
- rem clircon -P"rcon_password" -a127.0.0.1 -p27015 command
- rem ------ Notes ------
- rem !!!%* is a 'placeholder for every batch argument' It should not be removed. !!!!!
- rem !!!leave the quotes arround the rconpassword!!!
- rem ------ Usage ------
- rem edit the command line options and drag the batch file into the "run..." box which
- rem can be found in the windows startmenu.
- rem use qry_rcon.bat status to get the the status of your srcds server
- rem Vars
- set host=
- set port=
- set password=
- set map1=
- set map2=
- rem Check vars
- if [%host%]==[] goto :undefined
- if [%port%]==[] goto :undefined
- if [%password%]==[] goto :undefined
- if [%map1%]==[] goto :undefined
- if [%map2%]==[] goto :undefined
- rem Host availability
- ping -n 1 %host% >nul
- if ERRORLEVEL 1 goto :unreachable
- rem Cases
- if [%1]==[] goto :usage
- if [%1]==[players] if [%2]==[] goto :players
- if [%1]==[map] if [%2]==[] goto :map
- if [%1]==[uptime] if [%2]==[] goto :uptime
- if [%1]==[nicks] if [%2]==[] goto :nicks
- if [%1]==[info] if [%2]==[] goto :info
- if [%1]==[pvp] if [%2]==[] goto :pvp
- if [%1]==[custom] if [%2]==[] goto :custom
- goto :command
- :players
- rem clircon.exe -P"%password%" -a%host% -p%port% status | find "%input%"
- for /f "tokens=1*delims=:" %%G in (' %0 stats^|findstr /n "^" ') do if %%G equ 2 for /f "tokens=7" %%a in ("%%H") do echo %%a
- goto :eof
- :uptime
- for /f "tokens=1*delims=:" %%G in (' %0 stats^|findstr /n "^" ') do if %%G equ 2 for /f "tokens=4" %%a in ("%%H") do echo %%a
- goto :eof
- :map
- rem clircon.exe -P"%password%" -a%host% -p%port% status | find "%input%"
- for /f "tokens=3" %%a in ('%0 status^| find "map"') do echo %%a
- goto :eof
- :nicks
- rem for /f "tokens=4" %%a in ('rcon status^| find "#"') Do echo %%a
- for /f "tokens=4,*" %%G in (' %0 status^| find "STEAM" ') do echo %%G %%H
- goto :eof
- :info
- rem call :map
- rem call :players
- rem call :uptime
- for /f "tokens=3" %%a in ('%0 status^| find "map"') do echo Map: %%a
- for /f "tokens=1*delims=:" %%G in (' %0 stats^|findstr /n "^" ') do if %%G equ 2 for /f "tokens=7" %%a in ("%%H") do echo Players: %%a
- for /f "tokens=1*delims=:" %%G in (' %0 stats^|findstr /n "^" ') do if %%G equ 2 for /f "tokens=4" %%a in ("%%H") do echo Uptime: %%a
- goto :eof
- :command
- clircon.exe -P"%password%" -a%host% -p%port% %*
- goto :eof
- :usage
- echo Usage: %0 [option]
- echo map - current map
- echo players - current players
- echo uptime - server uptime
- echo nicks - players nick
- echo info - map, players, uptime
- echo pvp - change map to %map1%, change playlist to pvp, connect to server
- echo custom - change map to %map2%, change playlist to custom
- echo [command] - rcon commands
- goto :eof
- :unreachable
- echo %host% is unreachable
- goto :eof
- :undefined
- echo Check your vars !!! (host, port, password, map1, map2)
- goto :eof
- :pvp
- set players=
- rem call :players
- for /f "tokens=1*delims=:" %%G in (' %0 stats^|findstr /n "^" ') do if %%G equ 2 for /f "tokens=7" %%a in ("%%H") do set players=%%a
- if %players%==0 (
- echo Changing map to %map1%.....
- call %0 map %map1% push
- timeout /t 30
- echo Changing playlist to pvp.....
- call %0 exec server_pvp.cfg
- timeout /t 5
- echo Connecting to server.....
- cd "C:\Program Files (x86)\Steam\steamapps\common\insurgency2\"
- start /low insurgency.exe -textmode -novid -nosound -nopreload +clientport 27015 +connect %host%:27115
- timeout /t 10
- echo Map changed to %map1% - Playlist changed to pvp - Connected to server !!!
- timeout /t 10
- ) else (
- echo Server is not empty !!!
- )
- goto :eof
- :custom
- set players=
- rem call :players
- for /f "tokens=1*delims=:" %%G in (' %0 stats^|findstr /n "^" ') do if %%G equ 2 for /f "tokens=7" %%a in ("%%H") do set players=%%a
- if %players%==32 (
- echo Nextlevel changing to %map2%.....
- call %0 nextlevel %map2%
- timeout /t 10
- echo Changing playlist to custom.....
- call %0 exec server_custom.cfg
- timeout /t 10
- echo Map changed to %map2% - Playlist changed to custom !!!
- timeout /t 10
- ) else (
- echo Server is not full !!!
- )
- goto :eof
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement