[WIP] <RetVar/IF><RefObj> get best store amount of ware <Var/Ware>

This forum serves as MSCI Reference at EGOSOFT. It's Read-Only for non MSCI Group members.

Moderators: Scripting / Modding Moderators, MSCI Moderators

Post Reply
User avatar
X2-Illuminatus
Moderator (Deutsch)
Moderator (Deutsch)
Posts: 24965
Joined: Sun, 2. Apr 06, 16:38
x4

[WIP] <RetVar/IF><RefObj> get best store amount of ware <Var/Ware>

Post by X2-Illuminatus » Thu, 7. Apr 11, 22:58

[skip|else] if [not]|while [not]|<RetVar/IF><RefObj> get best store amount of ware <Var/Ware>


[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 best amount of <Var/Ware> that can be stored in the <RefObj>.
<RefObj> = The station that stores <Var/Ware>.
<Var/Ware> = The ware you want to know its amount.


Returns the best amount of the as <Var/Ware> selected ware that can be stored in the as <RefObj> selected station. The best amount seems to have half the size of the max. amount. This will not consider the amount already stored in the station.


Example:

$target = get player tracking aim
$ware = $target -> get product ware
$amount = $target -> get best store amount of ware $ware
write to player logbook: printf: fmt='The maximum amount of %s that can be stored in %s is %s.', $ware, $target, $amount, null, null
return null

Assuming the current player $target is a factory, this will get the best amount of its product (in case the station has more than one product, it will be the first listed) that can be stored in that factory and writes it with an appropriate message to the logbook.


Related Commands:

<RetVar/IF><RefObj> get max. store amount of ware <Var/Ware>


Command Location:
TODO:
- Gather information about what that command is really for. It's strange that it always returns the half of the max amount. Coincidence? I don't think so...

Post Reply

Return to “MSCI Reference”