Size: 2956
Comment:
|
Size: 2683
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. 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. | 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 3: | Line 3: |
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. | Please read the //Comment lines in the script to know where to edit stuff. |
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 17: | Line 17: |
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 |
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 |
Line 20: | Line 28: |
if (x < m_context.cities.length) goto nextcity sleep 10 goto checkincoming |
goto nextcity |
Line 24: | Line 30: |
label gethelp | |
Line 25: | Line 32: |
// 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 |
// 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 |
Line 33: | Line 44: |
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 |
message = "City " + cm.name + " @ " + cm.coords + " is under attack from " + enemy.king + " in alliance " + enemy.alliance + ". Save me!!!" goto yellIt |
Line 42: | Line 48: |
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!!!" | 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 |
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