• 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 "City"
    Differences between revisions 9 and 10
    Revision 9 as of 2014-10-22 11:33:38
    Size: 4767
    Editor: LKD70
    Comment:
    Revision 10 as of 2014-12-09 07:00:05
    Size: 4852
    Editor: Inanna
    Comment:
    Deletions are marked like this. Additions are marked like this.
    Line 11: Line 11:
    ||buildCityLocations || || || ||buildCityLocations ||array ||Contains the FieldId of each coordinates scheduled for a (real) city to be built.||

    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

    buildCityLocations

    array

    Contains the FieldId of each coordinates scheduled for a (real) city to be built.

    buildings

    object

    Contains information about the buildings in your city.

    castle

    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...

    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)

    fieldId

    int

    fieldId of current city coords.

    findHeroByName

    fortification

    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

    hasEnemyArmies

    heroes

    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

    pendingProductionRates

    array

    ?

    PRFactor

    researches

    (array coll.)

    reservedResource

    (type is resource bean)

    resource

    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

    (type is TroopBean)

    troopQueueStatus

    int

    Tells if troop building status has started up or not. 0 = ready 1 = not ready

    troopStillInProduction

    x

    y

    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


    ScriptObjects

    City (last edited 2015-09-08 02:07:47 by Inanna)