Space Engineers

Space Engineers

122 ratings
[UPD 07/2017] Cargo Inventory Sorter
   
Award
Favorite
Favorited
Unfavorite
File Size
Posted
Updated
2.629 KB
1 Jan, 2015 @ 5:22pm
2 Jul, 2017 @ 6:32pm
6 Change Notes ( view )

Subscribe to download
[UPD 07/2017] Cargo Inventory Sorter

Description
Updated 07/2017!

01/03/2015 Important Update notes:
The script became much more complex, so if someone gets "script is too complex" error, please report.
Now it's possible to use types. Adding "all", "ore", "ingots", "tools" or "components" will make the inventory collect all items of that type. It's also possible to exclude some items or types by using "-" (minus) sign.
Examples:
$ore -stone (Collects all types of ores except for stone)
$all -tools -components (Collects everything except character tools and building components)
$ore ingots (The same as above)
$ingots ore -stone:ore -uranium:ingot (Collects all ingots and ores except for raw stone and refined uranium)

Also, the script works with blocks with more than one inventories. You need to use "|" symbol to separate inventories. Refineries, arc furnaces and assemblers have the "input | output" pattern.
Examples:
$ores | $iron:ingot (Collects all ores, but keeps only iron ingots)
|$ (Doesn't do anything with the input and keeps the output empty. This pattern is useful for cooperative assemblers)
$iron nickel cobalt -ingot (Takes all the specified ores, and doesn't do anything with the output. This is useful for arc furnaces. Although they don't take ingots, the script will try to push iron ores also, if you don't specify otherwise)

The special characters can be changed in the beginning of the script.

Requirements:
Programmable block x1
Timer block x1
Extra container for unsorted items x1

Usage:
The script sorts items in separate cargo containers.

Load the script into your programmable block, connected to the grid. Then set a timer block to run the program every two seconds and to start the countdown again. Name one container "#OTHER". This container will collect items that cannot be sorted and will act as an intermediate container.

If you want to make a cargo container sortable, it name must start with "$" and contain types and names of the items you want to store there. For example, "$Gold Iron ore Thrust LargeTube" will collect All ores, Gold and Iron ingots, Thrust and Large Tube from other containers, while will drop other items to the "#OTHER" container(name of the extra container can be changed in the script).
Containers whose names don't start with "$" won't be sorted. You also need to know the exact item name.

You still can have any description in the name. The inventory will be sorted as long as the name starts with "$". "$Small Cargo Container ingots" will work.

Feel free to ask any questions.

Known issues (To be fixed ASAP):
-The script doesn't check availabe space in inventories
-The script doesn't check if the inventory supports the item
-The script works with the entire grid and there is no way to separate it in sorting subsystem.

Past updates:

Updated 01/02/2015:
+Added support for lower case names
+Added support for drills, grinders, welders, connectors, collectors, ejectors and reactors.

Updated 01/02/2015:
+Added support for turrets, gatling guns and reloadable rocket launchers
+Fixed issue with "Sandbox.ModAPI.MyInventoryItem"

Updated 01/02/2015:
+Added support for all block with inventories
+Added support for types(ingots, ores, tools, components, all)
+Added support for specifying the type of an item(iron:o(re), stone:i(ngot))
+Added support for ignoring blocks(- sign)
+Added support for blocks with two inventories such as assemblers, refineries and arc furnaces (Use "|" to separate description of inventories)
*Thanks Rime Burst for help with testing
132 Comments
kinngrimm 15 Apr @ 5:51am 
is this still working?
Shrike 9 Jan, 2018 @ 4:30pm 
i got "script is too complex" error right now
Lord Syanide 26 Oct, 2017 @ 8:00am 
Is there an updated complete item name list? I saw in the video to use the comman components.sbc but am unsure where to enter that? Any help would be appreciated!
Эльфик 3 Jul, 2017 @ 12:08am 
hooray
Sakata 8 May, 2016 @ 11:02pm 
Can someone update this, if it's not already being updated? Can't find a decent replacement anywhere....
ente_legent 15 Apr, 2016 @ 7:06pm 
can somebody fix that?
VORG 2 Mar, 2016 @ 4:52am 
CIS SCUM!...haha sorry I had to
Kilstr 29 Nov, 2015 @ 4:55pm 
Please fix the script before I worked. But now the planets are not.
mar3usmc 7 Jun, 2015 @ 11:19am 
I think we can all consider this mod abandoned as it has not been updated since January.
Uncle Mel 11 Apr, 2015 @ 12:08pm 
@Alduin041, check the second to last page of the comments