Raised This Month: $ Target: $400
 0% 

SteamCMD Front-End and *Almost* Universal Server Runner


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
sgosiaco
Junior Member
Join Date: Jun 2013
Old 06-27-2013 , 01:28   SteamCMD Front-End and *Almost* Universal Server Runner
Reply With Quote #1

I decided to improve on the code posted on the SteamCMD wiki page. I have made it able to download every type of server that is usable with steamcmd. I have also made a almost universal server runner that requires some testing as I am not sure that the id's for the games or correct or if they even use srcds.exe to run.

Here is the code for the downloader
Code:
@echo off
title sgosiaco's SteamCMD Downloader
rem Credit for the example batch code goes to ckynick254
rem   ______          __         __   __         
rem  / ____/___  ____/ /__  ____/ /  / /_  __  __
rem / /   / __ \/ __  / _ \/ __  /  / __ \/ / / /
rem/ /___/ /_/ / /_/ /  __/ /_/ /  / /_/ / /_/ / 
rem\____/\____/\__,_/\___/\__,_/  /_.___/\__, /  
rem                                     /____/ 
rem   _________ _____  _____(_)___ __________ 
rem  / ___/ __ `/ __ \/ ___/ / __ `/ ___/ __ \
rem (__  ) /_/ / /_/ (__  ) / /_/ / /__/ /_/ /
rem/____/\__, /\____/____/_/\__,_/\___/\____/ 
rem     /____/   
:menu
cls
Echo                          SteamCMD Downloader Menu
Echo  ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
Echo  º                                                                            º
Echo  º 1 HLDS for Half-Life and Counter-Strike                                    º
Echo  º                                                                            º
Echo  º 2 Counter-Strike: Condition Zero dedicated server                          º
Echo  º                                                                            º
Echo  º 3 Deathmatch Classic dedicated server                                      º
Echo  º                                                                            º
Echo  º 4 Day of Defeat dedicated server                                           º
Echo  º                                                                            º
Echo  º 5 Half-Life: Opposing Force dedicated server                               º
Echo  º                                                                            º
Echo  º 6 Ricochet dedicated server                                                º
Echo  º                                                                            º
Echo  º 7 Team Fortress Classic dedicated server                                   º
Echo  º                                                                            º
Echo  º 8 More options                                                             º
Echo  º                                                                            º
Echo  º 9 Exit the program                                                         º
Echo  º                                                                            º
Echo  ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ

CHOICE /C:123456789 /N
IF ERRORLEVEL 1 SET M=1
IF ERRORLEVEL 2 SET M=2
IF ERRORLEVEL 3 SET M=3
IF ERRORLEVEL 4 SET M=4
IF ERRORLEVEL 5 SET M=5
IF ERRORLEVEL 6 SET M=6
IF ERRORLEVEL 7 SET M=7
IF ERRORLEVEL 8 SET M=8
IF ERRORLEVEL 9 SET M=9

IF %M%==1 set id=90
IF %M%==2 set id=90
IF %M%==3 set id=90
IF %M%==4 set id=90
IF %M%==5 set id=90
IF %M%==6 set id=90
IF %M%==7 set id=90
IF %M%==8 GOTO menu1
IF %M%==9 GOTO EOF
GOTO options

:menu1
cls
Echo                          SteamCMD Downloader Menu
Echo  ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
Echo  º                                                                            º
Echo  º 1 Counter-Strike: Global Offensive dedicated server                        º
Echo  º                                                                            º
Echo  º 2 The Ship dedicated server                                                º
Echo  º                                                                            º
Echo  º 3 Garry's Mod dedicated server                                             º
Echo  º                                                                            º
Echo  º 4 Serious Sam 3 dedicated server                                           º
Echo  º                                                                            º
Echo  º 5 Nuclear Dawn dedicated server                                            º
Echo  º                                                                            º
Echo  º 6 Red Orchestra: Ostfront 41-45 dedicated server                           º
Echo  º                                                                            º
Echo  º 7 Red Orchestra 2: Heroes of Stalingrad and Rising Storm dedicated server  º
Echo  º                                                                            º
Echo  º 8 More options                                                             º
Echo  º                                                                            º
Echo  º 9 Exit the program                                                         º
Echo  º                                                                            º
Echo  ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ

CHOICE /C:123456789 /N
IF ERRORLEVEL 1 SET M=1
IF ERRORLEVEL 2 SET M=2
IF ERRORLEVEL 3 SET M=3
IF ERRORLEVEL 4 SET M=4
IF ERRORLEVEL 5 SET M=5
IF ERRORLEVEL 6 SET M=6
IF ERRORLEVEL 7 SET M=7
IF ERRORLEVEL 8 SET M=8
IF ERRORLEVEL 9 SET M=9

