• 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 "MonitorCity"
    Differences between revisions 11 and 17 (spanning 6 versions)
    Revision 11 as of 2014-03-03 22:14:42
    Size: 2320
    Editor: Inanna
    Comment:
    Revision 17 as of 2014-07-18 16:42:59
    Size: 2687
    Editor: tech
    Comment:
    Deletions are marked like this. Additions are marked like this.
    Line 1: Line 1:
    This script is run from one city only, and monitors all of them. It will alert you outloud and in alliance chat and in the log window if any city becomes under attack, or gets dangerously low on food (under 5 hours of upkeep). This script is run from one city only, and monitors all of them. It will alert you outloud and in alliance chat and in the log window if any city becomes under attack, or gets dangerously low on food (under 5 hours of upkeep), or has gates broken.
    Line 5: Line 5:
     {{{  . {{{
    Line 7: Line 7:
    // It will check all your cities for incoming attacks and food shortage.
    // When incoming attacks are spotted, it will talk outloud thru your speakers, and in ally chat.
    // It will check all your cities for incoming attacks and food shortage and broken gates.
    // When incoming attacks are spotted or your gates are broken, it will talk outloud thru your speakers, and in ally chat.
    Line 22: Line 22:
    Line 23: Line 24:
    if cm.resource.food.amount / cm.resource.troopCostFood < 5 gosub getfood
    if cm.buff("ForceopenclosegateBuff") gosub gatesbroken
    Line 24: Line 27:
    if cm.resource.food.amount / cm.resource.troopCostFood < 5 gosub getfood
    Line 28: Line 30:
    label gethelp
    Line 31: Line 34:
    // Don't forget to keep the "quotes" around the names.

    l
    abel gethelp
    // Don't forget to keep the "quotes" around the names, for example:
    // if enemy
    .king == "Inanna" return
    // ----------------------------------
    Line 38: Line 41:
    // ----------------------------------
    Line 42: Line 45:

    echo message
    execute "alliancechat " + message
    say message
    sleep 300
    return
    goto yellIt
    Line 51: Line 49:
    goto yellIt

    label gatesbroken
    message = "City " + cm.name + " @ " + cm.coords + " has broken gates!! Please let me know ASAP or log me on and save me!!!"
    goto yellIt

    label yellIt
    Line 57: Line 62:

    This script is run from one city only, and monitors all of them. It will alert you outloud and in alliance chat and in the log window if any city becomes under attack, or gets dangerously low on food (under 5 hours of upkeep), or has gates broken.

    Please read the //Comment lines in the script to know where to edit stuff.

    • // Only put this in one city to run. Does not need to be in all.
      // It will check all your cities for incoming attacks and food shortage and broken gates.
      // When incoming attacks are spotted or your gates are broken, it will talk outloud thru your speakers, and in ally chat.
      // It will ignore incoming attacks from any of the specified alliances, so you can attack your alts or be treb hit by alts without spamming AC.
      // You can disable config warrules and audio attack/tts attack warning if you use this, since it covers all 3 areas.
      label autorun
      
      label checkincoming
      x = 0
      
      label nextcity
      cs = cities[x]
      if cs == null sleep 10
      if cs == null goto checkincoming
      cm = cs.cityManager
      enemy = cm.enemyArmies[0]
      
      if enemy gosub gethelp
      if cm.resource.food.amount / cm.resource.troopCostFood < 5 gosub getfood
      if cm.buff("ForceopenclosegateBuff") gosub gatesbroken
      
      x = x + 1
      goto nextcity
      
      label gethelp
      // Below you can add the names of your alliance and alt alliances that may be attacking you with your permission.
      // You can also (or instead) add the names of yourself or authorized people that can attack with permission.
      // Add more lines if you need more exemptions, or delete any of these lines you don't need.
      // Don't forget to keep the "quotes" around the names, for example:
      // if enemy.king == "Inanna" return
      // ----------------------------------
      if enemy.alliance == "YOUR_ALLIANCE_HERE" return
      if enemy.alliance == "YOUR_ALT_ALLIANCE_HERE" return
      if enemy.king == "YOUR_NAME_HERE" return
      if enemy.king == "YOUR_FRIEND'S_NAME_HERE" return
      // ----------------------------------
      // End of the section to add exemptions for attack warnings. Don't delete stuff below :P
      
      message = "City " + cm.name + " @ " + cm.coords + " is under attack from " + enemy.king + " in alliance " + enemy.alliance + ". Save me!!!"
      goto yellIt
      
      label getfood
      message = "City " + cm.name + " @ " + cm.coords + " is at " + floor(cm.resource.food.amount / cm.resource.troopCostFood) + " hours of food. Feed me Seymour!!!"
      goto yellIt
      
      label gatesbroken
      message = "City " + cm.name + " @ " + cm.coords + " has broken gates!! Please let me know ASAP or log me on and save me!!!"
      goto yellIt
      
      label yellIt
      echo message
      execute "alliancechat " + message
      say message
      sleep 300
      return


    ScriptExamples

    MonitorCity (last edited 2014-07-18 16:42:59 by tech)