|
Size: 2611
Comment:
|
Size: 2742
Comment:
|
| Deletions are marked like this. | Additions are marked like this. |
| Line 1: | Line 1: |
| This 1st script will echo your troop totals for your account. The 2nd listed script will echo your troop & resource (including population) totals for each city and for your entire account. <<BR>> Troop upkeep per city and total for account added as well. Note it shows upkeep with vesta, etc. buffs factored in, not unbuffed. |
This script will echo your troop & resource totals for each city and for your entire account. <<BR>> |
| Line 6: | Line 4: |
| For older bots or to include resource totals, use the script in the second code box below. {{{ // ====== Find total troops across all cities ======== |
For older bots, use the script in the second code box below. // ====== Find total troops & resources across all cities ======== |
| Line 10: | Line 8: |
| cities.forEach(CreateFunction("city,ind,arr", "total.add(city.cityManager.getAvailableTroop())")) echo "Total troops in all cities is:\n" + TroopBeanToString(total, "\n") }}} |
cities.forEach(CreateFunction("city,ind,arr","total.add(city.cityManager.getAvailableTroop())")) echo "Total troops in all cities:\n" + TroopBeanToString(total,"\n") // ====== Find total resources across all cities ======== total = GetResources("f:0") cities.forEach(CreateFunction("city,ind,arr", "city.cityManager.estResource.addTo(total)")) echo "Total resources in all cities:\nGold:{FormatNumber(total.gold)}\nFood:{FormatNumber(total.food)}\nWood:{FormatNumber(total.wood)}\nStone:{FormatNumber(total.stone)}\nIron:{FormatNumber(total.iron)}" |
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 ========
total = GetTroops("a:0") cities.forEach(CreateFunction("city,ind,arr","total.add(city.cityManager.getAvailableTroop())")) echo "Total troops in all cities:\n" + TroopBeanToString(total,"\n")
// ====== Find total resources across all cities ======== total = GetResources("f:0") cities.forEach(CreateFunction("city,ind,arr", "city.cityManager.estResource.addTo(total)")) echo "Total resources in all cities:\nGold:{FormatNumber(total.gold)}\nFood:{FormatNumber(total.food)}\nWood:{FormatNumber(total.wood)}\nStone:{FormatNumber(total.stone)}\nIron:{FormatNumber(total.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)
