5030
Comment:
|
6714
|
Deletions are marked like this. | Additions are marked like this. |
Line 11: | Line 11: |
||brokenGates ||boolean ||Returns true if the current cities gates are broken. || | |
Line 12: | Line 13: |
||buildings ||object ||Contains information about the buildings in your city. || ||castle || || || |
||[[Building|buildings]] ||object ||Contains information about the buildings in your city. || ||buffs ||object ||Returns an object of the current cities buffs. || ||[[Castle]] || || || |
Line 15: | Line 17: |
||!cityHasGoalErrors ||Boolean ||Is set to true in case if there was an exception (internal error) during goal processing OR if there are no goals at all (e.g. only comments)... i.e. simple syntax error will not set it to true... || | ||cityHasGoalErrors ||Boolean ||Is set to true in case if there was an exception (internal error) during goal processing OR if there are no goals at all (e.g. only comments)... i.e. simple syntax error will not set it to true... || ||cityNameCoords() ||string ||Returns the city name and (coords) in the format shown on the city tabs. || |
Line 22: | Line 25: |
||fields ||!ArrayCollection ||Array of [[Field]] Objects representing fields owned by current city. || | ||[[Field|fields]] ||!ArrayCollection ||Array of [[Field]] Objects representing fields (valleys and flats) owned by current city. || |
Line 24: | Line 27: |
||findHeroByName || || || ||fortification ||object? ||Contains information about the wall defences in your city. || |
||findHeroByName("heroname") ||object ||if the hero is found it will display the heroes object. Else it will return null.|| ||[[Fortification|fortification]] ||object ||Contains information about the wall defences in your city. || |
Line 32: | Line 35: |
||hasEnemyArmies || || || ||heroes ||object ||Contains information about the heroes in your city. || |
||getActiveBuilding() ||object ||If you're building it will return the object of that building, otherwise it will return null. || ||getActiveResearch() ||object ||If you're researching it will return the object of that research, otherwise it will return null. || ||getMaxArmySize() ||object ||Shows the maximum amount of army troops possible. || ||[[GetTechLevel|GetTechLevel()]] ||int ||Returns the current level of the tech provided. || ||[[getTravelTime]] ||int ||Returns the time in seconds it takes to march from point A to point B using a particular type of troops, taking into account player's relevant tech levels for compass or horseback riding. || ||hasEnemyArmies ||boolean ||Returns true if the city has enemy armies, otherwise returns false. || ||hasEnemyArmiesWithin() ||Boolean ||Returns true if there are enemy armies incoming within x seconds. Optionally use hasEnemyArmiesWithin(x, true) to return true if there are enemy armies incoming within x seconds, or if the beacon is too low to see the time. Returns false if not. || ||haunted ||Boolean ||Returns true if the current city has a haunted or Christmas castle item applied. || ||[[Heroes]] ||object ||Contains information about the heroes in your city. || |
Line 46: | Line 56: |
||resource ||object ||Contains information about the resources in your city. || | ||[[CityResource|resource]] ||object ||Contains information about the resources in your city. || |
Line 54: | Line 64: |
||troop || ||(type is !TroopBean) || | ||troop ||object ||(object type is [[troop|TroopBean]]) || |
Line 57: | Line 67: |
||x || || || ||y || || || |
||x ||int ||Outputs the cities x location on the map. || ||y ||int ||Outputs the cities y location on the map. || |
The City objects can reference details about the city the script is run in.
City objects can be referenced as:
m_city.cityManager.property or city.property
The .property at the end is how you will specify which detail you are referencing. Using the table below, you can for example get the name of the city with city.name.
Properties
Property |
Type |
Description |
brokenGates |
boolean |
Returns true if the current cities gates are broken. |
buildCityLocations |
array |
Contains the FieldId of each coordinates scheduled for a (real) city to be built. |
object |
Contains information about the buildings in your city. |
|
buffs |
object |
Returns an object of the current cities buffs. |
|
|
|
checkFeastingHallSpace |
Boolean |
Looks to see if you have an open slot in your Feasting Hall. NOTE: Counts one spot in Hall for Training Hero if not in that town. Returns True / False |
cityHasGoalErrors |
Boolean |
Is set to true in case if there was an exception (internal error) during goal processing OR if there are no goals at all (e.g. only comments)... i.e. simple syntax error will not set it to true... |
cityNameCoords() |
string |
Returns the city name and (coords) in the format shown on the city tabs. |
coords |
String |
Gives the coordinates of the city |
debugMask |
|
|
directionChange |
Boolean |
Internal bot usage only. Used by medal hunting to set to true every time army is recalled, and then it forces citymanager to do 1 cycle without auto-recalling troops from valleys. Returns: True / False |
distanceSettings |
Array |
Returns all 5 values of DistancePolicy for the city. distanceSettings[0] through distanceSettings[4] will return the value for npc farming, npc building, medal hunting, valley acquisition, and map scanning in order. |
enemyArmies |
ArrayCollection |
Contains information about incoming enemy armies. |
estResource |
|
(type is EstimateResource) |
ArrayCollection |
Array of Field Objects representing fields (valleys and flats) owned by current city. |
|
fieldId |
int |
fieldId of current city coords. |
findHeroByName("heroname") |
object |
if the hero is found it will display the heroes object. Else it will return null. |
object |
Contains information about the wall defences in your city. |
|
fortificationProduceQueue |
|
|
fortificationQueueStatus |
int |
Tells if wall building status has started up or not. 0 = ready 1 = not ready |
fortificationRequirement |
|
|
friendlyArmies |
object |
Contains information about incoming alliance armies. |
furtherInitNeeded |
Boolean |
Tells True / False if town has had the first focus set on a town. |
GateControl |
int |
Shows current status of the city gates. 0 = Auto 1 = Open 2 = Closed |
getActiveBuilding() |
object |
If you're building it will return the object of that building, otherwise it will return null. |
getActiveResearch() |
object |
If you're researching it will return the object of that research, otherwise it will return null. |
getMaxArmySize() |
object |
Shows the maximum amount of army troops possible. |
int |
Returns the current level of the tech provided. |
|
int |
Returns the time in seconds it takes to march from point A to point B using a particular type of troops, taking into account player's relevant tech levels for compass or horseback riding. |
|
hasEnemyArmies |
boolean |
Returns true if the city has enemy armies, otherwise returns false. |
hasEnemyArmiesWithin() |
Boolean |
Returns true if there are enemy armies incoming within x seconds. Optionally use hasEnemyArmiesWithin(x, true) to return true if there are enemy armies incoming within x seconds, or if the beacon is too low to see the time. Returns false if not. |
haunted |
Boolean |
Returns true if the current city has a haunted or Christmas castle item applied. |
object |
Contains information about the heroes in your city. |
|
id |
int |
Gives the number ID of town that is ran in |
incomingResources(sec) |
object |
Contains information about resources incoming to the city within specified time in seconds |
innheroes |
object |
Contains information about the heroes in the inn. |
innStatus |
int |
Returns the ready / not ready status for the inn in that town. 0 = ready 1 = not ready |
mapInitState |
int |
Tells if map screen has loaded yet. 0 - OK 1 - pending 2 - init needed |
myArmies |
object |
Contains information about your own armies. Same as selfArmies. |
name |
String |
Gives the name of the town it's run in. |
NumberOfRealAttacks |
int |
Returns the number of real (non-junk) attacks incoming to the city. |
pendingProductionRates |
array |
? |
PRFactor |
|
|
researches |
|
(array coll.) |
reservedResource |
|
(type is resource bean) |
object |
Contains information about the resources in your city. |
|
ResourceProduction |
|
|
selfArmies |
object |
Contains information about your own armies. Same as myArmies. |
timeSlot |
int |
Gives the order of towns that the bot reads from 0-X, where X = The number of towns you have starting at 0 |
tradesArray |
|
|
TrainingHeroIsHere |
|
|
trainingHeroName |
String |
Returns the name of the town's listed training hero. |
transingTradesArray |
|
|
troop |
object |
(object type is TroopBean) |
troopQueueStatus |
int |
Tells if troop building status has started up or not. 0 = ready 1 = not ready |
troopStillInProduction |
|
|
x |
int |
Outputs the cities x location on the map. |
y |
int |
Outputs the cities y location on the map. |
getConfig("") |
int |
Outputs value of a config goal. Example: echo city.getConfig("hero") will echo the status of 'config hero' goal. |
isDebugging(32768) |
Boolean |
Shows if script debugging is On or Off (True or False). |
hasResourceForArmy() |
Boolean |
Shows if you have the resources to build the army specified. |
rallySpotAvailable() |
Boolean |
Shows if you have a rally spot free. Optional parameters: (reserveSlotForTH, optional extraSlots). |
Examples
//Check the status of my embassy ifgoto (city.castle.allowAlliance) itsOpen goto itsClosed label itsOpen echo "My embassy is open" end label itsClosed echo "My embassy is closed" end