[SCRIPT] Command Queuing V1.21 : 26/05/2009
Moderators: Moderators for English X Forum, Scripting / Modding Moderators
[SCRIPT] Command Queuing V1.21 : 26/05/2009
=======================
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 ]
Installing
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.
Getting Started
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.
Queue Creation
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.
Setting Arguments
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.
Inserting and Deleting Commands
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.
Available Commands
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.
Running Queues
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.
Deleting and Editing Queues
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.
Scripters: Adding new commands
As said, scripters can use the plugin system to add any number of commands they want.
Scripters: Custom Menus
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.
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 ]
Installing
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.
Getting Started
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.
Queue Creation
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.
Setting Arguments
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.
Inserting and Deleting Commands
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.
Available Commands
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.
Running Queues
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.
Deleting and Editing Queues
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.
Scripters: Adding new commands
As said, scripters can use the plugin system to add any number of commands they want.
Scripters: Custom Menus
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.
Last edited by Cycrow on Tue, 26. May 09, 19:40, edited 3 times in total.
Cag??
Hmmm, just wondering if we could create a crude CAG with this???
Something along the lines of:
Station: 1mj factory
Resources needs, cahoona, e-cells, ore
Ships needed: 2
Ship 1
Command:
buy ware at best price: e-cells
dock at home
buy ware best price: cahoona
dock at home
buy ware best price: ore
dock at home
Ship 2
Command:
sell ware best price: 1mj
dock at home
wait 50000ms
Any way we could have these commands loop so the ships just keep replaying the commands over and over and over.........
Just an idea probably a completely wrong and bad 1!!!!
Regards,
Mufllink
Something along the lines of:
Station: 1mj factory
Resources needs, cahoona, e-cells, ore
Ships needed: 2
Ship 1
Command:
buy ware at best price: e-cells
dock at home
buy ware best price: cahoona
dock at home
buy ware best price: ore
dock at home
Ship 2
Command:
sell ware best price: 1mj
dock at home
wait 50000ms
Any way we could have these commands loop so the ships just keep replaying the commands over and over and over.........
Just an idea probably a completely wrong and bad 1!!!!
Regards,
Mufllink
When in doubt.......cheat.
-
- Posts: 933
- Joined: Fri, 5. Mar 04, 17:23
Hey Cycrow
In Lieu of not actually owning the game yet ( :< Australia fails hard :<), I'm forced to randomly go around the forum reading up stuff.
Any way, I had this idea, you all remember Rainbow 6, where you plan meticulously and the guys move oh the phrase "alpha/bravo/charlie/delta go!"
Well if you made an attachment to this script you could essentially do just that. Make a script that just checks every 5 seconds or so, for a global variable to be TRUE, then it runs the command.
So currently you might que
fly here (rally)
kill target
fly there (retreat)
Instead you might:
fly here (wait at rally point)
*on delta-go kill target
fly there (retreat)
It could be added to the UI by adding a "on next command, on alpha, beta, g, d etc.), like a "filter" sort of option
The actual script would be like
Arg: script name, script_args
*START*
$old = get global cy.plug.whatever.alpha
$var = old
while var <= old
wait 5s
$var = get global cy.plug.whatever.alpha
end while
call script with name
*finish*
And you have a alpha-go/b/c/d/etc. hotkey that increments the global variables.
In Lieu of not actually owning the game yet ( :< Australia fails hard :<), I'm forced to randomly go around the forum reading up stuff.
Any way, I had this idea, you all remember Rainbow 6, where you plan meticulously and the guys move oh the phrase "alpha/bravo/charlie/delta go!"
Well if you made an attachment to this script you could essentially do just that. Make a script that just checks every 5 seconds or so, for a global variable to be TRUE, then it runs the command.
So currently you might que
fly here (rally)
kill target
fly there (retreat)
Instead you might:
fly here (wait at rally point)
*on delta-go kill target
fly there (retreat)
It could be added to the UI by adding a "on next command, on alpha, beta, g, d etc.), like a "filter" sort of option
The actual script would be like
Arg: script name, script_args
*START*
$old = get global cy.plug.whatever.alpha
$var = old
while var <= old
wait 5s
$var = get global cy.plug.whatever.alpha
end while
call script with name
*finish*
And you have a alpha-go/b/c/d/etc. hotkey that increments the global variables.
if u needed to do something like that, it would be very easy for you to make an addon for it.
it has a plugin system that allows you to create commands yourself.
rather than me making some very specific commands i tyed just to make the generic ones, then anyone who wants to use the system for a specific task can simply add the addition commands.
you could add a command "wait for alpha" or something
then create my.script.waitalpha
then just add that into the queue, and when selected it will run your script which will wait for the varible to be set
it has a plugin system that allows you to create commands yourself.
rather than me making some very specific commands i tyed just to make the generic ones, then anyone who wants to use the system for a specific task can simply add the addition commands.
you could add a command "wait for alpha" or something
Code: Select all
= call script 'plugin.cmdqueue.register' id='waitalpha' text='Wait For Alpha' arguments=null, script='my.script.waitalpha'
Code: Select all
while not get global varible 'wait.alpha'
= wait 1000ms
end
New Update: 1.10
New update available: V1.10
Added the Loop command so queues can be looped multiple times
Fixed a problem with running newly created queues on ships (ie not saved ones)
Added the Loop command so queues can be looped multiple times
Fixed a problem with running newly created queues on ships (ie not saved ones)
i will add some more commands eventually.
however, adding your own is easy, especially if you know scripting.
basically adding a new command requires making an argument array and calling the register script.
for example, an attack target comman could be made by doing this
this would add a command called "Attack Target" and when you select it, you will be asked to select a ship as a target.
then it will run the script !fight.attack.object, which is the standard one for attacking a single ship
however, adding your own is easy, especially if you know scripting.
basically adding a new command requires making an argument array and calling the register script.
for example, an attack target comman could be made by doing this
Code: Select all
$arguments = create array, arguents = Var/Ship, "select ship to attack", null, null, null
= [THIS] call script 'plugin.cmdqueue.register', nameid='attacktarget', display text = 'Attack Target' Arguments = $arguments, script = '!fight.attack.object'
then it will run the script !fight.attack.object, which is the standard one for attacking a single ship
-
- Posts: 228
- Joined: Mon, 11. Sep 06, 23:05
Any chance of a loop back to... command?
It would be good for setting up ships and starting em off, you could have them go to a string of stations to get their gear then start a trading loop or patrol.
When it reaches the end of the queue it could loop back to the start of its patrol without the need to go through all the setup stations again.
Regardless, awesome script, yet another feature that should be in any game of this type.
It would be good for setting up ships and starting em off, you could have them go to a string of stations to get their gear then start a trading loop or patrol.
When it reaches the end of the queue it could loop back to the start of its patrol without the need to go through all the setup stations again.
Regardless, awesome script, yet another feature that should be in any game of this type.
This seems handy so i started..
I think i followed instructions...
Installed with plugin manager, yes its enabled
Loaded my game, Loaded the script editor (go and press in global commands and then select script editor right?)
Saved my game with script editor still open
Loaded the game....dont have the ability to setup a hotkey to start the thing.
I have looked everywhere, but i assume it would be under interface then extensions (right?)
I do have other scripts installed, i disabled a few of them, but hotkeys are there for FCC and MARS, o ya and wing command. not sure what im doing wrong.
I think i followed instructions...
Installed with plugin manager, yes its enabled
Loaded my game, Loaded the script editor (go and press in global commands and then select script editor right?)
Saved my game with script editor still open
Loaded the game....dont have the ability to setup a hotkey to start the thing.
I have looked everywhere, but i assume it would be under interface then extensions (right?)
I do have other scripts installed, i disabled a few of them, but hotkeys are there for FCC and MARS, o ya and wing command. not sure what im doing wrong.
I'm having problems with a queue I set up yesterday (had the mod for a while but this was my first one). The first step was to dock at PTNI Headquarters. And all the remaining steps were instructions to buy 1 instance of a smattering of upgrades (TCMk3, Navigaton Command, etc). When I try to run this on a Mercury Super Tanker, it flashes the Run.Queue order for a second and then it just goes idle. What's happening?
-TEVE