@echo off ::@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ :: ::This Batchfile can be used to run CircleMUD over and over again ::(i.e., have it automatically reboot if it crashes). ::It will run the game, and copy some ::of the more useful information from the system logs to the 'log' directory ::for safe keeping. :: ::You can control the operation of this script by creating and deleting files ::in Circle's root directory, either manually or by using the 'shutdown' ::command from within the MUD. :: ::Creating a file called .fastboot makes the script wait only 5 seconds ::between reboot attempts instead of the usual 60. If you want a quick ::reboot, use the "shutdown reboot" command from within the MUD. :: ::Creating a file called .killscript makes the script terminate (i.e., stop ::rebooting the MUD). If you want to shut down the MUD and make it stay ::shut down, use the "shutdown die" command from within the MUD. :: ::Finally, if a file called pause exists, the script will not reboot the MUD ::again until pause is removed. This is useful if you want to turn the MUD ::off for a couple of minutes and then bring it back up without killing the ::script. Type "shutdown pause" from within the MUD to activate this feature. :: ::The port on which to run the MUD set PORT=7777 ::Default flags to pass to the MUD server (see admin.txt for a desc of all flags). set FLAGS = -q :: ::@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ :: if not exist .\circle.exe goto DIRFAIL ::Final check for existing system logs if exist .\log\syslog del .\log\syslog :WHILE ::Nifty little set of batch files that creates a DATE variable that can then ::be passed to the files-SB echo.|date|find /i "current" >cu##ent.bat echo set date=%%4 >current.bat call cu##ent.bat del cu??ent.bat > nul :: Done setting the date, on with life echo. echo. echo Starting CircleMud. echo. echo Autorun starting game %DATE% >> .\log\syslog echo Running Circle.exe %FLAGS% %PORT% >> .\log\syslog circle.exe %FLAGS% %PORT% >> log\syslog if exist .killscript goto KILLSCRIPT if exist pause goto PAUSE if exist .fastboot goto FASTBOOT if not exist .fastboot goto SLOWBOOT :KILLSCRIPT :: kill the DATE variable and reset it :: (could be days later that you rebooted/killed the mud) set DATE = echo.|date|find /i "current" >cu##ent.bat echo set date=%%4 >current.bat call cu##ent.bat del cu??ent.bat > nul echo Autoscript killed %DATE% >> .\log\syslog del .killscript > NUL goto :EXIT :PAUSE pause del .\pause > NUL goto WHILE :FASTBOOT choice /n /cą-1234567890qwertyuiopasdfghjklzxcvbnm /tą,5 > nul if not errorlevel 1 echo You hit a key and aborted the timeout! del .\.fastboot > NUL goto WHILE :SLOWBOOT choice /n /cą-1234567890qwertyuiopasdfghjklzxcvbnm /tą,60 > nul if not errorlevel 1 echo You hit a key and aborted the timeout! goto WHILE :DIRFAIL cls echo. echo. echo. echo. echo Please run this batch file from the Muds root directory. goto END :EXIT find "self-delete" .\log\syslog >> .\log\delete.log find "death trap" .\log\syslog >> .\log\dts.log find "killed" .\log\syslog >> .\log\rip.log find "Running" .\log\syslog >> .\log\restarts.log find "advanced" .\log\syslog >> .\log\levels.log find "equipment lost" .\log\syslog >> .\log\rentgone.log find "usage" .\log\syslog >> .\log\usage.log find "new player" .\log\syslog >> .\log\newplayers.log find "SYSERR" .\log\syslog >> .\log\errors.log find "(GC)" .\log\syslog >> .\log\godcmds.log find "Bad PW" .\log\syslog >> .\log\badpws.log del log\syslog.1 > NUL if exist .\log\syslog.2 copy .\log\syslog.2 .\log\syslog.1 > NUL if exist .\log\syslog.3 copy .\log\syslog.3 .\log\syslog.2 > NUL if exist .\log\syslog.4 copy .\log\syslog.4 .\log\syslog.3 > NUL if exist .\log\syslog.5 copy .\log\syslog.5 .\log\syslog.4 > NUL if exist .\log\syslog.6 copy .\log\syslog.6 .\log\syslog.5 > NUL if exist .\log\syslog copy .\log\syslog .\log\syslog.6 > NUL del .\log\syslog > NUL set PORT = set FLAGS = set DATE = cls :END echo. echo. echo.echo Autorun Batch file ended... @echo on