Sample mel script
// Made by Yohan Kim 1/2/2016
global proc int IsInfantry(string $characterName)
{
return $characterName == "apinfantry" || $characterName == "flamethrower";
}
global proc int IsFlamethrower(string $characterName)
{
return ($UnitName_A2F == "apinfantry" || $UnitName_A2F == "missileinfantry" || $UnitName_A2F == "sniper" || $UnitName_A2F == "tankkiller");
}
global proc int IsMagPulse(string $characterName)
{
return ($UnitName_A2F == "blackwatch" || $UnitName_A2F == "hastatussniper" || $UnitName_A2F == "hivegunner" || $UnitName_A2F == "isomerranger" || $UnitName_A2F == "shocktrooper" || $UnitName_A2F == "sonicravager");
}
global proc int IsMiniGunner(string $characterName)
{
return ($UnitName_A2F == "assaultinfantry" || $UnitName_A2F == "attrooper" || $UnitName_A2F == "grenadier" || $UnitName_A2F == "ranger");
}
global proc int IsSwarmTrooper(string $characterName)
{
return $UnitName_A2F == "distruptor" || $UnitName_A2F == "aircleaner" || $UnitName_A2F == "blastcannoner" || $UnitName_A2F == "disruptorranger" || $UnitName_A2F == "flechetteinfantry" || $UnitName_A2F == "greenwavesniper" || $UnitName_A2F == "impactenforcer" || $UnitName_A2F == "railgunsniper" || $UnitName_A2F == "hivegunner" || $UnitName_A2F == "cloudshredder" || $UnitName_A2F == "infernotrooper" );
}
proc characterName()
{
if (IsFlamethrower(UnitName_A2F))
{
$Group_Infantry_for_path = $flamethrower_Name;
}
else if (IsMagPulse(UnitName_A2F))
{
$Group_Infantry_for_path = $magpulseranger_Name;
}
else if (IsMiniGunner(UnitName_A2F))
{
$Group_Infantry_for_path = $minigunner_Name;
}
else if (IsSwarmTrooper(UnitName_A2F))
{
$Group_Infantry_for_path = $swarmtrooper_Name;
}
else
{
$Group_Infantry_for_path = $UnitName_A2F;
}
}