• 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 2 and 3
    Revision 2 as of 2013-11-21 02:30:46
    Size: 1018
    Editor: Inanna
    Comment:
    Revision 3 as of 2013-12-09 01:52:58
    Size: 1280
    Editor: Inanna
    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 totals for each city and for your entire account.
    Line 4: Line 4:
    // gets total troops in all cities
    // script by romulus
    // =======================================================
    // 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
    Line 7: Line 14:
    echo "TOTAL TROOPS: Found " + mycities.length + " castle(s)" echo "ACCOUNT TOTALS: Found " + mycities.length + " castle(s)"
    echo "Please wait. Calculating..."
    Line 9: Line 17:
    g = 0
    f = 0
    w = 0
    s = 0
    i = 0
    Line 14: Line 27:
    if c echo c.name + " - " + TroopBeanToString(tr, ",") if c g = g + c.resource.gold
    if c f = f + c.resource.food.amount
    if c w = w + c.resource.wood.amount
    if c s = s + c.resource.stone.amount
    if c i = i + c.resource.iron.amount
    if showcities if c echo c.name + " - " + TroopBeanToString(tr, ",")
    Line 19: Line 37:
    }}}

    This is the same thing, only just the account totals and not individual cities included too.

    {{{
    // gets total troops in all cities
    // script by romulus
    mycities = cities.concat()
    echo "TOTAL TROOPS: Found " + mycities.length + " castle(s)"
    t = GetTroops("a:0")

    label mainLoop
    c = mycities.shift()
    if c c = c.cityManager
    if c tr = c.getAvailableTroop()
    if c dummy = tr.addTo(t)
    if c goto mainLoop

    echo "TOTAL TROOPS:\n" + TroopBeanToString(t, "\n")
    echo "TOTAL RESOURCES:\nGold: " + floor(g) + "\nTotal Food: " + floor(f) + "\nTotal Wood: " + floor(w) + "\nTotal Stone: " + floor(s) + "\nTotal Iron: " + floor(i)

    This script will echo your troop & resource totals for each city and for your entire account.

    // =======================================================
    // 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")
    g = 0
    f = 0
    w = 0
    s = 0
    i = 0
    
    label mainLoop
    c = mycities.shift()
    if c c = c.cityManager
    if c tr = c.getAvailableTroop()
    if c g = g + c.resource.gold
    if c f = f + c.resource.food.amount
    if c w = w + c.resource.wood.amount
    if c s = s + c.resource.stone.amount
    if c i = i + c.resource.iron.amount
    if showcities if c echo c.name + " - " + TroopBeanToString(tr, ",")
    if c dummy = tr.addTo(t)
    if c goto mainLoop
    
    echo "TOTAL TROOPS:\n" + TroopBeanToString(t, "\n")
    echo "TOTAL RESOURCES:\nGold: " + floor(g) + "\nTotal Food: " + floor(f) + "\nTotal Wood: " + floor(w) + "\nTotal Stone: " + floor(s) + "\nTotal Iron: " + floor(i)


    ScriptExamples

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