• 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 4 and 5
    Revision 4 as of 2013-03-08 16:45:12
    Size: 3026
    Editor: Inanna
    Comment:
    Revision 5 as of 2013-03-12 05:29:44
    Size: 2956
    Editor: Inanna
    Comment:
    Deletions are marked like this. Additions are marked like this.
    Line 13: Line 13:
    // Add here how many seconds to wait between checking for attacks or shortages.
    // Keep in mind it'll take it ~30 seconds to check all 9 cities, so this time is in addition to that.
    checktime = 10

    // Add here how much food you should be down to before the bot alerts you and your alliance.
    foodamt = 50000000
    Line 25: Line 18:
    if (m_context.cities[x].cityManager.resource.food.amount < foodamt) gosub getfood if ((m_context.cities[x].cityManager.resource.food.amount / (m_context.cities[x].cityManager.resource.troopCostFood * 2)) < 5) gosub getfood
    Line 28: Line 21:
    execute "sleep " + checktime sleep 10
    Line 31: Line 24:
    // Below you can add the names of your alliance and alt alliances that may be attacking you with your permission.
    // Add more identical lines if you need more, or delete the lines if you need less.
    // Don't forget to keep the "quotes" around the names.
    Line 32: Line 28:
    // Add more lines exactly like the ones below to add more alliances to ignore attacks from.
    // Remove the lines if you don't want/use them.
    if (m_context.cities[x].cityManager.enemyArmies[0].alliance == "YOUR_ALLY_NAME") return
    if (m_context.cities[x].cityManager.enemyArmies[0].alliance == "ALT_ALLY_NAME") return
    if (m_context.cities[x].cityManager.enemyArmies[0].alliance == "ALT_ALLY_NAME") return
    if (m_context.cities[x].cityManager.enemyArmies[0].alliance == "ALT_ALLY_NAME") return
    if (m_context.cities[x].cityManager.enemyArmies[0].alliance == "YOUR_ALLIANCE_HERE") return
    if (m_context.cities[x].cityManager.enemyArmies[0].alliance == "YOUR_ALT_ALLIANCE_HERE") return
    if (m_context.cities[x].cityManager.enemyArmies[0].alliance == "YOUR_ALT_ALLIANCE_HERE") return
    if (m_context.cities[x].cityManager.enemyArmies[0].alliance == "YOUR_ALT_ALLIANCE_HERE") return
    Line 39: Line 33:
    message = "City " + m_context.cities[x].cityManager.name + " @ " + m_context.cities[x].cityManager.coords + " is under attack from " + m_context.cities[x].cityManager.enemyArmies[0].king + " in alliance " + m_context.cities[x].cityManager.enemyArmies[0].alliance + ". Help me!!" message = "City " + m_context.cities[x].cityManager.name + " @ " + m_context.cities[x].cityManager.coords + " is under attack from " + m_context.cities[x].cityManager.enemyArmies[0].king + " in alliance " + m_context.cities[x].cityManager.enemyArmies[0].alliance + ". Save me!!!"
    Line 42: Line 36:
    execute "alliancechat " + message
    Line 43: Line 38:
    execute "alliancechat " + message
    Line 48: Line 42:
    message = "City " + m_context.cities[x].cityManager.name + " @ " + m_context.cities[x].cityManager.coords + " is at " + floor(m_context.cities[x].cityManager.resource.food.amount) + " food. Feed me Seymour!!!"
    message = "City " + m_context.cities[x].cityManager.name + " @ " + m_context.cities[x].cityManager.coords + " is at " + floor(m_context.cities[x].cityManager.resource.food.amount / m_context.cities[x].cityManager.resource.troopCostFood) + " hours of food. Feed me Seymour!!!"
    Line 51: Line 44:
    execute "alliancechat " + message
    Line 52: Line 46:
    execute "alliancechat " + message

    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. Setup the checktime to tell the bot how long to wait between each check of cities.Setup the foodamt to tell the bot how much food is "too low" before it alerts.

    About halfway down the script you'll see lines with "YOUR_ALLY_NAME" and "ALT_ALLY_NAME". Replace those with your alliance name and alt alliance names so the bot will ignore attacks from those. Delete those lines if you don't want them. Add more of those lines if you need more of them.

    • // 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.
      // When incoming attacks are spotted, 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
      if (m_context.cities[x].cityManager.enemyArmies.length > 0) gosub gethelp
      if ((m_context.cities[x].cityManager.resource.food.amount / (m_context.cities[x].cityManager.resource.troopCostFood * 2)) < 5) gosub getfood
      x = x + 1
      if (x < m_context.cities.length) goto nextcity
      sleep 10
      goto checkincoming
      
      // Below you can add the names of your alliance and alt alliances that may be attacking you with your permission.
      // Add more identical lines if you need more, or delete the lines if you need less.
      // Don't forget to keep the "quotes" around the names.
      label gethelp
      if (m_context.cities[x].cityManager.enemyArmies[0].alliance == "YOUR_ALLIANCE_HERE") return
      if (m_context.cities[x].cityManager.enemyArmies[0].alliance == "YOUR_ALT_ALLIANCE_HERE") return
      if (m_context.cities[x].cityManager.enemyArmies[0].alliance == "YOUR_ALT_ALLIANCE_HERE") return
      if (m_context.cities[x].cityManager.enemyArmies[0].alliance == "YOUR_ALT_ALLIANCE_HERE") return
      
      message = "City " + m_context.cities[x].cityManager.name + " @ " + m_context.cities[x].cityManager.coords + " is under attack from " + m_context.cities[x].cityManager.enemyArmies[0].king + " in alliance " + m_context.cities[x].cityManager.enemyArmies[0].alliance + ". Save me!!!"
      
      echo message
      execute "alliancechat " + message
      say message
      sleep 300
      return
      
      label getfood
      message = "City " + m_context.cities[x].cityManager.name + " @ " + m_context.cities[x].cityManager.coords + " is at " + floor(m_context.cities[x].cityManager.resource.food.amount / m_context.cities[x].cityManager.resource.troopCostFood) + " hours of food. Feed me Seymour!!!"
      echo message
      execute "alliancechat " + message
      say message
      sleep 300
      return


    ScriptExamples

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