This wiki was in read-only mode for many years, but can now be edited again. A lot of information will need to be updated.

Rotating Maps: Difference between revisions

From BZFlagWiki
Jump to navigation Jump to search
Brad (talk | contribs)
add a space
Brad (talk | contribs)
add linux script
Line 7: Line 7:


You will probably need to edit the paths to the bzfs binary and your configuration files.
You will probably need to edit the paths to the bzfs binary and your configuration files.
You should have all your config files in the same directory as you specified in the script.




Line 30: Line 32:
   
   
  GOTO loop_top
  GOTO loop_top
== Linux ==
Put seperate config files for each map into a folder and direct CONFIGPATH to it or enter the path on the commandline.
b=0
if [ $1 ]; then
    CONFIGPATH=$1 
else
    CONFIGPATH="/your/path/to/configfiles"
fi
until [ $b -lt 0 ]; do
    cd $CONFIGPATH
    ls -1 > /tmp/confnos
   
    LIMIT=$(awk 'END { print NR }' /tmp/confnos)
    for (( a=1; a <= LIMIT ; a++ ))
    do
      COM="NR=="$a
      FILE=$(awk $COM /tmp/confnos)
      FILE="$CONFIGPATH/$FILE"
      bzfs -conf $FILE
    done
done

Revision as of 00:14, 20 February 2007

Windows

All paths should be in 8.3 notation e.g. progra~1 not program files

Don't forget to add -g and -time <secs> to your config files.

Press CTRL-C twice and "y" to answer "Terminate Batch Job (y/n)?" to exit.

You will probably need to edit the paths to the bzfs binary and your configuration files.

You should have all your config files in the same directory as you specified in the script.


@ECHO OFF

BREAK ON

SET BZFSPATH=c:\progra~1\bzflag~1.2\bzfs.exe

IF "%1" == "" SET CONFDIR=c:\your\path\to\conf\files

IF NOT "%1" == "" SET CONFDIR=%1


:loop_top

ECHO.

FOR %%b IN (%CONFDIR%\*.conf) DO %BZFSPATH% -conf %%b

ECHO "Reached end of rotation, starting over.


GOTO loop_top


Linux

Put seperate config files for each map into a folder and direct CONFIGPATH to it or enter the path on the commandline.

b=0
if [ $1 ]; then
   CONFIGPATH=$1   
else
   CONFIGPATH="/your/path/to/configfiles"
fi

until [ $b -lt 0 ]; do
   cd $CONFIGPATH
   ls -1 > /tmp/confnos
   
   LIMIT=$(awk 'END { print NR }' /tmp/confnos)

   for (( a=1; a <= LIMIT ; a++ ))
   do
      COM="NR=="$a
      FILE=$(awk $COM /tmp/confnos)
      FILE="$CONFIGPATH/$FILE"
      bzfs -conf $FILE
   done
done