<RetVar/IF><RefObj> add <Var/Number> units of <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

mark_a_condren
Posts: 1468
Joined: Wed, 3. Aug 05, 05:05
x3tc

<RetVar/IF><RefObj> add <Var/Number> units of <Var/Ware>

Post by mark_a_condren » Wed, 8. Dec 10, 14:19

[skip|else] if [not]|while [not]| <RetVar/IF> = <RefObj> add <Var/Number> units of <Var/Ware>


[skip|else] if [not]|while [not]| = The possible 'Conditional' statements that can be used with this command.
<RetVar/IF> = If the command is to 'return' information. If a variable is used, This command will return TRUE on success, FALSE on failure. (Note: Apparently, When using on HQ class stations the command always returns 0.)
<RefObj> = The 'Object' that the command is to be run on. 'Valid' objects can be a 'Ship or Station'.
<Var/Number> = The quantity of the ware to be added as an integer.
<Var/Ware> = The ware that is to be added.


Adds the specified units of <Var/Ware> to the cargo hold of <RefObj> as long as there is enough room to hold it.


Example:

= $ship -> add 100 units of Energy Cells

This will add 100 units of Energy Cells to the specified ship $ship
By using the = (No return value) a variable is not set and there is no way to determine if the command was successful or not. This must be then dertermined via an alternative method if required.


Command Location:
Last edited by mark_a_condren on Fri, 24. Aug 12, 10:10, edited 1 time in total.

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

[TiP][49] 292828

Post by X2-Illuminatus » Fri, 17. Dec 10, 12:21

[skip|else] if [not]|while [not]| <RetVar/IF> = <RefObj> add <Var/Number> units of <Var/Ware>


[skip|else] if [not]|while [not]| = Die möglichen bedingten Anweisungen, die mit diesem Befehl genutzt werden können.
<RetVar/IF> = Wird benötigt, wenn der Befehl eine Information zurückgeben soll. Wenn eine Variable genutzt wird, wird dieser Befehl im Erfolgsfall TRUE (wahr), im Fehlerfall FALSE (falsch) zurückgeben. (Eine Ausnahme hiervon bilden HQ-Stationen, bei diesen wird immer FALSE (falsch) zurückgegeben.)
<RefObj> = Das Objekt, auf dem der Befehl ausgeführt werden soll. Zulässige Objekte sind Schiffe oder Stationen.
<Var/Number> = Die Anzahl der Ware, die hinzugefügt werden soll, als ganze Zahl.
<Var/Ware> = Die Ware, die hinzugefügt werden soll.


Fügt die gewählten Einheiten von <Var/Ware> dem Frachtraum von <RefObj> hinzu, solange genügend Platz frei ist.


Beispiel:

= $ship -> add 100 units of Energiezellen

Dies wird 100 Einheiten Energiezellen dem gewählten Schiff $ship hinzufügen.
Indem man = (kein Rückgabewert) nutzt, wird keine Variable gesetzt und es gibt keine Möglichkeit herauszufinden, ob der Befehl erfolgreich war oder nicht. Dies müsste dann auf andere Weise ermittelt werden, falls die Information benötigt wird.


Zu finden unter:

Return to “MSCI Reference”