Random Mod/Map Starter Batch

Stapo

Modding Veteran
hello everyone, as you saw before i had a server that automatically switched to a random map every restart, todo this i wrote a simple batch file which starts a random map that i listed...

Here is a template for the batch i made:

@echo off
goto Random_Number

:Random_Number
set /a number=%random% %% 3 + 1
if "%number%"=="1" goto DAYZMOD1
if "%number%"=="2" goto DAYZMOD2
if "%number%"=="3" goto DAYZMOD3
exit

:DAYZMOD1
set MODNAME=DayZMOD1
echo %DATE% - SERVER START (%TIME%) WITH MOD^: %MODNAME% >> Random_Map_Log.txt
Resources\mysql.exe --user=root --password=PASSWORD --host=127.0.0.1 --port=3306 --database=DAYZMOD1DATABASE --execute="call pMain()"
start .\Expansion\beta\arma2oaserver.exe -port=2302 -mod=@DAYZMOD1;@SERVER_DAYZMOD1 -name=DayZ -config=Config_DAYZMOD1\ServerSettings.cfg -cfg=Config_DAYZMOD1\Arma2Config.cfg -profiles=Config_DAYZMOD1
exit

:DAYZMOD2
set MODNAME=DayZMOD2
echo %DATE% - SERVER START (%TIME%) WITH MOD^: %MODNAME% >> Random_Map_Log.txt
Resources\mysql.exe --user=root --password=PASSWORD --host=127.0.0.1 --port=3306 --database=DAYZMOD2DATABASE --execute="call pMain()"
start .\Expansion\beta\arma2oaserver.exe -port=2302 -mod=@DAYZMOD2;@SERVER_DAYZMOD2 -name=DayZ -config=Config_DAYZMOD2\ServerSettings.cfg -cfg=Config_DAYZMOD2\Arma2Config.cfg -profiles=Config_DAYZMOD2
exit

:DAYZMOD3
set MODNAME=DayZMOD3
echo %DATE% - SERVER START (%TIME%) WITH MOD^: %MODNAME% >> Random_Map_Log.txt
Resources\mysql.exe --user=root --password=PASSWORD --host=127.0.0.1 --port=3306 --database=DAYZMOD3DATABASE --execute="call pMain()"
start .\Expansion\beta\arma2oaserver.exe -port=2302 -mod=@DAYZMOD3;@SERVER_DAYZMOD3 -name=DayZ -config=Config_DAYZMOD3\ServerSettings.cfg -cfg=Config_DAYZMOD3\Arma2Config.cfg -profiles=Config_DAYZMOD3
exit
I WILL NOT BE HELPING ANYONE SET THIS UP, but i will give a few pointers in this post:

set /a number=%random% %% 3 + 1
3 + 1 is the max and min num, so basically if you want 345 mods in the random cycle you would put 345 + 1

and lastly, if you wish to have your server auto restart with BEC, you must have ONE battleye directory where all your filters etc.. go so you will have to merge some filters to fix unwanted Kicks. then you need to Add this:
-BEPath=C:/something/something/Battleye
to the start up parameter for each map in the Batch file.

Enjoy! :)
 
Top