EnglishGermanFrenchRussianPolishItalianSpanish
Log inRegister
 
[SCRIPT] Command Queuing V1.21 : 26/05/2009
Post new topic Reply to topic Goto page 1, 2, 3, 4, 5, 6, 7, 8  Next
View previous topic :: View next topic
Author Message
Cycrow
Moderator (Script&Mod)
Moderator (Script&Mod)



Joined: 15 Nov 2004
Posts: 20456 on topic
Location: London
Thank you for registering your game
modified
PostPosted: Tue, 14. Oct 08, 12:55    Post subject: [SCRIPT] Command Queuing V1.21 : 26/05/2009 Reply with quote Print

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

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

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



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.


Arrow 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



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.

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



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.


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



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.


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

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

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

Arrow Scripters: Adding new commands

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

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


_________________
My Scripts | MY X3TC Scripts | X3 Plugin Manager | Custom Gui


Last edited by Cycrow on Tue, 26. May 09, 19:40; edited 3 times in total
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Cycrow
Moderator (Script&Mod)
Moderator (Script&Mod)



Joined: 15 Nov 2004
Posts: 20456 on topic
Location: London
Thank you for registering your game
PostPosted: Tue, 21. Oct 08, 20:02    Post subject: Reply with quote Print

Spk version has now been included


_________________
My Scripts | MY X3TC Scripts | X3 Plugin Manager | Custom Gui
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
mufflink





Joined: 10 Feb 2004
Posts: 115 on topic
Location: Dublin, Ireland
Thank you for registering your game
PostPosted: Tue, 21. Oct 08, 20:31    Post subject: Cag?? Reply with quote Print

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


_________________
When in doubt.......cheat.
Back to top
View user's profile Send private message
Cycrow
Moderator (Script&Mod)
Moderator (Script&Mod)



Joined: 15 Nov 2004
Posts: 20456 on topic
Location: London
Thank you for registering your game
PostPosted: Tue, 21. Oct 08, 20:44    Post subject: Reply with quote Print

well, it might be possible to do something like that, i could look at adding some kind of loop command.

and perhaps a command to call another queue


_________________
My Scripts | MY X3TC Scripts | X3 Plugin Manager | Custom Gui
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
paulms1980





Joined: 05 Mar 2004
Posts: 833 on topic

Thank you for registering your game
PostPosted: Thu, 23. Oct 08, 09:48    Post subject: Reply with quote Print

this will make X3 like that old space strategy game Stars! where u could que a repaeating order
cycrow does this mean i can setup a repeating manual trade route?
Buy X amount of good A then sell then X amout n repeat?

Back to top
View user's profile Send private message
Cycrow
Moderator (Script&Mod)
Moderator (Script&Mod)



Joined: 15 Nov 2004
Posts: 20456 on topic
Location: London
Thank you for registering your game
PostPosted: Thu, 23. Oct 08, 11:57    Post subject: Reply with quote Print

not yet. You can set up the the que to do that, but it wont repeat so u'll have to keep applying it.

however, in the next version i will add a repeat option so you can do that


_________________
My Scripts | MY X3TC Scripts | X3 Plugin Manager | Custom Gui
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Malakie





Joined: 13 Apr 2004
Posts: 649 on topic
Location: USA
Thank you for registering your game
PostPosted: Fri, 24. Oct 08, 01:36    Post subject: Reply with quote Print

Most awesome script! Another staple to always use! Great job.


_________________
Take it light.....

Malakie

----------------------------------------------------
Back to top
View user's profile Send private message
s9ilent





Joined: 29 Jun 2005
Posts: 2008 on topic
Location: Galactic Sector ZZ9-Plural Z alpha +10 GMT
Thank you for registering your game
PostPosted: Sat, 25. Oct 08, 09:46    Post subject: Reply with quote Print

Hey Cycrow Smile

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.

Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Cycrow
Moderator (Script&Mod)
Moderator (Script&Mod)



Joined: 15 Nov 2004
Posts: 20456 on topic
Location: London
Thank you for registering your game
PostPosted: Sat, 25. Oct 08, 13:43    Post subject: Reply with quote Print

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

Code:

= call script 'plugin.cmdqueue.register' id='waitalpha' text='Wait For Alpha' arguments=null, script='my.script.waitalpha'


then create my.script.waitalpha
Code:

while not get global varible 'wait.alpha'
 = wait 1000ms
end


then just add that into the queue, and when selected it will run your script which will wait for the varible to be set


_________________
My Scripts | MY X3TC Scripts | X3 Plugin Manager | Custom Gui
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Cycrow
Moderator (Script&Mod)
Moderator (Script&Mod)



Joined: 15 Nov 2004
Posts: 20456 on topic
Location: London
Thank you for registering your game
PostPosted: Fri, 31. Oct 08, 01:33    Post subject: New Update: 1.10 Reply with quote Print

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)


_________________
My Scripts | MY X3TC Scripts | X3 Plugin Manager | Custom Gui
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Coruskane





Joined: 13 Jun 2008
Posts: 796 on topic
Location: Under LV's Imperial Tasselled-Vintage-Leather Boot
Thank you for registering your game
PostPosted: Sun, 2. Nov 08, 03:56    Post subject: Reply with quote Print

yippe, an adequate CAG (when a few 'get ware space' scripts are called for the variables) for my purposes Smile (simply getting a freighter to load up with multiple products from a super complex (42 weapons/shields facilities in a closed-loop Smile) then depositing them into my distribution network.

Back to top
View user's profile Send private message
amirite





Joined: 23 Oct 2008



PostPosted: Sun, 2. Nov 08, 16:49    Post subject: Reply with quote Print

So how hard would it be to make all/most stock commands available for use with this?


_________________
-TEVE
Back to top
View user's profile Send private message AIM Address
Cycrow
Moderator (Script&Mod)
Moderator (Script&Mod)



Joined: 15 Nov 2004
Posts: 20456 on topic
Location: London
Thank you for registering your game
PostPosted: Sun, 2. Nov 08, 17:06    Post subject: Reply with quote Print

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

Code:

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


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


_________________
My Scripts | MY X3TC Scripts | X3 Plugin Manager | Custom Gui
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
fintoozler





Joined: 11 Sep 2006
Posts: 219 on topic
Location: On top of a mountain in a thunderstorm wearing copper armor shouting All gods are bastards!
Thank you for registering your game
PostPosted: Sat, 22. Nov 08, 06:14    Post subject: Reply with quote Print

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.

Back to top
View user's profile Send private message
letherial





Joined: 22 Feb 2007
Posts: 9 on topic

Thank you for registering your game
PostPosted: Thu, 27. Nov 08, 10:18    Post subject: Reply with quote Print

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.

Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic Reply to topic Goto page 1, 2, 3, 4, 5, 6, 7, 8  Next
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum
Control Panel
Login Data
The time now is Thu, 19. Oct 17, 11:08

All times are GMT + 2 Hours


Board Security

Copyright © EGOSOFT 1989-2017
Powered by phpBB © 2001, 2005 phpBB Group
Template created by Avatar & BurnIt!
Debug: page generation = 0.70268 seconds, sql queries = 29