TacoServer/Classic/scripts/autoexec/multipleMapRotation.cs

39 lines
896 B
C#
Raw Normal View History

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