I've been working on my freighter script (which I initially posted to the wong place, D'oh) and had a bit of a rethink about how it should work. The script now works around the concept of commands which you pass to it on the command line. There are currently only two commands but they provide you with the power to have the freighter take care of a lot of your legwork.
Coming up - a lot of babble. If you want to jump straight in go and see the usage examples somewhere near the bottom!
The two commands currently supported are from and go.
from: This will haul items from a list of source stations to a destination station
N.B. You always have to specify source bookmarks even if you're at the station you want to haul from, this is because I don't want to play around with creation/removal of bookmarks since it's currently a little bugged. However as a consolation prize you now get the feature that you don't have to be in any of the systems you want to haul from
Usage: from <source_list> <items_list> <dest>
Where:
go: Simply goes to a destination station
Usage: go <dest>
Where: dest = destination bookmark
The commands to run are passed to the script via the command line when the script is run. The script usage is:
MultiFreight <command> <parameters ...> [<command> <parameters ...> ...].
You can string as many commands together as want, this enables the script to be able to
haul multiple different items from different stations to different (or the same) destinations.
A note on lists – A list is simply a list of strings that are delimited with the | character. If any of the items in the list contain spaces then the WHOLE list must be enclosed within quotes. That is to say these lists are fine:
item1|item2|item3 - no quotes necessary
“item with space|item2|item3” - contains spaces, must enclose the list within “"
Whereas this isn't
item with spaces|item2 - contains spaces, needed to be enclosed within ""
As a general rule if you're not sure just enclose all lists within quotes.
The from command item list
The items within this list can begin with a * or ^ character, these characters cause the item which they prefix to be treated as a search string. The * character will match the item if its name is found anywhere in the name of the items, the ^ character does the same find except the item will match if it isn't found. i.e. It's an exclusion filter.
The item list can also simply be all if you want to match all items.
Examples of item lists:
“civilian shield booster i|*veldspar” - will match the civilian shield booster I or anything containing the word veldspar.
“^veldspar” - will match any item not containing the word veldspar
“all” - will match all items
Usage examples
The following will take any items from bookmark's bm1, bm2 and bm3 that is a templar or contain the word hardener to bm4 once finished the bot will proceed to the 'home' bookmark
The following will take anything containing the word veldspar from bookmark bm1 to bm2 then anything NOT containing pyerite from bm3 to bm4 once finished it will stay at the last system it dropped off goods at. This is also an example of stringing 2 from commands together
This one shows how you can just keep stringing commands together. It will haul everything from mining1 and mining2 to sell1, everything except things containing the word gravimetric from trade1, trade2 and trade3 to sell1, anything containing the words alloyed or micro from missions to ind1 and finally go to home_system then (for no good reason at all) go to daft_place
NOTES
Hopefully this will prove useful to others, it is certainly making my life easier. Any feedback would be welcome whether it's to report bugs, constructive criticism or feature requests. There still some things I plan to add to this in the near future myself:
DISCLAIMER
I wrote this script for my own use, I'm posting it to give something back to the community on the off-chance that someone else finds it, or anything contained within it useful for any purpose. I haven't tested it extensively and if something doesn't work as expected I wouldn't be entirely surprised.
Coming up - a lot of babble. If you want to jump straight in go and see the usage examples somewhere near the bottom!
The two commands currently supported are from and go.
from: This will haul items from a list of source stations to a destination station
N.B. You always have to specify source bookmarks even if you're at the station you want to haul from, this is because I don't want to play around with creation/removal of bookmarks since it's currently a little bugged. However as a consolation prize you now get the feature that you don't have to be in any of the systems you want to haul from
Usage: from <source_list> <items_list> <dest>
Where:
source_list = token delimited list of source bookmarks
item_list = token delimited list of items to freight (more on this list later)
dest = destination bookmark
item_list = token delimited list of items to freight (more on this list later)
dest = destination bookmark
go: Simply goes to a destination station
Usage: go <dest>
Where: dest = destination bookmark
The commands to run are passed to the script via the command line when the script is run. The script usage is:
MultiFreight <command> <parameters ...> [<command> <parameters ...> ...].
You can string as many commands together as want, this enables the script to be able to
haul multiple different items from different stations to different (or the same) destinations.
A note on lists – A list is simply a list of strings that are delimited with the | character. If any of the items in the list contain spaces then the WHOLE list must be enclosed within quotes. That is to say these lists are fine:
item1|item2|item3 - no quotes necessary
“item with space|item2|item3” - contains spaces, must enclose the list within “"
Whereas this isn't
item with spaces|item2 - contains spaces, needed to be enclosed within ""
As a general rule if you're not sure just enclose all lists within quotes.
The from command item list
The items within this list can begin with a * or ^ character, these characters cause the item which they prefix to be treated as a search string. The * character will match the item if its name is found anywhere in the name of the items, the ^ character does the same find except the item will match if it isn't found. i.e. It's an exclusion filter.
The item list can also simply be all if you want to match all items.
Examples of item lists:
“civilian shield booster i|*veldspar” - will match the civilian shield booster I or anything containing the word veldspar.
“^veldspar” - will match any item not containing the word veldspar
“all” - will match all items
Usage examples
The following will take any items from bookmark's bm1, bm2 and bm3 that is a templar or contain the word hardener to bm4 once finished the bot will proceed to the 'home' bookmark
Code:
MultiFreight from bm1|bm2|bm3 *hardener|templar bm4 go home
Code:
MultiFreight from bm1 *veld bm2 from bm3 ^pyerite bm4
Code:
MultiFreight from mining1|mining2 all sell1 from trade1|trade2|trade3 ^gravimetric sell1 from missions *alloyed|*micro ind1 go home_system go daft_place
NOTES
Hopefully this will prove useful to others, it is certainly making my life easier. Any feedback would be welcome whether it's to report bugs, constructive criticism or feature requests. There still some things I plan to add to this in the near future myself:
- A nice GUI system to make the whole thing a lot more user friendly rather than wrestling with the commands.
- Add some rudimentary defences especially the ability to try to mwd/cloak out of trouble.
DISCLAIMER
I wrote this script for my own use, I'm posting it to give something back to the community on the off-chance that someone else finds it, or anything contained within it useful for any purpose. I haven't tested it extensively and if something doesn't work as expected I wouldn't be entirely surprised.
Attachments
-
5.8 KB Views: 216
Last edited: