hab zwei Probleme und brauch eure Hilfe:
1. Wie fügt man in einem Setup Script ein Wait ein, dass der Script so zirka erst nach 2-3 Minuten läuft?
2. in dem Script will ich prüfen, ob es die gesuchten Schiffe und Stationen gibt, wenn nein sollen diese erstellt werden (bei dem Ausenposten klappt es nur beim Rest nicht)
Hier mein Script:
Code: Select all
001 @ = wait 12000 ms
002
003 $Shield = 10 GJ Shild
004 $ANF.MA = Militärischer Außenposten
005 $ANF.H = ANF Hyricane
006 $ANF.T = ANF Typhoon
007 $ANF.O = ANF Orcane
008 $ANF.S = Argonen Argon Schiffswerft
009
010
011 $Sector.ANF = get sector from universe index: x=3, y=4
012 skip if not $Sector.ANF -> exists
013 |
014 $MA = find station: sector=$Sector.ANF class or type=$ANF.MA race=Argonen flags=[Find.Multiple] refobj=$MA maxdist=null maxnum=99 refpos=null
015 $MA = get global variable: name=$GLOBAL.MA
016 if not $MA -> exists
017 |$MA = create station: type=$ANF.MA owner=Argonen addto=$Sector.ANF x=6400 y=7500 z=10000
018 |= $MA -> install 3 units of $Shield
019 |$MA -> set current shield strength to 120000000
020 |set global variable: name=$GLOBAL.MA value=$MA
021 end
022
023 $MA -> set relation against Player to Freund
024 $MA -> set relation against Argonen to Neutral
025 $MA -> set relation against Boronen to Neutral
026 $MA -> set relation against Split to Neutral
027 $MA -> set relation against Paraniden to Neutral
028 $MA -> set relation against Teladi to Neutral
029 $MA -> set relation against Xenon to Feind
030 $MA -> set relation against Kha'ak to Feind
031 $MA -> set relation against Piraten to Feind
032 $MA -> set relation against Goner to Neutral
033 $MA -> set relation against Terraner to Neutral
034 $MA -> set relation against Yaki to Feind
035 $MA -> add product to factory or dock: Energiezellen
036 $Max = $MA -> get free amount of ware Energiezellen in cargo bay
037 $Max = = random value from 0 to $Max - 1
038 = $MA -> add $Max units of Energiezellen
039 $MA -> add product to factory or dock: Quantumröhren
040 $Max = $MA -> get free amount of ware Quantumröhren in cargo bay
041 $Max = = random value from 0 to $Max - 1
042 = $MA -> add $Max units of Quantumröhren
043 $MA -> add product to factory or dock: Siliziumscheiben
044 $Max = $MA -> get free amount of ware Siliziumscheiben in cargo bay
045 $Max = = random value from 0 to $Max - 1
046 = $MA -> add $Max units of Siliziumscheiben
047 $MA -> set name to 'ANF Hauptquartier'
048
049 $SY = find station: sector=$Sector.ANF class or type=$ANF.S race=Argonen flags=[Find.Multiple] refobj=$SY maxdist=null maxnum=99 refpos=null
050 $SY = get global variable: name=$GLOBAL.SY
051 if not $SY -> exists
052 |$SY = create station: type=$ANF.S owner=Argonen addto=$Sector.ANF x=-7500 y=7500 z=0
053 |= $SY -> install 2 units of $Shield
054 |$SY -> set current shield strength to 120000000
055 |set global variable: name=$GLOBAL.SY value=$SY
056 end
057
058 $SY -> add product to factory or dock: $ANF.H
059 $SY -> add product to factory or dock: $ANF.O
060 $SY -> add product to factory or dock: $ANF.T
061 $SY -> set relation against Player to Freund
062 $SY -> set relation against Argonen to Freund
063 $SY -> set relation against Boronen to Freund
064 $SY -> set relation against Split to Neutral
065 $SY -> set relation against Paraniden to Neutral
066 $SY -> set relation against Teladi to Freund
067 $SY -> set relation against Xenon to Feind
068 $SY -> set relation against Kha'ak to Feind
069 $SY -> set relation against Piraten to Feind
070 $SY -> set relation against Goner to Freund
071 $SY -> set relation against Sohnen to Neutral
072 $SY -> set relation against Goner to Freund
073 $SY -> set name to 'ANF Schiffswerft'
074
075 $Sector.ANF = $MA -> get sector
076
077 $Hyricane = find ship: sector=$Sector.ANF class or type=$ANF.H race=Argonen flags=[Find.Multiple] refobj=$MA maxdist=null maxnum=99 refpos=null
078
079 $Hyricane = get global variable: name=$GLOBAL.H
080 if not $Hyricane -> exists
081 |$NewShip = $ANF.H
082 |$NeuesSchiff = create ship: type=$NewShip owner=Argonen addto=$Sector.ANF x=-5000 y=5000 z=0
083 @ |$Installiere = $NeuesSchiff -> call script 'plugin.stm.cheats.func.all' : Schiffstyp=$NeuesSchiff Wähle Rasse=Argonen
084 |set global variable: name=$GLOBAL.H value=$Hyricane
085 end
086
087 $Typhoon = find ship: sector=$Sector.ANF class or type=$ANF.T race=Argonen flags=[Find.Multiple] refobj=$MA maxdist=null maxnum=99 refpos=null
088
089 $Typhoon = get global variable: name=$GLOBAL.T
090 if not $Typhoon -> exists
091 |$NewShip = $ANF.T
092 |$NeuesSchiff = create ship: type=$NewShip owner=Argonen addto=$Sector.ANF x=0 y=5000 z=0
093 @ |$Installiere = $NeuesSchiff -> call script 'plugin.stm.cheats.func.all' : Schiffstyp=$NeuesSchiff Wähle Rasse=Argonen
094 |set global variable: name=$GLOBAL.T value=$Typhoon
095 end
096
097 $Orcane = find ship: sector=$Sector.ANF class or type=$ANF.O race=Argonen flags=[Find.Multiple] refobj=$MA maxdist=null maxnum=99 refpos=null
098
099 $Orcane = get global variable: name=$Global.OR
100 if not $Orcane -> exists
101 |$NewShip = $ANF.O
102 |$NeuesSchiff = create ship: type=$NewShip owner=Argonen addto=$Sector.ANF x=0 y=5000 z=0
103 @ |$Installiere = $NeuesSchiff -> call script 'plugin.stm.cheats.func.all' : Schiffstyp=$NeuesSchiff Wähle Rasse=Argonen
104 |set global variable: name=$Global.OR value=$Orcane
105 end
106
107 return null
Thomas