[SCRIPT] Command Queuing V1.21 : 26/05/2009
Moderators: Moderators for English X Forum, Scripting / Modding Moderators
-
- Posts: 393
- Joined: Fri, 26. Dec 03, 13:37
It breaks "global variables: regular expression" immediately on a new game.
start a new game with script installed, activate script editor and run the following code
The log will either say (Null) or at most one or two global names.
start a new game with script installed, activate script editor and run the following code
Code: Select all
$vars = get global variables: regular expression='.*'
$size = size of array $vars
$msg = $size + ' ' + $vars
write to log file 111 append=[TRUE] value=$msg
return null
There is a thin line between genius & insanity i have erased this line
Armegeddon's X3 scripts and mods
Armegeddon's X3 scripts and mods
-
- Posts: 393
- Joined: Fri, 26. Dec 03, 13:37
I'm running version 2.5 of X3 and was running Command Queue 1.21. I was unable to figure out where it would cause the problem in the script either, after spending over an hour looking through the code.
I was trying to figure out why settings from Salvage Command Suite were not being saved, and managed to work out the problem was due to 'get global variables: regular expression' not returning a correct value. After removing all scripts and working from a vanilla game, adding scripts until the command broke. In total, there were 3 scripts that caused problems; Advanced Hyperdrive by Loky77 (caused by naming a global with an undefined variable probably by selecting <variable> instead of <string>),
Death Match Arena by LV (caused by calling an AL main script from a setup script with null arguments), and Command Queuing (unable to figure out why). All I know is that I was able to return global variables without Command Queue, but unable with it. Unless one of the supposedly working scripts was making use of Command Queue functions and I didn't notice it. I will go and check again to make sure.
Hopefully will have an update within next couple hours.
I was trying to figure out why settings from Salvage Command Suite were not being saved, and managed to work out the problem was due to 'get global variables: regular expression' not returning a correct value. After removing all scripts and working from a vanilla game, adding scripts until the command broke. In total, there were 3 scripts that caused problems; Advanced Hyperdrive by Loky77 (caused by naming a global with an undefined variable probably by selecting <variable> instead of <string>),
Death Match Arena by LV (caused by calling an AL main script from a setup script with null arguments), and Command Queuing (unable to figure out why). All I know is that I was able to return global variables without Command Queue, but unable with it. Unless one of the supposedly working scripts was making use of Command Queue functions and I didn't notice it. I will go and check again to make sure.
Hopefully will have an update within next couple hours.
There is a thin line between genius & insanity i have erased this line
Armegeddon's X3 scripts and mods
Armegeddon's X3 scripts and mods
-
- Posts: 393
- Joined: Fri, 26. Dec 03, 13:37
I think TC just wants me to embarrass myself by falsely accusing people of having broken scripts.
I just went through and retested all 71 of my packages, and now it works fine with Command Queue, while the exact same setup did not work last night. Although the other two packages did have problems that I fixed in my copy.
Sorry for the false alarm.
I just went through and retested all 71 of my packages, and now it works fine with Command Queue, while the exact same setup did not work last night. Although the other two packages did have problems that I fixed in my copy.
Sorry for the false alarm.
There is a thin line between genius & insanity i have erased this line
Armegeddon's X3 scripts and mods
Armegeddon's X3 scripts and mods
-
- Posts: 1
- Joined: Fri, 5. Feb 10, 09:16
I don't know if anyone else is having this problem but all my ques work fine except ones that dock. The moment one of my ships docks the script stops every time.
The que looks like this:
1. Dock at
2. Buy Wares At Max Price
...
It stops between docking and buying. Is anyone else having this problem?
The que looks like this:
1. Dock at
2. Buy Wares At Max Price
...
It stops between docking and buying. Is anyone else having this problem?
Change is inevitable, except from vending machines.
-
- Posts: 795
- Joined: Fri, 4. Sep 09, 02:35
Great found the thread.
Like just above sometime the ship stops.. but that isn't my question.
Confusion on..
Wait for seconds.
I noticed that many scripts use milliseconds for their loops. eg: wait 5000 = waits 5 real time seconds.
Yours saids seconds.. so if I place
1.) wait for seconds -- 6000 ; it should wait 6000/60 = 100 minutes or
real time - 1 hr 40 mins.
or is it
2.) wait for seconds -- 6000 millsecond or 6 real time seconds.
I hope it's #1 and you have already done the conversions.
question 2.
Loop
Straight forward.. loop X number of times
Can you nest loops?
(series of commands 1)
Loop 10
(second series of commands)
loop 10
finish
_ does the 1 series of commands 10 times then does the second series once then returns to the first set 10X and then 2nd and so forth until loop 10 on second series completes, then ends.
it does the 1st set 100 times and the second set 10 times.
Am I correct on this?
Like in the old basic lang..
set $value = 0
set $count= 0
For X = 1 to 10
For Y = 1 to 10
Let $value = $value +1
next Y
Let $count = $count +1
Next X
Print $value;$count
We see 100 10
(OK I didn't show line numbers)
Next Q for Loop (dependent on last answer)
What is max value I can set loop to? does it have a max value (like 65000)
; if I want to loop forever in game..
Dock at %P (station or place where ware is located)
Buy 100 X(ware)
Dock at $homebase
Sell 100 X - (dump ware at homebase)
* Loop 1000000 (million times)
or do I do this on loop
*
Loop 1000
Loop 1000
* twice to achieve 1 million ?
Running 2.1 and I can't for the life of me see where you can save the commands.. (must be getting old)
Apprieciate your time to answer.
Like just above sometime the ship stops.. but that isn't my question.
Confusion on..
Wait for seconds.
I noticed that many scripts use milliseconds for their loops. eg: wait 5000 = waits 5 real time seconds.
Yours saids seconds.. so if I place
1.) wait for seconds -- 6000 ; it should wait 6000/60 = 100 minutes or
real time - 1 hr 40 mins.
or is it
2.) wait for seconds -- 6000 millsecond or 6 real time seconds.
I hope it's #1 and you have already done the conversions.
question 2.
Loop
Straight forward.. loop X number of times
Can you nest loops?
(series of commands 1)
Loop 10
(second series of commands)
loop 10
finish
_ does the 1 series of commands 10 times then does the second series once then returns to the first set 10X and then 2nd and so forth until loop 10 on second series completes, then ends.
it does the 1st set 100 times and the second set 10 times.
Am I correct on this?
Like in the old basic lang..
set $value = 0
set $count= 0
For X = 1 to 10
For Y = 1 to 10
Let $value = $value +1
next Y
Let $count = $count +1
Next X
Print $value;$count
We see 100 10
(OK I didn't show line numbers)
Next Q for Loop (dependent on last answer)
What is max value I can set loop to? does it have a max value (like 65000)
; if I want to loop forever in game..
Dock at %P (station or place where ware is located)
Buy 100 X(ware)
Dock at $homebase
Sell 100 X - (dump ware at homebase)
* Loop 1000000 (million times)
or do I do this on loop
*
Loop 1000
Loop 1000
* twice to achieve 1 million ?
Running 2.1 and I can't for the life of me see where you can save the commands.. (must be getting old)
Apprieciate your time to answer.
-
- Posts: 1468
- Joined: Wed, 3. Aug 05, 05:05
Retiredman
for your 100 10 loop, you could do something like this, and this is only one way of doing it, there are prob lots of other ways too.
Just put the code in the pots that you what done ten time and a hundred times. It wikk run that code once every time through. You need to cycle it 110 times so you set $counter to cycle until it gets upto 110.
Hope this helps a bit.
MarCon
for your 100 10 loop, you could do something like this, and this is only one way of doing it, there are prob lots of other ways too.
Code: Select all
10 $counter.check = 0
11 $counter = 0
12 while $counter < 110
13 inc $counter.check
14 if $counter.check = 10
15 $counter.check = 0
16
17 Do whatever i need to do ten times (once)
18
19 else
20
21 Do whatever i need to do a hundred times (once)
22
23 end
24 inc = $counter
25 end
26
Hope this helps a bit.
MarCon
-
- Posts: 795
- Joined: Fri, 4. Sep 09, 02:35
-
- Posts: 180
- Joined: Sat, 5. Sep 09, 00:32
-
- Posts: 795
- Joined: Fri, 4. Sep 09, 02:35
Facetious1;
Jump to sector can be set by each ship's individual setting.
(if "fly to position"(different sector) or "fly to sector" then the ship will attempt to make the jump if the e-cell are available)
I usually set the jump to distance to 1 and a refuel for 35 jumps.
Cycrow : a little more clairty on the loop routines:
Like if I:(generitic form)
[(dock at hub1.
buy X + (jump & return)e-cells (or just set the hub1 as home if I own it, and forget about the jump buy)
dock at trading station
Sell X e-cells
loop 10) (inner loop)
dock at hub 2
buy crystals
dock at hub1
sell crystals
fly to position X (someplace In sector)
wait 60 (wait a minute)
loop -1] [master or outer loop]
as it is shown:
It will buy e-cells at the hub #1
Will jump/walk/run/zoom to the trading dock
sell the X number of e-cells
(does this 10 times - this is the inner loop)
docks at Hub #2
buys crystals
goes back and docks at hub #1
sells the crystals (same amount bought)
flys somewhere to a point
waits 1 minute
Repeats forever, starting at the very beginning to buy e-cells to sell at trading dock 10 times again, then goes to buy crystals. (This is the master/outer loop)
I am hoping that it would nest. The last loop would include the first loop (10 X)
Also I notice I don't have the option to "save" the routine. is it not there or am I missing something? (had thought I saw there was an option)
Edit: seems I tried a simple loop within a loop and it doesn't nest. Oh well.
Jump to sector can be set by each ship's individual setting.
(if "fly to position"(different sector) or "fly to sector" then the ship will attempt to make the jump if the e-cell are available)
I usually set the jump to distance to 1 and a refuel for 35 jumps.
Cycrow : a little more clairty on the loop routines:
Like if I:(generitic form)
[(dock at hub1.
buy X + (jump & return)e-cells (or just set the hub1 as home if I own it, and forget about the jump buy)
dock at trading station
Sell X e-cells
loop 10) (inner loop)
dock at hub 2
buy crystals
dock at hub1
sell crystals
fly to position X (someplace In sector)
wait 60 (wait a minute)
loop -1] [master or outer loop]
as it is shown:
It will buy e-cells at the hub #1
Will jump/walk/run/zoom to the trading dock
sell the X number of e-cells
(does this 10 times - this is the inner loop)
docks at Hub #2
buys crystals
goes back and docks at hub #1
sells the crystals (same amount bought)
flys somewhere to a point
waits 1 minute
Repeats forever, starting at the very beginning to buy e-cells to sell at trading dock 10 times again, then goes to buy crystals. (This is the master/outer loop)
I am hoping that it would nest. The last loop would include the first loop (10 X)
Also I notice I don't have the option to "save" the routine. is it not there or am I missing something? (had thought I saw there was an option)
Edit: seems I tried a simple loop within a loop and it doesn't nest. Oh well.
-
- Posts: 180
- Joined: Sat, 5. Sep 09, 00:32
Ahh very awesome, thanks for the guidance. I have yet to mess around with individual ship settings like that... Now to get the rest of the ore to the hub!!! First loop worked charms!Retiredman wrote:Facetious1;
Jump to sector can be set by each ship's individual setting.
(if "fly to position"(different sector) or "fly to sector" then the ship will attempt to make the jump if the e-cell are available)
I usually set the jump to distance to 1 and a refuel for 35 jumps.
Thanks again
-
- Posts: 6
- Joined: Tue, 8. Jul 08, 03:31
alright so i DLed this a while ago but didnt really start to use it until today... well not so much use it as attempt to use it.
i cannot and i do mean cannot use this script at all.
i through every last reply in this topic, found people with my same problem but no answers.
my problem is that:
1. there is no hotkey available
2. when going through the plugin config menu i click 'create with argument/no argument' and i just get returned to the plugin config menu
3. i have no idea how to use the script editor, nor do i have any what to use it.
im not a scripter or a modder just a user who is having a spot of trouble at the moment.
i cannot and i do mean cannot use this script at all.
i through every last reply in this topic, found people with my same problem but no answers.
my problem is that:
1. there is no hotkey available
2. when going through the plugin config menu i click 'create with argument/no argument' and i just get returned to the plugin config menu
3. i have no idea how to use the script editor, nor do i have any what to use it.
im not a scripter or a modder just a user who is having a spot of trouble at the moment.
-
- Posts: 25
- Joined: Sat, 6. Dec 08, 04:13
exact same problem heresnyperwolf wrote:alright so i DLed this a while ago but didnt really start to use it until today... well not so much use it as attempt to use it.
i cannot and i do mean cannot use this script at all.
i through every last reply in this topic, found people with my same problem but no answers.
my problem is that:
1. there is no hotkey available
2. when going through the plugin config menu i click 'create with argument/no argument' and i just get returned to the plugin config menu
3. i have no idea how to use the script editor, nor do i have any what to use it.
im not a scripter or a modder just a user who is having a spot of trouble at the moment.
-
- Posts: 795
- Joined: Fri, 4. Sep 09, 02:35