Size: 4378
Comment:
|
Size: 2855
Comment:
|
Deletions are marked like this. | Additions are marked like this. |
Line 11: | Line 11: |
||id ||int ||Gives the FieldID of the mapCastleBean || | |
Line 12: | Line 13: |
||furlough ||Boolean ||If player at indicated coords is in holiday, returns True, otherwise returns False || | ||userName ||String ||returns the player's name that owns the castle or valley, or null if unowned || ||playerLogoUrl ||String ||returns path the the player's avatar icon, or null if unowned || ||name ||String ||returns name of city, or "Barbarian's city", if coords are a valley it will return a string containing valley type: "Forest","Hill","Swamp","Flat",etc. || ||allianceName ||String ||returns name of player's alliance or null if unallied or unowned. || ||zoneName ||String ||returns name of state: "Franconia","Lombardy","Tuscany",etc. || ||prestige ||int ||returns prestige of owner of FieldId (or 0 if unowned) || ||honor ||int ||returns honor of owner of FieldId (or 0 if unowned) || ||flag ||String ||returns the player's flag (or null if unowned/unoccupied) || ||relation ||int ||returns number indicating color of flag: 0 = green flags, 1 = blue flags, 2 = grey flags, 3 = red flags (returns 6 for unowned valleys) || ||furlough ||Boolean ||Is player at indicated coords in holiday? Returns: True / False || ||state ||int ||Returns code indicating [[Player State|PlayerState]] (status) || ||npc ||Boolean ||Is city at indicated coords an NPC? Returns: True / False || |
Line 14: | Line 26: |
||flag ||String ||returns the player's flag (or null if unowned/unoccupied) || ||canLoot || || || ||directionChange ||Boolean ||Internal bot useage 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. || ||[[ArmyBean|enemyArmies]] ||!ArrayCollection ||Contains information about incoming enemy [[ArmyBean|armies]]. || ||estResource || ||(type is !EstimateResource) || ||fieldId || || || ||findHeroByName || || || ||[[FortificationBean|fortification]] ||object? ||Contains information about the wall defenses in your city. || ||fortificationProduceQueue || || || ||fortificationQueueStatus ||int ||Tells if wall building status has started up or not. 0 = ready 1 = not ready || ||[[FortificationBean|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 || || || ||[[HeroBean|heroes]] ||object ||Contains information about the heroes in your city. || ||id ||int ||Gives the number ID of town that is ran in || ||[[HeroBean|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 || ||isSafeFarming || || || ||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) || ||[[CityResource|resource]] ||object ||Contains information about the resources in your city. || ||!ResourceProduction || || || ||!SafeFarmingList || || || ||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 || || || |
||canLoot ||Boolean ||If you can loot from the coords. Returns: True / False || ||canSend ||Boolean ||If you can send to the coords. Returns: True / False || ||canScout ||Boolean ||If you can scout the coords. Returns: True / False || ||canTrans ||Boolean ||If you can transport to the coords. Returns: True / False || ||canOccupy ||Boolean ||If you can occupy the coords. Returns: True / False || |
Line 61: | Line 35: |
'''Related Functions''' RelationIndex(mapCastleBean) RelationIndex returns values from 0 ..6 as following: Player = 0 Enemy = 1 Same = 2 Friend = 3 Neutral = 4 Other = 5 NoAlliance = 6 |
|
Line 64: | Line 46: |
//Check the status of my embassy ifgoto (city.castle.allowAlliance) itsOpen goto itsClosed label itsOpen print My embassy is open end label itsClosed print My embassy is closed end |
fid = GetFieldId(123,456) // convert coordinates into FieldId mcb = GetDetailInfo(fid) // retrieve mapCastleBean object containing details for specified FieldId if mcb == null repeat // if the server did not send updated info, repeat last step echo mcb.name echo mcb.allianceName echo mcb.prestige |
Line 78: | Line 55: |
---- | |
Line 80: | Line 56: |
"playerLogoUrl":"string" "userName":"string" "canScout":false "zoneName":"string - name of state" "canOccupy":false "canTrans":true "allianceName":"string" "name":"string" "id": int - same as FieldId "relation":0 "npc":false "state":1 see player state "prestige":int "canSend":true "honor":0 ---- ScriptObjects |
mapCastleBean objects reference details about a location on the map.
mapCastleBean objects can be referenced as:
userDefinedObject.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 |
id |
int |
Gives the FieldID of the mapCastleBean |
lastUpdated |
int |
time the information in the mapCastleBean was last updated |
userName |
String |
returns the player's name that owns the castle or valley, or null if unowned |
playerLogoUrl |
String |
returns path the the player's avatar icon, or null if unowned |
name |
String |
returns name of city, or "Barbarian's city", if coords are a valley it will return a string containing valley type: "Forest","Hill","Swamp","Flat",etc. |
allianceName |
String |
returns name of player's alliance or null if unallied or unowned. |
zoneName |
String |
returns name of state: "Franconia","Lombardy","Tuscany",etc. |
prestige |
int |
returns prestige of owner of FieldId (or 0 if unowned) |
honor |
int |
returns honor of owner of FieldId (or 0 if unowned) |
flag |
String |
returns the player's flag (or null if unowned/unoccupied) |
relation |
int |
returns number indicating color of flag: 0 = green flags, 1 = blue flags, 2 = grey flags, 3 = red flags (returns 6 for unowned valleys) |
furlough |
Boolean |
Is player at indicated coords in holiday? Returns: True / False |
state |
int |
Returns code indicating PlayerState (status) |
npc |
Boolean |
Is city at indicated coords an NPC? Returns: True / False |
changeface |
int |
not sure what this indicates. seems to always be 0. |
canLoot |
Boolean |
If you can loot from the coords. Returns: True / False |
canSend |
Boolean |
If you can send to the coords. Returns: True / False |
canScout |
Boolean |
If you can scout the coords. Returns: True / False |
canTrans |
Boolean |
If you can transport to the coords. Returns: True / False |
canOccupy |
Boolean |
If you can occupy the coords. Returns: True / False |
Related Functions
RelationIndex(mapCastleBean)
RelationIndex returns values from 0 ..6 as following:
Player = 0 Enemy = 1 Same = 2 Friend = 3 Neutral = 4 Other = 5 NoAlliance = 6
Examples
fid = GetFieldId(123,456) // convert coordinates into FieldId mcb = GetDetailInfo(fid) // retrieve mapCastleBean object containing details for specified FieldId if mcb == null repeat // if the server did not send updated info, repeat last step echo mcb.name echo mcb.allianceName echo mcb.prestige