|
Size: 1748
Comment:
|
Size: 2691
Comment:
|
| Deletions are marked like this. | Additions are marked like this. |
| Line 1: | Line 1: |
| ## page was renamed from TroopTotals | |
| Line 3: | Line 2: |
| Troop upkeep per city and total for account added as well. Note it shows upkeep with vesta, etc. buffs factored in, not unbuffed. | |
| Line 5: | Line 3: |
| '''THIS VERSION REQUIRES NEATBOT 3145T OR LATER.''' <<BR>> For older bots, use the script in the second code box below. {{{ // ====== Find total troops & resources across all cities ======== // by romulus troops = GetTroops("a:0") res = GetResources("f:0") cities.forEach(CreateFunction("city,ind,arr","troops.add(city.cityManager.getAvailableTroop())")) cities.forEach(CreateFunction("city,ind,arr", "city.cityManager.estResource.addTo(res)")) echo "Total troops in all cities:\n{TroopBeanToString(troops,"\n")}\n\nTotal resources in all cities:\nGold:{FormatNumber(res.gold)}\nFood:{FormatNumber(res.food)}\nWood:{FormatNumber(res.wood)}\nStone:{FormatNumber(res.stone)}\nIron:{FormatNumber(res.iron)}" }}} <<BR>><<BR>> FOR OLDER NEATBOT VERSIONS: <<BR>><<BR>> |
|
| Line 9: | Line 24: |
| // Inny bloated it with the resource stuff :P | // Requires NeatBot 3010 or later |
| Line 12: | Line 27: |
| // set this to 1 if you want individual city troopcounts displayed too, 0 if not | // set this to 1 if you want individual city troop/res counts displayed too, 0 if not |
| Line 19: | Line 34: |
| res = GetResources("f:0") | |
| Line 22: | Line 38: |
| g = 0 f = 0 w = 0 s = 0 i = 0 |
|
| Line 33: | Line 44: |
| up = up + c.resource.troopCostFood cres = c.resetEstResource() |
|
| Line 35: | Line 48: |
| up = up + c.resource.troopCostFood g = g + c.resource.gold f = f + c.resource.food.amount w = w + c.resource.wood.amount s = s + c.resource.stone.amount i = i + c.resource.iron.amount if showcities echo c.name + " - " + TroopBeanToString(tr, ",") + " (Upkeep: " + floor(c.resource.troopCostFood) + ")" |
if showcities echo "City " + c.name + " - " + TroopBeanToString(tr, ",") + " (Upkeep: " + FormatNumber(c.resource.troopCostFood) + ")\nGold: " + FormatNumber(cres.gold) + " Food: " + FormatNumber(cres.food) + " Wood: " + FormatNumber(cres.wood) + " Stone: " + FormatNumber(cres.stone) + " Iron: " + FormatNumber(cres.iron) + " Population: " + floor(pop) + " of " + floor(popmax) |
| Line 43: | Line 50: |
| dummy = cres.addTo(res) | |
| Line 46: | Line 54: |
| echo "TOTAL TROOPS:\n" + TroopBeanToString(t, "\n") echo "TOTAL RESOURCES:\nTotal Gold: " + floor(g) + "\nTotal Food: " + floor(f) + "\nTotal Wood: " + floor(w) + "\nTotal Stone: " + floor(s) + "\nTotal Iron: " + floor(i) echo "TOTAL UPKEEP: " + floor(up) echo "TOTAL POPULATION: " + floor(pop) + " of " + floor(popmax) + "." |
echo "===========================\nTOTAL TROOPS\n===========================\n" + TroopBeanToString(t, "\n") + "\n(Upkeep: " + FormatNumber(up) + ")\n===========================\nTOTAL RESOURCES\n===========================\nGold: " + FormatNumber(res.gold) + "\nFood: " + FormatNumber(res.food) + "\nWood: " + FormatNumber(res.wood) + "\nStone: " + FormatNumber(res.stone) + "\nIron: " + FormatNumber(res.iron) + "\n(Pop: " + FormatNumber(pop) + " of " + FormatNumber(popmax) + ")\n===========================" |
This script will echo your troop & resource totals for each city and for your entire account.
THIS VERSION REQUIRES NEATBOT 3145T OR LATER.
For older bots, use the script in the second code box below.
// ====== Find total troops & resources across all cities ========
// by romulus
troops = GetTroops("a:0")
res = GetResources("f:0")
cities.forEach(CreateFunction("city,ind,arr","troops.add(city.cityManager.getAvailableTroop())"))
cities.forEach(CreateFunction("city,ind,arr", "city.cityManager.estResource.addTo(res)"))
echo "Total troops in all cities:\n{TroopBeanToString(troops,"\n")}\n\nTotal resources in all cities:\nGold:{FormatNumber(res.gold)}\nFood:{FormatNumber(res.food)}\nWood:{FormatNumber(res.wood)}\nStone:{FormatNumber(res.stone)}\nIron:{FormatNumber(res.iron)}"
FOR OLDER NEATBOT VERSIONS:
// =======================================================
// Troop & Resource Totals For Each City & Entire Account
// Originally by romulus
// Requires NeatBot 3010 or later
// =======================================================
// set this to 1 if you want individual city troop/res counts displayed too, 0 if not
showcities = 0
mycities = cities.concat()
echo "ACCOUNT TOTALS: Found " + mycities.length + " castle(s)"
echo "Please wait. Calculating..."
t = GetTroops("a:0")
res = GetResources("f:0")
pop = 0
popmax = 0
up = 0
label mainLoop
c = mycities.shift()
if !c goto end
c = c.cityManager
tr = c.getAvailableTroop()
up = up + c.resource.troopCostFood
cres = c.resetEstResource()
popmax = popmax + c.resource.maxPopulation
pop = pop + c.resource.curPopulation
if showcities echo "City " + c.name + " - " + TroopBeanToString(tr, ",") + " (Upkeep: " + FormatNumber(c.resource.troopCostFood) + ")\nGold: " + FormatNumber(cres.gold) + " Food: " + FormatNumber(cres.food) + " Wood: " + FormatNumber(cres.wood) + " Stone: " + FormatNumber(cres.stone) + " Iron: " + FormatNumber(cres.iron) + " Population: " + floor(pop) + " of " + floor(popmax)
dummy = tr.addTo(t)
dummy = cres.addTo(res)
goto mainLoop
label end
echo "===========================\nTOTAL TROOPS\n===========================\n" + TroopBeanToString(t, "\n") + "\n(Upkeep: " + FormatNumber(up) + ")\n===========================\nTOTAL RESOURCES\n===========================\nGold: " + FormatNumber(res.gold) + "\nFood: " + FormatNumber(res.food) + "\nWood: " + FormatNumber(res.wood) + "\nStone: " + FormatNumber(res.stone) + "\nIron: " + FormatNumber(res.iron) + "\n(Pop: " + FormatNumber(pop) + " of " + FormatNumber(popmax) + ")\n==========================="
![[+]](/moin_static/explorer/img/toggle1.png)

![[-]](/moin_static/explorer/img/toggle0.png)