IF %M%==1 set id=740
IF %M%==2 set id=2403
IF %M%==3 set id=4020
IF %M%==4 set id=41080
IF %M%==5 set id=111710
IF %M%==6 set id=223240
IF %M%==7 set id=212542
IF %M%==8 GOTO menu2
IF %M%==9 GOTO EOF
GOTO options

:menu2
cls
Echo                          SteamCMD Downloader Menu
Echo  ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
Echo  º                                                                            º
Echo  º 1 Killing Floor dedicated server                                           º
Echo  º                                                                            º
Echo  º 2 Left 4 Dead 2 dedicated server                                           º
Echo  º                                                                            º
Echo  º 3 Team Fortress 2 dedicated server                                         º
Echo  º                                                                            º
Echo  º 4 Day of Defeat: Source dedicated server                                   º
Echo  º                                                                            º
Echo  º 5 Counter-Strike: Source dedicated server                                  º
Echo  º                                                                            º
Echo  º 6 Half-Life 2: Deathmatch dedicated server                                 º
Echo  º                                                                            º
Echo  º 7 Help!                                                                    º
Echo  º                                                                            º
Echo  º 8 Startover                                                                º
Echo  º                                                                            º
Echo  º 9 Exit the program                                                         º
Echo  º                                                                            º
Echo  ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ

CHOICE /C:123456789 /N
IF ERRORLEVEL 1 SET M=1
IF ERRORLEVEL 2 SET M=2
IF ERRORLEVEL 3 SET M=3
IF ERRORLEVEL 4 SET M=4
IF ERRORLEVEL 5 SET M=5
IF ERRORLEVEL 6 SET M=6
IF ERRORLEVEL 7 SET M=7
IF ERRORLEVEL 8 SET M=8
IF ERRORLEVEL 9 SET M=9

IF %M%==1 set id=215350
IF %M%==2 set id=222860
IF %M%==3 set id=232250
IF %M%==4 set id=232290
IF %M%==5 set id=232330
IF %M%==6 set id=232370
IF %M%==7 echo https://developer.valvesoftware.com/wiki/SteamCMD
IF %M%==7 pause> nul
IF %M%==7 GOTO menu
IF %M%==8 GOTO menu
IF %M%==9 GOTO EOF 
GOTO options

:options
cls
echo Setting the Username to anonymous and having no password will fix the no subscription error!
set /p user=Username:
set /p pass=Password:
set /p dir=Server Directory ex. C:\SteamCMD\:
set /p extra2=If you need the beta version input -beta, if not leave blank:
IF %id%==90 goto extra1

:extra1
echo 1. HLDS for Half-Life and Counter-Strike
echo 2. Counter-Strike: Condition Zero dedicated server 
echo 3. Deathmatch Classic dedicated server
echo 4. Day of Defeat dedicated server 
echo 5. Half-Life: Opposing Force dedicated server
echo 6. Ricochet dedicated server 
echo 7. Team Fortress Classic  dedicated server 
CHOICE /C:1234567 /N
IF ERRORLEVEL 1 SET M=1
IF ERRORLEVEL 2 SET M=2
IF ERRORLEVEL 3 SET M=3
IF ERRORLEVEL 4 SET M=4
IF ERRORLEVEL 5 SET M=5
IF ERRORLEVEL 6 SET M=6
IF ERRORLEVEL 7 SET M=7

IF %M%==1 set extra=
IF %M%==2 set extra=+app_set_config 90 mod czero
IF %M%==3 set extra=+app_set_config 90 mod dmc
IF %M%==4 set extra=+app_set_config 90 mod dod
IF %M%==5 set extra=+app_set_config 90 mod gearbox
IF %M%==6 set extra=+app_set_config 90 mod ricochet
IF %M%==7 set extra=+app_set_config 90 mod tfc

:restart
cls
echo (%date%)(%time%) SteamCMD is now Running...
>> "sgoSteamCMDDl.log" echo (%date%)(%time%) SteamCMD is now Running...
msg %USERNAME% /SERVER:%computername% (%date%)(%time%) SteamCMD is now Running...

start /wait steamcmd +login %user% %pass% +force_install_dir %dir%%id%Server\ +app_update %id% %extra% %extra2% validate
echo (%date%) (%time%) WARNING: SteamCMD has closed or crashed!
msg %USERNAME% /SERVER:%computername% (%date%) (%time%) WARNING: SteamCMD has closed or crashed!
echo (%date%) (%time%) Hit enter to restart SteamCMD!
pause> nul
>> "sgoSteamCMDDl.log" echo (%date%)(%time%) SteamCMD has closed or crashed!
>> "sgoSteamCMDDl.log" echo (%date%)(%time%) SteamCMD is now restarting...
GOTO restart
Here is the code for the Server Runner
**Use at your own risk as I have no idea whether it works with all the servers listed
Code:
@echo off
title sgosiaco's Universal Server Runner

