# Get Mineral Amount Left

Grammar — Get the total minerals left to be harvested in town town for player player
FlagsNative | Function

Returns the total minerals left to be harvested in a town for a player.

# Arguments

  • int — Player
  • int — Town

Returns — int

native int AIGetMineralAmountLeft(int player, int town);

Category: AI Advanced / Towns / Functions

# Examples

mods/core.sc2modbase.sc2data/TriggerLibs/SharedAI.galaxy:89

//--------------------------------------------------------------------------------------------------
int AIMineralsTotal (int player) {
    return PlayerGetPropertyInt(player, c_playerPropMinerals) + AIGetMineralAmountLeft(player, c_townMax);
}

mods/core.stormmodbase.stormdata/TriggerLibs/SharedAI.galaxy:89

//--------------------------------------------------------------------------------------------------
int AIMineralsTotal (int player) {
    return PlayerGetPropertyInt(player, c_playerPropMinerals) + AIGetMineralAmountLeft(player, c_townMax);
}

mods/liberty.sc2modbase.sc2data/TriggerLibs/Terran/TerranHigh.galaxy:1150

        }

        minLeftInTown = AIGetMineralAmountLeft(player, town);
        if (orbitalIncomplete == 0) {
            if (AIGetBuildingCountInTown(player, town, c_TB_CommandCenter, c_techCountCompleteOnly) > 0) {

mods/liberty.sc2modbase.sc2data/TriggerLibs/Zerg/ZergHigh.galaxy:1088

            continue;
        }
        if (AIGetMineralAmountLeft(player, town) < 1000) {
            continue;
        }

mods/swarm.sc2modbase.sc2data/TriggerLibs/Terran/TerranHigh.galaxy:1141

        }

        minLeftInTown = AIGetMineralAmountLeft(player, town);
        if (orbitalIncomplete == 0) {
            if (AIGetBuildingCountInTown(player, town, c_TB_CommandCenter, c_techCountCompleteOnly) > 0) {

mods/swarm.sc2modbase.sc2data/TriggerLibs/Zerg/ZergHigh.galaxy:1106

            continue;
        }
        if (AIGetMineralAmountLeft(player, town) < 1000) {
            continue;
        }

mods/void.sc2modbase.sc2data/TriggerLibs/Terran/TerranHigh.galaxy:1155

        }

        minLeftInTown = AIGetMineralAmountLeft(player, town);
        if (orbitalIncomplete == 0) {
            if (AIGetBuildingCountInTown(player, town, c_TB_CommandCenter, c_techCountCompleteOnly) > 0) {

mods/void.sc2modbase.sc2data/TriggerLibs/Zerg/ZergHigh.galaxy:1116

            continue;
        }
        if (AIGetMineralAmountLeft(player, town) < 1000) {
            continue;
        }