• 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

    Revision 1 as of 2013-11-21 02:30:04

    Clear message

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

    // gets total troops in all cities
    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
    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")