:menu
cls
Echo                          Universal Server Runner
Echo  ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
Echo  º                                                                            º
Echo  º 1 Counter-Strike: Condition Zero dedicated server                          º
Echo  º                                                                            º
Echo  º 2 Left 4 Dead 2 dedicated server                                           º
Echo  º                                                                            º
Echo  º 3 Deathmatch Classic dedicated server                                      º
Echo  º                                                                            º
Echo  º 4 Day of Defeat dedicated server                                           º
Echo  º                                                                            º
Echo  º 5 Half-Life: Opposing Force dedicated server                               º
Echo  º                                                                            º
Echo  º 6 Ricochet dedicated server                                                º
Echo  º                                                                            º
Echo  º 7 Team Fortress Classic dedicated server                                   º
Echo  º                                                                            º
Echo  º 8 More options                                                             º
Echo  º                                                                            º
Echo  º 9 Exit the program                                                         º
Echo  º                                                                            º
Echo  ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ
CHOICE /C:123456789 /N
IF ERRORLEVEL 1 SET M=1
IF ERRORLEVEL 2 SET M=2
IF ERRORLEVEL 3 SET M=3
IF ERRORLEVEL 4 SET M=4
IF ERRORLEVEL 5 SET M=5
IF ERRORLEVEL 6 SET M=6
IF ERRORLEVEL 7 SET M=7
IF ERRORLEVEL 8 SET M=8
IF ERRORLEVEL 9 SET M=9

IF %M%==1 set id=czero
IF %M%==2 set id=left4dead2
IF %M%==3 set id=dmc
IF %M%==4 set id=dod
IF %M%==5 set id=gearbox
IF %M%==6 set id=ricochet
IF %M%==7 set id=tfc
IF %M%==8 GOTO menu1
IF %M%==9 GOTO EOF
GOTO options

:menu1
cls
Echo                          Universal Server Runner
Echo  ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
Echo  º                                                                            º
Echo  º 1 Counter-Strike: Global Offensive dedicated server                        º
Echo  º                                                                            º
Echo  º 2 The Ship dedicated server                                                º
Echo  º                                                                            º
Echo  º 3 Garry's Mod dedicated server                                             º
Echo  º                                                                            º
Echo  º 4 Serious Sam 3 dedicated server                                           º
Echo  º                                                                            º
Echo  º 5 Nuclear Dawn dedicated server                                            º
Echo  º                                                                            º
Echo  º 6 Red Orchestra: Ostfront 41-45 dedicated server                           º
Echo  º                                                                            º
Echo  º 7 Red Orchestra 2: Heroes of Stalingrad and Rising Storm dedicated server  º
Echo  º                                                                            º
Echo  º 8 More options                                                             º
Echo  º                                                                            º
Echo  º 9 Exit the program                                                         º
Echo  º                                                                            º
Echo  ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ

CHOICE /C:123456789 /N
IF ERRORLEVEL 1 SET M=1
IF ERRORLEVEL 2 SET M=2
IF ERRORLEVEL 3 SET M=3
IF ERRORLEVEL 4 SET M=4
IF ERRORLEVEL 5 SET M=5
IF ERRORLEVEL 6 SET M=6
IF ERRORLEVEL 7 SET M=7
IF ERRORLEVEL 8 SET M=8
IF ERRORLEVEL 9 SET M=9

IF %M%==1 set id=csgo
IF %M%==2 set id=ship
IF %M%==3 set id=garrysmod
IF %M%==4 set id=SeriousSam3
IF %M%==5 set id=nucleardawn
IF %M%==6 set id=RedOrchestra
IF %M%==7 set id=redorchestra2
IF %M%==8 GOTO menu2
IF %M%==9 GOTO EOF
GOTO options

:menu2
cls
Echo                          Universal Server Runner
Echo  ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
Echo  º                                                                            º
Echo  º 1 Team Fortress 2 dedicated server                                         º
Echo  º                                                                            º
Echo  º 2 Day of Defeat: Source dedicated server                                   º
Echo  º                                                                            º
Echo  º 3 Counter-Strike: Source dedicated server                                  º
Echo  º                                                                            º
Echo  º 4 Half-Life 2: Deathmatch dedicated server                                 º
Echo  º                                                                            º
Echo  º 5 SteamCMD Server Downloader                                               º
Echo  º                                                                            º
Echo  º 6 Help!                                                                    º
Echo  º                                                                            º
Echo  º 7 Startover                                                                º
Echo  º                                                                            º
Echo  º 8 Credits!                                                                 º
Echo  º                                                                            º
Echo  º 9 Exit the program                                                         º
Echo  º                                                                            º
Echo  ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ

