Size: 952
Comment:
|
Size: 4045
Comment:
|
Deletions are marked like this. | Additions are marked like this. |
Line 1: | Line 1: |
This script will echo your troop totals for each city and for your entire account. | This 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. |
Line 3: | Line 4: |
THIS VERSION REQUIRES NEATBOT 3010T OR LATER. <<BR>> For older bots use the script in the second code box below. |
|
Line 4: | Line 7: |
// gets total troops in all cities | // ======================================================= // Troop & Resource Totals For Each City & Entire Account // Originally by romulus // ======================================================= // set this to 1 if you want individual city troopcounts displayed too, 0 if not showcities = 0 |
Line 6: | Line 16: |
echo "TOTAL TROOPS: Found " + mycities.length + " castle(s)" | echo "ACCOUNT TOTALS: Found " + mycities.length + " castle(s)" echo "Please wait. Calculating..." |
Line 8: | Line 19: |
res = GetResources("f:0") pop = 0 popmax = 0 up = 0 |
|
Line 11: | Line 26: |
if c c = c.cityManager if c tr = c.getAvailableTroop() if c echo c.name + " - " + TroopBeanToString(tr, ",") if c dummy = tr.addTo(t) if c goto mainLoop |
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 |
Line 17: | Line 38: |
echo "TOTAL TROOPS:\n" + TroopBeanToString(t, "\n") | 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===========================" |
Line 20: | Line 42: |
This is the same thing, only just the account totals and not individual cities included too. | FOR OLDER NEATBOT VERSIONS: {{{ // ================================================================ // Troop & Resource Totals For Each City & Entire Account // Originally by romulus // ================================================================ |
Line 22: | Line 49: |
{{{ // gets total troops in all cities |
// set this to 1 if you want individual city troopcounts displayed too, 0 if not showcities = 0 |
Line 25: | Line 53: |
echo "TOTAL TROOPS: Found " + mycities.length + " castle(s)" | echo "ACCOUNT TOTALS: Found " + mycities.length + " castle(s)" echo "Please wait. Calculating..." |
Line 27: | Line 56: |
pop = 0 popmax = 0 up = 0 g = 0 f = 0 w = 0 s = 0 i = 0 |
|
Line 30: | Line 67: |
if c c = c.cityManager if c tr = c.getAvailableTroop() if c dummy = tr.addTo(t) if c goto mainLoop |
if !c goto end c = c.cityManager tr = c.getAvailableTroop() popmax = popmax + c.resource.maxPopulation pop = pop + c.resource.curPopulation 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) + ")" dummy = tr.addTo(t) goto mainLoop |
Line 35: | Line 82: |
echo "TOTAL TROOPS:\n" + TroopBeanToString(t, "\n") | label end if up >= 1b up = round(up / 1000000000,2) + "B" if up < 1b up = round(up / 1000000,2) + "M" if g >= 1b g = round(g / 1000000000,2) + "B" if g < 1b g = round(g / 1000000,2) + "M" if f >= 1b f = round(f / 1000000000,2) + "B" if f < 1b f = round(f / 1000000,2) + "M" if w >= 1b w = round(w / 1000000000,2) + "B" if w < 1b w = round(w / 1000000,2) + "M" if s >= 1b s = round(s / 1000000000,2) + "B" if s < 1b s = round(s / 1000000,2) + "M" if i >= 1b i = round(i / 1000000000,2) + "B" if i < 1b i = round(i / 1000000,2) + "M" echo "TOTAL TROOPS:\n" + TroopBeanToString(t, "\n") + "\n*** Upkeep: " + up + " ***" echo "TOTAL RESOURCES:\nGold: " + g + "\nFood: " + f + "\nWood: " + w + "\nStone: " + s + "\nIron: " + i + "\nPopulation: " + floor(pop) + " of " + floor(popmax) |
Line 37: | Line 99: |
---- ScriptExamples |
This script will echo your troop & resource (including population) totals for each city and for your entire account.
Troop upkeep per city and total for account added as well. Note it shows upkeep with vesta, etc. buffs factored in, not unbuffed.
THIS VERSION REQUIRES NEATBOT 3010T OR LATER.
For older bots use the script in the second code box below.
// ======================================================= // Troop & Resource Totals For Each City & Entire Account // Originally by romulus // ======================================================= // set this to 1 if you want individual city troopcounts 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==========================="
FOR OLDER NEATBOT VERSIONS:
// ================================================================ // Troop & Resource Totals For Each City & Entire Account // Originally by romulus // ================================================================ // set this to 1 if you want individual city troopcounts 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") pop = 0 popmax = 0 up = 0 g = 0 f = 0 w = 0 s = 0 i = 0 label mainLoop c = mycities.shift() if !c goto end c = c.cityManager tr = c.getAvailableTroop() popmax = popmax + c.resource.maxPopulation pop = pop + c.resource.curPopulation 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) + ")" dummy = tr.addTo(t) goto mainLoop label end if up >= 1b up = round(up / 1000000000,2) + "B" if up < 1b up = round(up / 1000000,2) + "M" if g >= 1b g = round(g / 1000000000,2) + "B" if g < 1b g = round(g / 1000000,2) + "M" if f >= 1b f = round(f / 1000000000,2) + "B" if f < 1b f = round(f / 1000000,2) + "M" if w >= 1b w = round(w / 1000000000,2) + "B" if w < 1b w = round(w / 1000000,2) + "M" if s >= 1b s = round(s / 1000000000,2) + "B" if s < 1b s = round(s / 1000000,2) + "M" if i >= 1b i = round(i / 1000000000,2) + "B" if i < 1b i = round(i / 1000000,2) + "M" echo "TOTAL TROOPS:\n" + TroopBeanToString(t, "\n") + "\n*** Upkeep: " + up + " ***" echo "TOTAL RESOURCES:\nGold: " + g + "\nFood: " + f + "\nWood: " + w + "\nStone: " + s + "\nIron: " + i + "\nPopulation: " + floor(pop) + " of " + floor(popmax)