Difference between revisions of "Cabal Common Library Doc SpecialMarkets"
From Elite Wiki
m (documentation added) |
m |
||
Line 14: | Line 14: | ||
:;buyID:Array. Required. System.IDs [0...255]. | :;buyID:Array. Required. System.IDs [0...255]. | ||
:;sellID:Array. Required. System.IDs. If sold (and no contract) callback [0...255]. | :;sellID:Array. Required. System.IDs. If sold (and no contract) callback [0...255]. | ||
− | :;stationID:Array. Required. | + | :;stationID:Array. Required. Specified stations for buy and sell, e.g. [["main"],["MyStation"]]. |
:;cb:String. Required. worldScript name for callback. | :;cb:String. Required. worldScript name for callback. | ||
:;cbb:String. Required. Function that handles the delivery if !contract. | :;cbb:String. Required. Function that handles the delivery if !contract. |
Revision as of 18:03, 10 December 2011
Overview
This is the main class for the special markets with its members.
The script gives another option for trading in special goods and calculates prices and availabilities for inserted items.
Functions
registerLocation()
worldScripts.Cabal_Common_SpecialMarkets.registerLocation(obj); |
Scripts can specify systems where items can be bought or sold. Only one object with a few properties has to be passed.
Properties of obj:
- item
- String. Required. Unique Name. Max length 40 chars.
- galaxy
- Array. Required. Galaxy [0...7].
- buyID
- Array. Required. System.IDs [0...255].
- sellID
- Array. Required. System.IDs. If sold (and no contract) callback [0...255].
- stationID
- Array. Required. Specified stations for buy and sell, e.g. [["main"],["MyStation"]].
- cb
- String. Required. worldScript name for callback.
- cbb
- String. Required. Function that handles the delivery if !contract.
- priceclass
- Number. Required. Base priceclass. The higher the lower the production. [5...100].
- refresh
- Number. Required. Units produced every day [0...1].
- desc
- String. Required. Description.
- block
- Boolean. Blocks cargohold on purchase. If true disables contract.
- contract
- String. If !block it turns it into a cargo contract to a random system in sellID.
- offset
- Number. Sell multiplier for calculated price [1.3...5]. Default 1.3.
- avail
- Number. Starting availability [0...25]. Higher values will lower the prices. Default 0.
- times
- Number. Start time [clock.days-1000...clock.days]. Default clock.days.
- decrease
- Number. Affects prices and produced units over time [0.01...0.5]. Default 0.1.
- legal
- Boolean. Legality of this item. Default true.
- model
- String. Role. Default "cargopod".
- oneShot
- Boolean. One shot deal. If true item will be removed after selling.
Returns:
- success
- Boolean. True on success.
removeTradeItem()
worldScripts.Cabal_Common_SpecialMarkets.removeTradeItem(item); |
Removes the specified item.
Parameters:
- item
- String. Item to be removed.
Returns:
- nothing.