<RetVar> = get station array: product=<Var/Ware> include empty=<Var/Boolean>

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

Moderators: Scripting / Modding Moderators, MSCI Moderators

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

<RetVar> = get station array: product=<Var/Ware> include empty=<Var/Boolean>

Post by X2-Illuminatus » Thu, 28. Jul 11, 19:29

<RetVar> = get station array: product=<Var/Ware> include empty=<Var/Boolean>


<RetVar> = A variable where the requested information is stored in an array.
<Var/Ware> = A ware that is used as product.
<Var/Boolean> = A TRUE or FALSE value or its representing number 1 or 0.


This command returns an array of all stations (excluding Equipment Docks and Trading Stations) that produce the as <Var/Ware> selected ware. Setting the "include empty"-value to TRUE will return all stations producing that ware, even if they haven't it currently in stock.


Example:

$stock=0
$ware=Ore
$station.arr= get station array: product=$ware include empty=[FALSE]
$size= size of array $station.arr
while $size
|dec $size=
|$station=$station.arr[$size]
|$amount=$station -> get amount of ware $ware in cargo bay
|if $amount > $stock
||$stock=$amount
||$return.station=$station
|end
end
skip if $stock == 0
|write to player logbook $return.station
return null


This gets all stations, which produce Ore, finds out the station with the biggest amount of that ware in stock and writes it to the player logbook.


Related Commands:

<RetVar> = get station array: resource=<Var/Ware> include empty=<Var/Boolean>
<RetVar> = get station array: of race <Var/Race> class/type=<Value>


Command Location:

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

[TiP][49] 304925

Post by X2-Illuminatus » Sat, 1. Oct 11, 15:51

<RetVar> = get station array: product=<Var/Ware> include empty=<Var/Boolean>


<RetVar> = Eine Variable, in der die geforderte Information gespeichert wird.
<Var/Ware> = Eine Ware, die produziert wird.
<Var/Boolean> = Ein TRUE (wahr) oder FALSE (falsch) Wert oder seine entsprechende Ziffer 1 oder 0.


Dieser Befehl gibt ein Array derjenigen Stationen (Ausrüstungsdocks und Handelsstationen ausgenommen) zurück, die die als <Var/Ware> gewählte Ware produzieren. Setzt man den "include empty"-Wert auf TRUE (wahr) werden auch Stationen zurückgegeben, die diese Ware produzieren, aber sie zur Zeit nicht auf Lager haben.


Example:

$stock=0
$ware=Erz
$station.arr= get station array: product=$ware include empty=[FALSE]
$size= size of array $station.arr
while $size
|dec $size=
|$station=$station.arr[$size]
|$amount=$station -> get amount of ware $ware in cargo bay
|if $amount > $stock
||$stock=$amount
||$return.station=$station
|end
end
skip if $stock == 0
|write to player logbook $return.station
return null


Dieses Beispiel findet alle Stationen, die Erz produzieren, ermittelt diejenige, die das meiste Erz auf Lager hat und schreibt sie ins Spielerlogbuch.


Verwandte Befehle:

<RetVar> = get station array: resource=<Var/Ware> include empty=<Var/Boolean>
<RetVar> = get station array: of race <Var/Race> class/type=<Value>


Zu finden unter:

Locked

Return to “MSCI Reference”