Script Name: Command Queueing
Released: 26/05/2009
Version: V1.21
=======================
These set of scripts allow you to command your ships to do multiple commands at once. The queues can be saved and recalled many times or ones can be created for a single use.
It also uses a plugin system allowing other users and scripters to add thier own commands without needing to edit the original scripts.
SPK: [ external image ]

To install the zip, simply download and extract into your X3 Terran Conflict Directory.
Or use the spk file with the Plugin Manager to install automatically
When in game, make sure the script editor is loaded and you have saved and reloaded your game.

To create a command queue, you need to open up the command queue creation menu. This is done via the hotkey which you can assign in the controls menu. Once assigned, simply pressing the hotkey when in space will open the menu.
[ external image ]
There are 2 types of queues, one with arguments and one without.
All available commands have a set or arguments that are used with that command, ie the Dock at command will ask the station to dock at.
If you create a queue with arguments then each command you select you wil also select the arguments for them, and those will be saved into the queue, ie using Dock At, and selecting a station, every time you run this queue on a ship, they will always dock at the same station.
Without arguments you just select the command, then each time you run the queue, you will be asked to fill in the arguments. Ie, you just select the Dock At command, then when you run it, you will be asked to choose the station.

Which ever option you choose, you will be shown the same menu, the only difference is if you will be asked to select the arguments or not
[ external image ]
The top section will list your current queue, the order of the commands you've added and where your next command is added. The -- Next Command -- option will be where your next command is added to. This allows you to insert commands between others.
The 2nd section is the available creation command, like insert, or delete entries, changing arguments and saving the queue "Finished"
Finally the 3rd section is the list of command you can add (scripters can add new commands)
To create the queue, simply select each command in order and they will be added to the list.

If you create a queue with arguments, when selecting the command to add, it will be followed with the arguments, the number and type of arguments depend on the command you select, and they will follow one after the other. Pressing Esc to quit during the arguments will set the argument to "ASKMODE". This means that when running the command queue, the user will be prompted for these arguments, ie how a queue without any arguments works, but only for the arguments that have been set like this.
[ external image ]
The above examples adds the same command switch, the first selects the argument, the 2nd does not.
You can change the arguments selected for any command with the option "Change Arguments". This will ask which command to change, then repeat the argument selection as before.

Deleting an existing command is straight forward, if theres any commands added, there will be the option "Delete Entry" select this then chose the command entry to delete and it will be removed.
To insert, it requires 2 stages. First, select the option "Insert Entry". This will display the currently added commands, select the command and then the "Next Command" marker will appear above.
[ external image ]
Then you just add the command as normal and it will be insert at the position the "Next Command" marker is at. Ie, in the above example, insert it as the first command in the queue.

The are various commands available and more will be added later, as well as custom commands can be added by scripters as well.
Some commands are straight forward, however, some of them have some special properties.
The Buy/Sell ware commands are making use of another unique feature, the plugin custom menus. This allows it to display wares in a better way than the normal ware inputs.
But it does something special as well, it can display wares at the station, but it will backtrack your commands list and take the last command that docked at a station, and use that stations wares if available. Basically if you add a dockat command then a buy ware command, then the list of wares available will be any ware that you can buy from the previous station in the dock at command.

Once you have created some queues and saved them, you can run them on any ship.
The option to run a queue is found in the command console (Custom Menu)
Select the option to run a command queue and you will be shown a list of available queues as well as the option to create a new one on the fly.
Selecting the create option does the same as the creation, but run the queue on the ship instead of saving it for later. This allows you to define a one time set of instructions for your ship.
Otherwise select one of your saved queues. Any arguments that havn't been set will have to be done when you run the queue, you will be asked for each of these before it starts.
Then the ship will go about its job and follow each command until it gets to the end.

Once you have saved any queues, you can delete or edit them via the command queue hotkey. These options are not available if you dont have any saved queues.

As said, scripters can use the plugin system to add any number of commands they want.

Instead of using a number input, it get sector, get ship, etc. You can create a custom menu that returns any argument you wish. The buy/sell ware commands use this for an example.
Scripters: Using Backtrack varibles
You can set up a serious of varibles that will be stores through the use of a queue, there is currently one varible availble "DOCKEDAT" which stores the current station you are docked at. Ie, seleting the dock at command will adjust to varible to the current argument. The buy/sell ware commands use this varible to display the list of wares available at the "DOCKEDAT" station.
You can also add other varibles to use for your own commands and custom menus.