• My Pages
  • Comments
  • Add Link
  • Subscribe
  • Subscribe User
  • Edit (GUI)
  • Edit (Text)
  • Rename Page
  • Copy Page
  • Load Page
  • Save Page
  • Delete Page
  • Attachments
  • Check Spelling
  • Diffs
  • Info
  • Revert to this revision
  • XML
  • Render as Docbook
  • Print View
  • Raw Text
  • Delete Cache
  • Like Pages
  • Local Site Map
  • Remove Spam
  • Package Pages
  • Sync Pages
    • Diff for "TroopAndResourceTotals"
    Differences between revisions 10 and 11
    Revision 10 as of 2013-12-20 20:37:54
    Size: 1718
    Editor: Inanna
    Comment:
    Revision 11 as of 2013-12-20 21:13:55
    Size: 2258
    Editor: Inanna
    Comment:
    Deletions are marked like this. Additions are marked like this.
    Line 2: Line 2:
    This script will echo your troop & resource totals for each city and for your entire account. <<BR>> This script will echo your troop & resource (including population) totals for each city and for your entire account. <<BR>>
    Line 4: Line 4:
    Line 46: Line 47:
    echo "TOTAL TROOPS:\n" + TroopBeanToString(t, "\n")
    echo "TOTAL RESOURCES:\nGold: " + floor(g) + "\nFood: " + floor(f) + "\nWood: " + floor(w) + "\nStone: " + floor(s) + "\nIron: " + floor(i)
    echo "TOTAL UPKEEP: " + floor(up)
    echo "TOTAL POPULATION: " + floor(pop) + " of " + floor(popmax) + "."
    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:\nTotal Gold: " + g + "\nTotal Food: " + f + "\nTotal Wood: " + w + "\nTotal Stone: " + s + "\nTotal Iron: " + i + "\nPopulation: " + floor(pop) + " of " + floor(popmax)

    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.

    // =======================================================
    // Troop & Resource Totals For Each City & Entire Account
    // Originally by romulus
    // Inny bloated it with the resource stuff :P
    // =======================================================
    
    // 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:\nTotal Gold: " + g + "\nTotal Food: " + f + "\nTotal Wood: " + w + "\nTotal Stone: " + s + "\nTotal Iron: " + i + "\nPopulation: " + floor(pop) + " of " + floor(popmax)


    ScriptExamples

    TroopAndResourceTotals (last edited 2015-04-26 02:36:41 by Inanna)