Advertisement
Guest User

Steamguardian 1.3

a guest
Dec 15th, 2013
3,048
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.30 KB | None | 0 0
  1. :Original at http://pastebin.com/BRUbsGQh
  2. @ECHO OFF
  3. set programname=SteamCMD Guardian 1.3
  4. set LOGFILE=steamguardian.log
  5. set SEARCHTEXT="
  6. set REPLACETEXT='
  7. set steamcmdinstall=null
  8. set app=
  9. set game=
  10. GOTO MAINPROG
  11. :FAILRUNNOSTEAMCMD
  12. ECHO Steamcmd install path of %steamcmdinstall% provided no found!
  13. >> %LOGFILE% ECHO Steamcmd install path of %steamcmdinstall% provided no found!
  14. GOTO END
  15. :END
  16. pause
  17. exit
  18. ::===========================================::
  19. :: SteamCMD Guardian 1.3 WildCard65's Edition::
  20. :: WildCard65 ::
  21. ::===========================================::
  22. :MAINPROG
  23. if "%~1"=="" (
  24. GOTO NOTICE
  25. ) ELSE GOTO MAIN
  26. :NOTICE
  27. ECHO This edition of steam guardian is modified to allow command line parameters:
  28. ECHO -steamcmdinstall <path to steamcmd, can be blank if you have steamcmd path in your PATH environment variable(default is no specified path)>
  29. ECHO -maindir <main dir where all servers installed by this script go>
  30. ECHO -runscript <script for steamcmd to run>
  31. ECHO -servername <name of the server your going to run off of this script here>
  32. ECHO -game <THIS MUST BE EXACT FOR THE GAME BECAUSE IT'LL BE SUPPLIED TO SRCDS.EXE -game PARAMETER. EX: -game tf>
  33. ECHO -installdir <name of folder the server will be installed in>
  34. ECHO -srcdsparameters <parameters to pass to srcds.exe
  35. pause
  36. GOTO END
  37. :MAIN
  38. :loop
  39. IF NOT "%1"=="" (
  40. IF "%1"=="-steamcmdinstall" (
  41. SET steamcmdinstall=%2
  42. SHIFT
  43. )
  44. IF "%1"=="-maindir" (
  45. SET maindir=%~2
  46. SHIFT
  47. )
  48. IF "%1"=="-servername" (
  49. SET servername=%~2
  50. SHIFT
  51. )
  52. IF "%1"=="-runscript" (
  53. SET runscript=%2
  54. SHIFT
  55. )
  56. IF "%1"=="-game" (
  57. SET game=%2
  58. SHIFT
  59. )
  60. IF "%1"=="-installdir" (
  61. SET installdir=%2
  62. SHIFT
  63. )
  64. IF "%1"=="-srcdsparameters" (
  65. SET srcdsparameters=%~2
  66. SHIFT
  67. )
  68. SHIFT
  69. GOTO :loop
  70. )
  71. title %programname% - %servername%
  72. IF NOT %steamcmdinstall%==null (
  73. IF EXIST %steamcmdinstall% (
  74. CD %steamcmdinstall%
  75. GOTO BEGINSTEAMGUARDIAN
  76. ) ELSE GOTO FAILRUNNOSTEAMCMD
  77. )
  78. :BEGINSTEAMGUARDIAN
  79. ECHO %programname% has been started!
  80. >> %LOGFILE% ECHO %programname% has been started!
  81. REM IF %game%=="1" set app=90
  82. REM IF "%A%"=="2" set app=740
  83. REM IF "%A%"=="3" set app=111710
  84. REM IF "%A%"=="4" set app=223240
  85. REM IF "%A%"=="5" set app=212542
  86. REM IF "%A%"=="6" set app=215350
  87. IF %game%=="tf" set app=229830
  88. :RESTART
  89. IF EXIST "%maindir%\%installdir%\srcds.exe" (
  90. ECHO %servername% is now ONLINE
  91. ECHO Watching %servername% for crashes...
  92. >> %LOGFILE% ECHO %servername% is now ONLINE
  93. >> %LOGFILE% ECHO Watching %servername% for crashes...
  94. CD "%maindir%\%installdir%\"
  95. start /wait srcds.exe %srcdsparameters%
  96. ) ELSE (
  97. ECHO Server not installed!
  98. >> %LOGFILE% ECHO Server not installed!
  99. )
  100. ::Start the actual update window
  101. CD %steamcmdinstall%
  102. start /wait steamcmd +runscript %runscript%
  103. ECHO (%time%) WARNING: srcds closed or crashed, restarting.
  104. ECHO (%date%)(%time%) Crash or Close detected!
  105. ECHO %servername% is now restarting...
  106. >> %LOGFILE% ECHO (%time%) WARNING: srcds closed or crashed, restarting.
  107. >> %LOGFILE% ECHO (%date%)(%time%) Crash or Close detected!
  108. >> %LOGFILE% ECHO (%date%)(%time%) %servername% is now restarting...
  109. ::Server crashed or closed, so we point it to the return point to start the server again
  110. GOTO RESTART
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement