BuyPrice(X)

Usage:

BuyPrice(X)

Example:

BuyPrice(X)

Refers to the highest bid of a given resource.

0=food,1=wood,2=stone,3=iron

Script

echo "food costs"city.buyPrice(2)

Output

19:03:29 food costs 15.62

Example of usage

label start

1: ifgoto BuyPrice(2) >= 1 sellfood

2: sleep 50

3: loop start

label sellfood

4: sell food 1000 1

5: goto start

SellPrice(X)

Usage:

SellPrice(X)

Example:

SellPrice(X)

Refers to the cheapest offer of a given resource.

0=food,1=wood,2=stone,3=iron

Script

echo "iron is offered at"city.sellPrice(2)

Output

19:03:29 iron is offered at 15.62

Example of usage

label start

1: ifgoto SellPrice(2) >= 1 buyiron

2: sleep 50

3: loop start

label buyiron

4: buy iron 1000 1

5: goto start

tradesArray.length

Usage:

city.tradesArray.length

Example:

city.tradesArray.length

Returns the number of trades you have posted in the market which have not completed.

city.tradesArray[x]

In the following examples, x is a number from 0 - 9 referring to the specific trade posted in the market (0 = 1st trade, 9 = last) the number of possible trades you can have posted in the market is limited by the level of the market.

tradesArray[x].amount

Usage:

city.tradesArray[x].amount

Example:

city.tradesArray[0].amount

returns a number indicating the quantity of resources being purchased or sold in city.tradesArray[x]

tradesArray[x].resType

Usage:

city.tradesArray[x].resType

Example:

city.tradesArray[0].resType

returns a number representing the resource type of the resources being purchased or sold in city.tradesArray[x]

0 = Food 1 = Lumber / Wood 2 = Stone 3 = Iron

tradesArray[x].tradeType

Usage:

city.tradesArray[x].tradeType

Example:

city.tradesArray[0].tradeType

returns a number indicating trade type of the trade in city.tradesArray[x]

0 = Buy 1 = Sell

tradesArray[x].resourceName

Usage:

city.tradesArray[x].resourceName

Example:

city.tradesArray[0].resourceName

returns a string containing the name of the resource type of the resources being purchased or sold in city.tradesArray[x] ("Food","Lumber","Stone","Iron")

tradesArray[x].price

Usage:

city.tradesArray[x].price

Example:

city.tradesArray[0].price

returns a number indicating price of the trade in city.tradesArray[x]

tradesArray[x].id

Usage:

city.tradesArray[x].id

Example:

city.tradesArray[0].id

returns a number indicating returns the internal ID of the trade in city.tradesArray[x]

tradesArray[x].tradeTypeName

Usage:

city.tradesArray[x].tradeTypeName

Example:

city.tradesArray[0].tradeTypeName

returns a string indicating the type of trade in city.tradesArray[x] ("Bid","Offer")

tradesArray[x].dealedAmount

Usage:

city.tradesArray[x].dealedAmount

Example:

city.tradesArray[0].dealedAmount

Description goes here.

tradesArray[x].dealedTotal

Usage:

city.tradesArray[x].dealedTotal

Example:

city.tradesArray[0].dealedTotal

Description goes here.

transingTradesArray.length

Usage:

city.transingTradesArray.length

Example:

city.transingTradesArray.length

Description goes here.

in the following examples, the value of x can be from 0 to ???, as you can have an infinite number of incoming purchases

transingTradesArray[0].amount

Usage:

city.transingTradesArray[0].amount

Example:

city.transingTradesArray[0].amount

Description goes here.

transingTradesArray[0].endTime

Usage:

city.transingTradesArray[0].endTime

Example:

city.transingTradesArray[0].endTime

Description goes here.

transingTradesArray[0].resourceName

Usage:

city.transingTradesArray[0].resourceName

Example:

city.transingTradesArray[0].resourceName

Description goes here.

transingTradesArray[0].price

Usage:

city.transingTradesArray[0].price

Example:

city.transingTradesArray[0].price

Description goes here.

transingTradesArray[0].total

Usage:

city.transingTradesArray[0].total

Example:

city.transingTradesArray[0].total

Description goes here.

transingTradesArray[0].id

Usage:

city.transingTradesArray[0].id

Example:

city.transingTradesArray[0].id

Description goes here.

transingTradesArray[0].resType

Usage:

city.transingTradesArray[0].resType

Example:

city.transingTradesArray[0].resType

Description goes here.


ScriptObjects

Market (last edited 2014-02-10 18:41:43 by Inanna)