[skip|else] if [not]|while [not]| = The possible 'Conditional' statements that can be used with this command.
<RetVar/IF> = Use a variable, if the command should return information. If a variable is used, it will return the average price of <Var/Ware>.
<RefObj> = The station, which offers <Var/Ware>.
<Var/Ware> = The ware you want to know its average price.
Returns the average price of the as <Var/Ware> selected ware used by the as <RefObj> selected station. The average price is the arithmetic mean of minimum and maximum price of that ware.
Example:
$target = get player tracking aim
$ware = $target -> get product ware
$avg.price = $target -> get average price of ware $ware
write to player logbook: printf: fmt='The average price of %s at %s is %s Cr.', $ware, $target, $avg.price, null, null
return null
Assuming the current player $target is a factory, this will get the average price of its product (in case the factory has more than one product, it will be the first listed) and writes it with an appropriate message to the logbook.
Related Commands:
<RetVar/IF><RefObj> get price of ware <Var/Ware>
<RefObj> set price of ware <Var/Ware> to <Var/Number> Cr
Command Location:
- »» Trade Commands
- »» for Stations
<RetVar/IF><RefObj> get average price of ware <Var/Ware>
- »» for Stations