CHOICE /C:123456789 /N
IF ERRORLEVEL 1 SET M=1
IF ERRORLEVEL 2 SET M=2
IF ERRORLEVEL 3 SET M=3
IF ERRORLEVEL 4 SET M=4
IF ERRORLEVEL 5 SET M=5
IF ERRORLEVEL 6 SET M=6
IF ERRORLEVEL 7 SET M=7
IF ERRORLEVEL 8 SET M=8
IF ERRORLEVEL 9 SET M=9

IF %M%==1 set id=tf
IF %M%==2 set id=dods
IF %M%==3 set id=cstrike
IF %M%==4 set id=hl2mp
IF %M%==5 set start SteamCDDL.bat
IF %M%==6 echo https://developer.valvesoftware.com/wiki/SteamCMD
IF %M%==6 echo Hit enter to continue...
IF %M%==6 pause> nul
IF %M%==6 GOTO menu
IF %M%==7 GOTO menu
IF %M%==8 GOTO credits
IF %M%==9 GOTO EOF 
GOTO options

:options
cls
echo MAKE SURE YOU HAVE CONFIGURED ALL YOUR .cfg FILES BEFORE CONTINUING
set /p players=Amount of players:
set /p map=Map Name:
echo Make sure the directory you enter contains srcds.exe!
set /p dir=Server Directory ex. C:\GMODDS\:
echo Hit enter to start the server.
pause> nul
GOTO restart

:restart
cls
echo (%date%)(%time%) %id% Server is now Running...
>> "%id%Server.log" echo (%date%)(%time%) %id% Server is now Running...
msg %USERNAME% /SERVER:%computername% (%date%)(%time%) %id% Server is now Running...
%dir%srcds.exe -game %id% +maxplayers %players% +map %map%
echo (%date%) (%time%) WARNING: %id% Server has closed or crashed!
msg %USERNAME% /SERVER:%computername% (%date%) (%time%) WARNING: %id% Server has closed or crashed!
echo (%date%) (%time%) Hit enter to restart %id% Server...
pause> nul
>> "%id%Server.log" echo (%date%)(%time%) %id% Server has closed or crashed!
>> "%id%Server.log" echo (%date%)(%time%) %id% Server is now restarting...
GOTO restart



:credits
echo   ______          __         __   __         
echo  / ____/___  ____/ /__  ____/ /  / /_  __  __
echo / /   / __ \/ __  / _ \/ __  /  / __ \/ / / /
echo/ /___/ /_/ / /_/ /  __/ /_/ /  / /_/ / /_/ / 
echo\____/\____/\__,_/\___/\__,_/  /_.___/\__, /  
echo                                     /____/ 
echo   _________ _____  _____(_)___ __________ 
echo  / ___/ __ `/ __ \/ ___/ / __ `/ ___/ __ \
echo (__  ) /_/ / /_/ (__  ) / /_/ / /__/ /_/ /
echo/____/\__, /\____/____/_/\__,_/\___/\____/ 
echo     /____/   
echo Hit enter to continue...
pause> nul
GOTO menu
The .zip file contains SteamCMDDL.bat which is the downloader. It also contains UniversalServerRunner.bat. It also contains choice.exe for compatibility issues with other windows versions not including the choice command. Any feedback is highly appreciated and please give me credit if you post this to other websites.

Installation
1. Unzip the SteamCMDDL+ServerRunner.zip
2. Copy steamCMD.exe into the unzipped folder containing the 2 .bat files and the 1 .exe (steamCMD.exe is obtained by going to the wiki page. https://developer.valvesoftware.com/wiki/SteamCMD )
3. Double-Click the steamCMD.exe for it to update itself for the first time.
4. Run steamCMDDL.bat to download any server.
5. Run UniversalServerRunner.bat to start the server.

Screenshot

UPDATES
-For the downloader I have added the option to add -beta and have given credit to ckynick254 for the example code in which I have improved upon.
-Removed **Beta** from the titles to be less confusing
-Added pop-ups for important messages

-sgosiaco
Attached Files
File Type: zip SteamCMDDL+ServerRunner.zip (23.4 KB, 92 views)

Last edited by sgosiaco; 06-28-2013 at 01:56. Reason: Updated
sgosiaco is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 17:30.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode