TacoServer/Classic/scripts/autoexec/multipleMapRotation.cs
ChocoTaco 2b4a114b39 Improved
Fixed situation where there is no progression number
2022-02-11 13:39:42 -05:00

39 lines
896 B
C#

//$Host::ClassicRotationFile = "prefs/mapRotation1.cs";
//Enable/Disable
$EnableMultipleMapRotation = 0;
//How any mapRotation Files
//Naming scheme mapRotation1.cs, mapRotation2.cs, mapRotation3.cs, etc
$mapRotationFilesCount = 3;
function multipleMapRotation()
{
//Look for a progressing number
%var = stripChars($Host::ClassicRotationFile, "prefs/mapRotation.cs");
//echo("var: " @ %var);
if(%var) //If number exists proceed
{
if(%var $= $mapRotationFilesCount)
%var = 1;
else
%var = %var + 1;
%mapRot = "prefs/mapRotation" @ %var @ ".cs";
$Host::ClassicRotationFile = %mapRot;
}
schedule(10000,0,"multipleMapRotationEcho",0); //Echo at start
}
//Echo
function multipleMapRotationEcho()
{
echo("Current MapRotation: " @ $Host::ClassicRotationFile);
}
//Run
if($EnableMultipleMapRotation)
multipleMapRotation();