das wäre super

Mechlon
Moderators: Scripting / Modding Moderators, Moderatoren für Deutsches X-Forum
Code: Select all
Arguments
1: Station , Var/Station owned by Player , 'Select Station to Check'
2: Interval , Nummer , 'Set Check Interval Time'
Source Text
001 * --------------------------------------------------------------------------------
002 * Script CheckEmptyWares
003 * Ueberprueft ob eine der Waren der Station leer ist!
004 * Created by X-Tec Corporation
005 * Scripter XGamer
006 * --------------------------------------------------------------------------------
007
008
009 if $Interval < 30000
010 $Interval = 60000
011 $MSG = 'Mindestinterval betraegt 30 sec! Interval festgelegt auf Minimum'
012 send incoming message $MSG to player: display it=[TRUE]
013 end
014 if $Station == null
015 $MSG = 'Es wurde keine Station zur Ueberpruefung ausgewaehlt! Bitte Station auswaehlen!'
016 send incoming message $MSG to player: display it=[TRUE]
017 goto label EXIT
018 end
019 $Wares = $Station -> get tradeable ware array from station
020 $Size = size of array $Wares
021 while $Size > 0
022 $Ware = $Wares[$Size]
023 if $Ware != null
024 $Lager = $Station -> get amount of ware $Ware in cargo bay
025 if $Lager == 0
026 $MSG = 'In der Station ' + $Station + ' befinden sich noch ' + $Lager + ' Einheiten ' + $Ware
027 send incoming message $MSG to player: display it=[TRUE]
028 end
029 end
030 dec $Size =
031 end
032 @ = wait $Interval ms
033 @ = [THIS] -> call script 'FUN.CheckEmptyWare' : Select Station to Check=$Station
034 EXIT:
035 return null
Code: Select all
$MSG = sprintf: 'In der Station %s befinden sich noch %s Einheiten %s', $Station, $Lager, $Ware, null, null
ich nehme mal an das du mit der zeile 33 eine schleife erreichen wolltest.XGamer wrote:Code: Select all
. . . 032 @ = wait $Interval ms 033 @ = [THIS] -> call script 'FUN.CheckEmptyWare' : Select Station to Check=$Station 034 EXIT: 035 return null
Code: Select all
001 lable: schleife
.
.
033 goto lable. schleife