See also: Building Objects
See also: Building Types

getBuildingLevel

Usage:

city.getBuildingLevel(BuildingType)

Example:

level = city.getBuildingLevel(23)

This example finds the level of the Market (typeID = 23).

This example cancels all trades if the number of trades is equal to the level of the Market (typeID = 23).

getBuildingByTypeId

Usage:

city.getBuildingByTypeId(BuildingType)

Example:

city.getBuildingByTypeId(23)

This function returns an object for the building with the highest level of that typeId. For example, to find your highest level barrack (typeID = 2):

Valid parameters for this object are level, name, positionId, startTime, endTime, typeId, and status. For example you can echo city.getBuildingByTypeId(2).name or city.getBuildingByTypeId(2).status.

getBuildingByPosId

Usage:

city.getBuildingByPosId(pos)

Example:

city.getBuildingByPosId(2)

This example finds the name of the building at position 2:

You can find the positions with this:

http://imageshack.us/a/img820/7558/positionid1.png http://imageshack.us/a/img10/8545/positionid2.png

countBuilding

Usage:

city.countBuilding(BuildingType,MinLevel,MaxLevel)

Example:

totalmines = city.countBuilding(6,1,10)

This example gives the total count of all iron mines (typeID = 6) between level 1 and 10:

This example will check if you have at least 3 sawmills (typeID = 4) at level 5 or higher:


CategoryFunctions

BuildingFunctions (last edited 2014-11-23 22:50:43 by Inanna)