TechKnow

Author Topic: [BAT] Counter Strike Source (CSS) Settie Launcher  (Read 3623 times)

0 Members and 1 Guest are viewing this topic.

Offline HcH

  • TechKnow Owner, Ethical Hacker
  • Administrator
  • Uber Member
  • *****
  • Posts: 9936
  • Karma: +2284/-111
[BAT] Counter Strike Source (CSS) Settie Launcher
« on: November 22, 2011, 10:50:26 PM »

Hi there!

So I wanted to have my own dedicated CSS server here at home so I can play CSS with friends on the LAN here. As I've ripped/modded CS1.6 I wanted to mod my own CSS... but there is this great version out there from Setti, who has done an amazing job making CSS playable easy at a LAN. There's no point in trying to achieve what he already has done nicely. But I missed an easy way to mod my Playername, start a dedicated server with a certain map, control the bots.

Installation:

1. copy the code section to a new text file
2. save new text file as a .BAT file
3. place .BAT (if not already) in the folder of CSS root dir
4. copy rev.ini to PLAYERNAME.dat, open PLAYERNAME.dat and make sure PlayerName=CSS_Player, save the file
5. doube click the .BAT file
6. follow on screen instruction

Code: [Select]
REM Lame script done by HcH, just to make hosting lamerproof
:bof

echo off
color 0a
cls

find "PlayerName=" < "%CD%\rev.ini" > "%CD%\playername.txt"
set /p CPN=<playername.txt
del /f playername.txt

cd cstrike
cd cfg
find /C "bot_add_ct" server.cfg>botsCT.txt
find /C "bot_add_t" server.cfg>botsT.txt
move botsCT.txt ../../
move botsT.txt ../../
cd..
cd..

set InputFile=botsCT.txt
set OutputFile=botsCTS.txt
if exist "%OutputFile%" del "%OutputFile%"
for /f "skip=1 delims=" %%a in ('type "%InputFile%"') do >>"%OutputFile%" echo %%a

set InputFile=botsT.txt
set OutputFile=botsTS.txt
if exist "%OutputFile%" del "%OutputFile%"
for /f "skip=1 delims=" %%a in ('type "%InputFile%"') do >>"%OutputFile%" echo %%a

set /p csbotsCT=<botsCTS.txt
set /p csbotsT=<botsTS.txt

del /f botsCT.txt
del /f botsCTS.txt
del /f botsT.txt
del /f botsTS.txt
echo  #                             ####  ####  ####   Source                      #
echo  ## ##   ## ###### ##   ##    ##    ##    ##      Server      ...     v1.0   ##
echo  ## ####### ##     #######    ##     ###   ###    Launcher       `.          ##
echo  ## ##   ## ###### ##   ##    ##       ##    ##                 ,' `.        ##
echo  ##                            #### ####  ####                ,'     `.'     ##
echo  ## Choose a number for a CS map:       ## Change bots:                      ##
echo  ##                                     ##                                   ##
echo  ## 1 = cs_assault    10 = de_dust      ## bact = bot add counter terrorist  ##
echo  ## 2 = cs_compound   11 = de_dust2     ## bat  = bot add terrorist          ##
echo  ## 3 = cs_havana     12 = de_inferno   ## bdct = bot del all CT             ##
echo  ## 4 = cs_italy      13 = de_nuke      ## bdt  = bot del all terrorist      ##
echo  ## 5 = cs_militia    14 = de_piranesi  ##                                   ##
echo  ## 6 = cs_office     15 = de_port      ## Player options:                   ##
echo  ## 7 = de_aztec      16 = de_prodigy   ##                                   ##
echo  ## 8 = de_cbble      17 = de_tides     ## pn   = change playername          ##
echo  ## 9 = de_chateau    18 = de_train     ##                                   ##
echo   ############################################################################
echo  ## Current bot config=CounterTerrorists: %csbotsCT:~23% Terrorists: %csbotsT:~23%
echo  #  Current %CPN%                 
echo  #
set /p csmap= ## Option number (q or x to exit) :
IF /i "%csmap%"=="" goto BOF
IF /i "%csmap%"=="1" set csmap=cs_assault
IF /i "%csmap%"=="2" set csmap=cs_compound
IF /i "%csmap%"=="3" set csmap=cs_havana
IF /i "%csmap%"=="4" set csmap=cs_italy
IF /i "%csmap%"=="5" set csmap=cs_militia
IF /i "%csmap%"=="6" set csmap=cs_office
IF /i "%csmap%"=="7" set csmap=de_aztec
IF /i "%csmap%"=="8" set csmap=de_cbble
IF /i "%csmap%"=="9" set csmap=de_chateau
IF /i "%csmap%"=="10" set csmap=de_dust
IF /i "%csmap%"=="11" set csmap=de_dust2
IF /i "%csmap%"=="12" set csmap=de_inferno
IF /i "%csmap%"=="13" set csmap=de_nuke
IF /i "%csmap%"=="14" set csmap=de_piranesi
IF /i "%csmap%"=="15" set csmap=de_port
IF /i "%csmap%"=="16" set csmap=de_prodigy
IF /i "%csmap%"=="17" set csmap=de_tides
IF /i "%csmap%"=="18" set csmap=de_train
IF /i "%csmap%"=="bact" GOTO bact
IF /i "%csmap%"=="bdct" GOTO bdct
IF /i "%csmap%"=="bat" GOTO bat
IF /i "%csmap%"=="bdt" GOTO bdt
IF /i "%csmap%"=="pn" GOTO pn
IF /i "%csmap%"=="q" GOTO EOF
IF /i "%csmap%"=="x" GOTO EOF
IF /i "%csmap%"=="quit" GOTO EOF
IF /i "%csmap%"=="exit" GOTO EOF
IF /i "%csmap%"=="bye" GOTO EOF
cls
echo.
echo Are you sure you want to launch %CSMAP% ?
echo.
echo Press any key to continue or CTRL+C to break.
echo.
pause
echo.
echo Protecting srcds from crashes...
echo If you want to close srcds and this script:
echo Close the srcds window and type Y followed by Enter.
title CSS Watchdog

