• 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 1 and 2
    Revision 1 as of 2013-11-21 02:30:04
    Size: 952
    Editor: Inanna
    Comment:
    Revision 2 as of 2013-11-21 02:30:46
    Size: 1018
    Editor: Inanna
    Comment:
    Deletions are marked like this. Additions are marked like this.
    Line 5: Line 5:
    // script by romulus
    Line 24: Line 25:
    // script by romulus
    Line 37: Line 39:
    ----
    ScriptExamples

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

    // 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 echo c.name + " - " + TroopBeanToString(tr, ",")
    if c dummy = tr.addTo(t)
    if c goto mainLoop
    
    echo "TOTAL TROOPS:\n" + TroopBeanToString(t, "\n")

    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")


    ScriptExamples

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