SRCDS Steam group


Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Garry's Mod SRCDS Multitool v1.0 (public)
#1
Exclamation 
A little something I coded in batch to make running a Garry's Mod SRCDS a bit easier.

Features:

- SRCDS Crash Protection (with log file generation)
- Customized SRCDS Launch Parameters
- All-in-one program, just one file is all you need

Perks:

- Uses fewer CPU cycles compared to SRCDS Guardian 3.0.
- SRCDS Multitool ONLY logs server crashes. Thus results in less disk consumption/usage and a cleaner, easier to read log file.

[attachment=1313]

###EXTERNAL DOWNLOAD###:
http://www.mediafire.com/download.php?9micnf3tbcy9ud4

(rem Wait can be only executed in .EXE form)

Code:
@echo off
title Garry's Mod SRCDS Multitool / Coded by Rob J.
:def/custom
cls
echo What would you like to do?
echo.
echo.
echo 1. Run SRCDS gm_construct Default
echo 2. Run SRCDS gm_flatgrass Default
echo 3. Run SRCDS Custom
echo............................................
echo.
set /p choice1=":> "
If %choice1% == 1 goto construct
If %choice1% == 2 goto flatgrass
If %choice1% == 3 goto custom
cls
echo ERROR: Invalid Selection!
rem Wait 2000
goto def/custom



:construct
cls
cd c:\srcds/orangebox
start srcds.exe -console -game garrysmod +map gm_construct +maxplayers 16 -ip 0.0.0.0
rem Wait 4000

:top1
for /f "usebackq" %%Z in (`tasklist /nh /fi "imagename eq srcds.exe"`) do if %%Z==INFO: goto processnotrunning1
echo (%date%)(%time%) Watching server for crashes...
rem Wait 1000
goto top1

:processnotrunning1
cd c:\srcds
echo (%date%)(%time%) Crash or Close detected!
>> servercrash.log echo (%date%)(%time%) Crash or Close detected!
echo (%date%)(%time%) server is now restarting...
>> servercrash.log echo (%date%)(%time%) server is now restarting...
rem Wait 2000
cd c:\srcds/orangebox
start srcds.exe -console -game garrysmod +map gm_construct +maxplayers 16 -ip 0.0.0.0
rem Wait 2000
goto top1



:flatgrass
cls
cd c:\srcds/orangebox
start srcds.exe -console -game garrysmod +map gm_flatgrass +maxplayers 16 -ip 0.0.0.0
rem Wait 4000

:top2
for /f "usebackq" %%Z in (`tasklist /nh /fi "imagename eq srcds.exe"`) do if %%Z==INFO: goto processnotrunning2
echo (%date%)(%time%) Watching server for crashes...
rem Wait 1000
goto top2

:processnotrunning2
cd c:\srcds
echo (%date%)(%time%) Crash or Close detected!
>> servercrash.log echo (%date%)(%time%) Crash or Close detected!
echo (%date%)(%time%) server is now restarting...
>> servercrash.log echo (%date%)(%time%) server is now restarting...
rem Wait 2000
cd c:\srcds/orangebox
start srcds.exe -console -game garrysmod +map gm_flatgrass +maxplayers 16 -ip 0.0.0.0
rem Wait 2000
goto top2



:custom
cls
echo Enter custom SRCDS launch parameters below.
echo.
echo.
set /p launchmap="Map: "
echo.
set /p maxplayer="Max Players: "
echo.
pause
cls
cd c:\srcds/orangebox
start srcds.exe -console -game garrysmod +map %launchmap% +maxplayers %maxplayer% -ip 0.0.0.0
rem Wait 4000

:top3
for /f "usebackq" %%Z in (`tasklist /nh /fi "imagename eq srcds.exe"`) do if %%Z==INFO: goto processnotrunning3
echo (%date%)(%time%) Watching server for crashes...
rem Wait 1000
goto top3

:processnotrunning3
cd c:\srcds
echo (%date%)(%time%) Crash or Close detected!
>> servercrash.log echo (%date%)(%time%) Crash or Close detected!
echo (%date%)(%time%) server is now restarting...
>> servercrash.log echo (%date%)(%time%) server is now restarting...
rem Wait 2000
cd c:\srcds/orangebox
start srcds.exe -console -game garrysmod +map %launchmap% +maxplayers %maxplayer% -ip 0.0.0.0
rem Wait 2000
goto top3


[Image: b_350_20_692108_381007_FFFFFF_000000.png]
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)