:srcds
echo.
echo (%time%) srcds started.
reg add "HKCU\Software\Valve\Steam\ActiveProcess" /v SteamClientDll /t REG_SZ /d "" /f
reg add "HKCU\Software\Wow6432Node\Valve\Steam\ActiveProcess" /v SteamClientDll /t REG_SZ /d "" /f
start /wait srcds.exe -nocrashdialog -console -game cstrike +map %CSMAP% +maxplayers 24 -port 27015
echo (%time%) WARNING: srcds closed or crashed, restarting.
goto srcds

:helpPN
cls
color 0a
cls
echo.
echo                     ###     ###  ########  ##      ########
echo                     ###     ###  ###       ##      ##    ##
echo                     ###########  ######    ##      ########
echo                     ###     ###  ###       ##      ##
echo                     ###     ###  ########  ####### ##   
echo.
echo                     #######################################
echo                     ##  Change CSS player name 4 lamers  ##
echo                     #######################################
echo                     ## Enter your player name then press ##
echo                     ## the enter button on your keyboard ##
echo                     ## Djeez, that you need help for     ##
echo                     ## this simple tool, you're a lamer! ##
echo                     #######################################
echo                                                    HcH 2o11
echo.
pause
goto bof

:bact
echo bot_add_ct>>"%CD%\cstrike\cfg\server.cfg"
goto bof

:bdct
find /v "bot_add_ct" < "%CD%\cstrike\cfg\server.cfg" > "%CD%\cstrike\cfg\server2.cfg"
if exist "%CD%\cstrike\cfg\server.org" del "%CD%\cstrike\cfg\server.org"
ren "%CD%\cstrike\cfg\server.cfg" server.org
ren "%CD%\cstrike\cfg\server2.cfg" server.cfg
goto bof

:bat
echo bot_add_t>>"%CD%\cstrike\cfg\server.cfg"
goto bof

:bdt
find /v "bot_add_t" < "%CD%\cstrike\cfg\server.cfg" > "%CD%\cstrike\cfg\server2.cfg"
if exist "%CD%\cstrike\cfg\server.org" del "%CD%\cstrike\cfg\server.org"
ren "%CD%\cstrike\cfg\server.cfg" server.org
ren "%CD%\cstrike\cfg\server2.cfg" server.cfg
goto bof

:eof
exit /b

:PN
color 0a
cls
if exist rev2.ini del rev2.ini
if exist rev.ini del rev.ini&&copy PLAYERNAME.dat rev2.ini
copy PLAYERNAME.dat rev2.ini
cls
echo.
echo CSS Player name changer for lamers by HcH 2o11
echo.
echo enter ? / help or nothing for help
echo enter q / x / quit / exit to exit
echo.
set /p langx= Set your CSS player name:
IF /i "%langx%"=="" goto HELPPN
IF /i "%langx%"=="?" goto HELPPN
IF /i "%langx%"=="help" goto HELPPN
IF /i "%langx%"=="q" goto EOF
IF /i "%langx%"=="x" goto EOF
IF /i "%langx%"=="quit" goto EOF
IF /i "%langx%"=="exit" goto EOF

setlocal enabledelayedexpansion

set findthis=PlayerName=CSS_Player
set replacewith=PlayerName=%langx%
rem set findthis2=
rem set replacewith2=


for /f "tokens=* delims=" %%a in (rev2.ini) do (

   set write=%%a
   if "%%a"=="%findthis%" set write=%replacewith%
rem   if "%%a"=="%findthis2%" set write=%replacewith2%
   echo !write!
   (echo !write!)>>rev.ini
)
goto bof

This easy lame code is a great way to make playing CSS lamerproof (as has been tested and approved by some serious lamers)
« Last Edit: February 20, 2012, 12:40:00 PM by HardcoreHacker »