[SCRIPT] Command Queuing V1.21 : 26/05/2009

The place to discuss scripting and game modifications for X³: Terran Conflict and X³: Albion Prelude.

Moderators: Moderators for English X Forum, Scripting / Modding Moderators

Cycrow
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 22228
Joined: Sun, 14. Nov 04, 23:26
x4

Post by Cycrow » Thu, 4. Feb 10, 14:06

Have you used it to create any queues or does the error happen before you actually use it ?

It uses global carunles for 2 things the available commands and the stored queues

Armegeddon
Posts: 393
Joined: Fri, 26. Dec 03, 13:37
x4

Post by Armegeddon » Thu, 4. Feb 10, 20:59

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

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
The log will either say (Null) or at most one or two global names.
There is a thin line between genius & insanity i have erased this line

Armegeddon's X3 scripts and mods

Cycrow
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 22228
Joined: Sun, 14. Nov 04, 23:26
x4

Post by Cycrow » Thu, 4. Feb 10, 22:14

most strange, i cant see anywhere in the script where it would set a null variable, and i dont have the problem with my game

on mine, i get an array of 57 entries, so it doesn't appear to be a problem.

what game version are you running, and what version of command queue do u have installed?

Armegeddon
Posts: 393
Joined: Fri, 26. Dec 03, 13:37
x4

Post by Armegeddon » Thu, 4. Feb 10, 22:31

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.
There is a thin line between genius & insanity i have erased this line

Armegeddon's X3 scripts and mods

Cycrow
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 22228
Joined: Sun, 14. Nov 04, 23:26
x4

Post by Cycrow » Thu, 4. Feb 10, 22:52

what about trying to go vanilla, and then only enabling the command queueing ?

that should confirm if its causing a problem by itself.

Armegeddon
Posts: 393
Joined: Fri, 26. Dec 03, 13:37
x4

Post by Armegeddon » Thu, 4. Feb 10, 23:16

I think TC just wants me to embarrass myself by falsely accusing people of having broken scripts. :oops:

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

silverpenny7
Posts: 1
Joined: Fri, 5. Feb 10, 09:16

Post by silverpenny7 » Fri, 5. Feb 10, 09:23

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?
Change is inevitable, except from vending machines.

Retiredman
Posts: 795
Joined: Fri, 4. Sep 09, 02:35
x3ap

Post by Retiredman » Thu, 11. Feb 10, 18:23

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.

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

Post by mark_a_condren » Thu, 11. Feb 10, 19:56

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.

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
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

Cycrow
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 22228
Joined: Sun, 14. Nov 04, 23:26
x4

Post by Cycrow » Thu, 11. Feb 10, 20:16

the loop command is very basic, it will only loop the whole queue

as for the number of times, -1 will loop indefinatly.

the limit is the same limit all numbers have, which is 2billion


as for the wait, its already in seconds, as theres really reason for wanting to wait for milliseconds :)

Retiredman
Posts: 795
Joined: Fri, 4. Sep 09, 02:35
x3ap

Post by Retiredman » Thu, 11. Feb 10, 21:23

OK that answers that..

It's definately in seconds and the loop is an entire loop for the entire command set.
and (-1) is forever.

Great.. thank you.

facetious1
Posts: 180
Joined: Sat, 5. Sep 09, 00:32
x3tc

Post by facetious1 » Mon, 22. Feb 10, 23:22

Please add "Jump to sector" as a menu item ... I am way too stupid to figure out this scripting stuff. :o (actually only about an hour of gaming a day.....).

Pretty Please????

with sugar on top?
And a big cherry?

Man I love you!

Retiredman
Posts: 795
Joined: Fri, 4. Sep 09, 02:35
x3ap

Post by Retiredman » Tue, 23. Feb 10, 09:30

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.

facetious1
Posts: 180
Joined: Sat, 5. Sep 09, 00:32
x3tc

Post by facetious1 » Wed, 24. Feb 10, 05:48

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.
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!

Thanks again

snyperwolf
Posts: 6
Joined: Tue, 8. Jul 08, 03:31
xr

Post by snyperwolf » Sat, 6. Mar 10, 02:32

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.

madpainter
Posts: 25
Joined: Sat, 6. Dec 08, 04:13
x3tc

Post by madpainter » Thu, 11. Mar 10, 00:31

Just a heads up on a possible conflict with the Gazz follow me/remember homebase mod.

unless its just me :P
Can anyone confirm /dis-confirm :oops: un-confirm :oops: ........prove me wrong. :P

User avatar
Lordaeron
Posts: 501
Joined: Tue, 17. Jul 07, 16:51
x4

Post by Lordaeron » Mon, 12. Apr 10, 18:59

snyperwolf 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.
exact same problem here

Retiredman
Posts: 795
Joined: Fri, 4. Sep 09, 02:35
x3ap

Post by Retiredman » Tue, 13. Apr 10, 07:29

Could be one of the Plugin version Cycrow has.(If I remeber there are 2 different ones)

I believe I was getting the same problem and switched the Plungin script and reloaded the Command Queue script.
Now it works for me..

User avatar
Lordaeron
Posts: 501
Joined: Tue, 17. Jul 07, 16:51
x4

Post by Lordaeron » Tue, 13. Apr 10, 12:39

I should have mentioned that I unpacked the .pck to add a german language file, I translated.

Then I copied the whole thing like usual (script to script/t to t).

Maybe there are conflicts with other scripts I have in my "Must Have" Collection, Ill check that asap.

User avatar
Lordaeron
Posts: 501
Joined: Tue, 17. Jul 07, 16:51
x4

Post by Lordaeron » Tue, 13. Apr 10, 15:24

Ok, no clue but it fixed itself, somehow.

weird

Post Reply

Return to “X³: Terran Conflict / Albion Prelude - Scripts and Modding”