• 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 "BuildingFunctions"
    Differences between revisions 1 and 5 (spanning 4 versions)
    Revision 1 as of 2014-11-23 21:52:32
    Size: 4122
    Editor: Inanna
    Comment:
    Revision 5 as of 2014-11-23 21:55:03
    Size: 4021
    Editor: Inanna
    Comment:
    Deletions are marked like this. Additions are marked like this.
    Line 1: Line 1:
    <<TOC>> <<TableOfContents>>
    Line 3: Line 3:
    ## page was renamed from GetBuildingLevel
    == getBuildingLevel(buildingType) ==
    == getBuildingLevel ==
    Line 17: Line 16:
    echo city.getBuildingLevel(23)
    Line 18: Line 18:
    echo city.getBuildingLevel(23) 10
    Script stopped
    Line 20: Line 21:
     10<<BR>>Script stopped
    Line 22: Line 22:
    == getBuildingByTypeId(buildingType) == == getBuildingByTypeId ==
    Line 39: Line 39:
    == getBuildingByPosId(pos) == == getBuildingByPosId ==
    Line 54: Line 54:
    == countBuilding(buildingType,minLevel,maxLevel) == == countBuilding ==

    getBuildingLevel

    Usage:

    city.getBuildingLevel ( BuildingTypes )

    Example:

    level = city.getBuildingLevel(23)

    this example finds the level of the MarketPlace(23)

    • if city.tradesArray.length == city.getBuildingLevel(23) canceltrade

    This sample cancels all trades if the number of trades is equal to the Level of the Market Place... (Hence the Market is full)

    echo city.getBuildingLevel(23)

    • 10
      Script stopped

    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):

    • echo city.getBuildingByTypeId(2).level

    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.

    See also: BuildingTypes

    getBuildingByPosId

    Usage:

    city.getBuildingByPosId(pos)

    Example:

    city.getBuildingByPosId(2)

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

    • echo city.getBuildingByPosId(2).name

    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)

    The above example gives the total count of all iron mines between level 1 and 10.


    CategoryFunctions

    BuildingFunctions (last edited 2016-02-01 18:02:03 by Inanna)