View unanswered posts | View active topics It is currently Thu Jun 20, 2024 10:37 am

Reply to topic  [ 1 post ] 
Author Message

Joined: Thu Mar 12, 2015 2:50 pm
Posts: 2
Has thanked: 0 time
Been thanked: 0 time
I am wondering if you could either change the start level whenever the server crashes, or use an auto-restart script that selects a random map from a list. It is unfortunate when there are 6 or so players on the server and it goes to toonrun1, almost always everyone leaves because everyone has played it many times. It isn't that bad of a map, it has just been played too many times.
I had created this script a while ago that allows for auto-restart and random map (generated via mapcycle.txt). I am sure there are better scripts or programs out there, but it would be nice to not have to play toonrun1 everytime.
This script was used on an Ubuntu server.



for k in $( cat $steamhldsvalve/svencoop/mapcycle.txt ); do
   k=${k//" "}

cd $steamhldsvalve

libchecker ()
if [ 'uname -m' == 'x86_64' ]

updater ()
echo "($(date +"%T")) ($(date +"%m-%d-%y")) Updating/installing HLDS" >> ./autoscript.log
   $steamcmddir/ +login anonymous +force_install_dir "$steamhldsvalve" +app_update 90 validate +quit
echo "($(date +"%T")) ($(date +"%m-%d-%y")) Update/installation Complete" >> ./autoscript.log

reds ()
b=${a[$RANDOM % ${#a[@]} ]}
echo "($(date +"%T")) ($(date +"%m-%d-%y")) Starting on $b" >> ./autoscript.log
   LD_LIBRARY=$libarchitecture ./hlds_run -game svencoop +map $b +maxplayers 10 +sv_lan 0 -adminsfile=notdeladmins.txt -port 27016 -heapsize 512000 -num_edicts 8192 +sys_ticrate 64 -insecure -norestart
echo "($(date +"%T")) ($(date +"%m-%d-%y")) Crashed $i times, restarting..." >> ./autoscript.log
let "i+=1"


exit $?

The variable "$steamhldsvalve" must point to where hlds_run is, and the variable "$steamcmddir" must point to where is.
Maps that start with "-" do not work correctly in the script, so I have replaced them with other default maps. If you have any custom maps that start with "-", I suggest adding:

Sat Mar 14, 2015 7:28 pm
Display posts from previous:  Sort by  
Reply to topic   [ 1 post ] 

Who is online

Users browsing this forum: No registered users and 9 guests

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group
Designed by ST Software for PTF.
[ Time : 0.292s | 17 Queries | GZIP : On ]