# Get Mineral Amount Left
Grammar — Get the total minerals left to be harvested in town town for player player
Flags —Native
|Function
Returns the total minerals left to be harvested in a town for a player.
# Arguments
int
— Playerint
— Town
Returns — int
native int AIGetMineralAmountLeft(int player, int town);
# Related
Category: AI Advanced / Towns / Functions
- Get Town State —
int
— AIGetTownState - Get Town Location —
point
— AIGetTownLocation - Get Closest Town —
int
— AIGetClosestTown - Get Next Unused Town Slot —
int
— AIGetNextUnusedTownSlot - Get Building Count In Town —
int
— AIGetBuildingCountInTown - Is Town Harvesting —
bool
— AIIsTownHarvestRunning - Get Current Harvest Peon Count —
int
— AIGetCurPeonCount - Get Min Desired Harvest Peon Count —
int
— AIGetMinPeonCount - Get Max Desired Harvest Peon Count —
int
— AIGetMaxPeonCount - Get Mineral Amount Left —
int
— AIGetMineralAmountLeft - Get Gas Amount Left —
int
— AIGetGasAmountLeft - Get Num Mineral Spots —
int
— AIGetMineralNumSpots - Get Num RawGas Spots —
int
— AIGetRawGasNumSpots - Get Offense Gather Location —
point
— AIGetGatherLocation - Get Defense Gather Location —
point
— AIGetGatherDefLocation - Expand —
int
— AIExpand - Get Town Threats —
unitgroup
— AIGetTownThreats
# Examples
mods/core.sc2mod — base.sc2data/TriggerLibs/SharedAI.galaxy:89
//--------------------------------------------------------------------------------------------------
int AIMineralsTotal (int player) {
return PlayerGetPropertyInt(player, c_playerPropMinerals) + AIGetMineralAmountLeft(player, c_townMax);
}
mods/core.stormmod — base.stormdata/TriggerLibs/SharedAI.galaxy:89
//--------------------------------------------------------------------------------------------------
int AIMineralsTotal (int player) {
return PlayerGetPropertyInt(player, c_playerPropMinerals) + AIGetMineralAmountLeft(player, c_townMax);
}
mods/liberty.sc2mod — base.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.sc2mod — base.sc2data/TriggerLibs/Zerg/ZergHigh.galaxy:1088
continue;
}
if (AIGetMineralAmountLeft(player, town) < 1000) {
continue;
}
mods/swarm.sc2mod — base.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.sc2mod — base.sc2data/TriggerLibs/Zerg/ZergHigh.galaxy:1106
continue;
}
if (AIGetMineralAmountLeft(player, town) < 1000) {
continue;
}
mods/void.sc2mod — base.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.sc2mod — base.sc2data/TriggerLibs/Zerg/ZergHigh.galaxy:1116
continue;
}
if (AIGetMineralAmountLeft(player, town) < 1000) {
continue;
}