Die Funktion get stationarray from sector liefert mir zwar die Anzahl der Stationen, auch denen die im Komplex enthalten sind, jedoch kann ich so den Typ nicht herausfinden.
Meine Stationen im Komplex sind:
- 15 x Argon Ranch
- 15 x Cahoona Fleischfabrik
- 10 x Chip Werk
- 10 x Computerwerk
- 10 x Quantumröhrenfabrik
- 8 x Kristallfabrik
- 7 x SKW
- 2 x Erzmine
- 2 x Siliziummine
- 6 x Komplex Knotenpunkt
- und natürlich 1 Kontrollzentrum
- das macht dann insgesamt 86 Stationen
Ein weiteres Problem was sich daraus ergibt: Der Preis des Komplexes liegt bei dem EINER Argon Ranch, also die Preise der anderen Stationen werden nicht mit eingerechnet. Das läßt den Wert des Komplexes bei einer Preis- bzw Wertabfrage natürlich lächerlich aussehen.
Der Code zur Abfrage
Code: Select all
014 $stationsize = size of array $stations
015 while if $stationsize
016 dec $stationsize
017 $station = $stations[$stationsize]
018 $station.type = $station -> get ware type code of object
019 $station.price = get min price of ware $station.type
020 $station.price.normal = get average price of ware $station.type
021 $station.price.max = get max price of ware $station.type
022 $msg = $station + ' -- ' + $station.type + ' -- ' $station.price + ' -- ' + $station.price.normal + ' -- ' + $station.price.max
022 write to log file #98765 append=[TRUE] value=$msg
023 end
Die Logfile Ausgaben sehen nicht sehr zufriedenstellend aus :
Code: Select all
Ihr Ranch alpha(Trantor) -- Argon Ranch -- 1363401 -- 1817868 -- 2272335
Ihr Ranch alpha(Trantor) -- Argon Ranch -- 1363401 -- 1817868 -- 2272335
Ihr Ranch alpha(Trantor) -- Argon Ranch -- 1363401 -- 1817868 -- 2272335
Ihr Ranch alpha(Trantor) -- Argon Ranch -- 1363401 -- 1817868 -- 2272335
Ihr Ranch alpha(Trantor) -- Argon Ranch -- 1363401 -- 1817868 -- 2272335
Ihr Ranch alpha(Trantor) -- Argon Ranch -- 1363401 -- 1817868 -- 2272335
etc. etc
PS: Und ja, Einige ahnen es sicherlich schon, ich brauche das für meine Banksoftware, genauer gesagt für die Erweiterung um die Kreditfunktion der Banksoftware.