Space Engineers

Space Engineers

[UPD 07/2017] Cargo Inventory Sorter
132 Comments
kinngrimm 15 Apr, 2024 @ 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
se7en 9 Apr, 2015 @ 2:02pm 
would be nice if u add sort of $components:1000 so it will keep only UP to 1k of every component... or maybe there is other script to allow for example moving items to welder ship (selected amount, not all obviously)
r Cubed3 11 Mar, 2015 @ 6:42am 
@mrraybaker the script will only touch containers/processing units that begin with "$", if you only have $ with no wildcards, it will try to keep said container empty at all times

the script seems crash if #OTHER becomes full, and i have not had success with sorting a items into multiple containers... best work around i've found is the Large Azimuth container as "#OTHER"
HisEvilness 10 Mar, 2015 @ 7:07pm 
Sorry does not work, even tried to make a setup that is a copy of the screenshot.
Does not sort, restart script, restart game, turn of the whole factory etc etc.
-CML- Alduin041 8 Mar, 2015 @ 4:58pm 
Can someone please paste all known terms used for sorting (such as: Ammo ETC...)
raymazoida 8 Mar, 2015 @ 2:04pm 
Not sure why but this just doesn't seem to be working properly.

I have the timer set up, running the script every 2 seconds, I have a #OTHER container, a $ore and a $components

I also have another large container that had a load of stuff in it

Nothing gets moved out of the large container, no components get moved to $ components, either from the other cargo or from my assemblers, the only thing it does do is move ingots to #OTHER

Am I doing somthing wrong?
NameEnterer 7 Mar, 2015 @ 2:12am 
Wouldn't it be possible with this idea of sorting the cargo to programm a mining drone which only collects one kind of ore? Like mining a tunnel till the drills dont get any more iron an then drilling to the sides to look if theres some iron, then rotating and mining in the new direction?
Lighted Shadows 6 Mar, 2015 @ 6:45pm 
Can I have more than 1 cargo container collect that same ore like $ CargoL1 Iron:ore and $ CargoL2 Iron:ore ?
mar3usmc 4 Mar, 2015 @ 8:37am 
Tried to get this to work for over an hour, and have given up. As it has been reported in the past, the unsorted container just fills up and does not then organize anything into the labeled containers.

I think the idea of using an unsorted container as a go between is a very bad idea and seems to be breaking this script. It simply does not work for me.

Consider that I have 26 Large Cargo Containers. The unsorted simply fills up, and then nothing happens. I tried the "all" thing with the other containers, nothing happens.

I haven't seen the author respond in a great deal of time. Seems abandoned.
starman01 4 Mar, 2015 @ 3:14am 
Anyone can tell me how I can control my refineries with that ? Sorting sofar works great, but the refinieres don't work correctly...

Example :

One of my refineries (an arc furnace) has vanilla settings to grab iron, nickel and cobalt...

I set it up this way :

$Arc furnace 2 ore iron -nickel -cobalt | $

So this one should refine iron, but ignore the other two. But let's say I have no raw iron, the furnace still collects the nickel (vanilla behaviour) and starts refining for 1 seconds, and then this script here kicks in and withdraw the nickel ore again.... So vanilla code and this script are constantly fighting over the ore, which results in an extrem slow production (because the furnace can only refine for 1 second every 5 seconds)..

Can this be even controlled ? the problem is much worse with the large refinieries since they are allowed to do everthing.
Lumios 1 Mar, 2015 @ 11:56am 
Will this sort ammo by type?
Lumios 1 Mar, 2015 @ 11:45am 
It would be helpful if you defined all the labels you use to sort. For example...listing all the ores, listing all the ingots, so we know your default terminology.
amsedal 26 Feb, 2015 @ 12:58pm 
is it possible to also add, say I want a certain amount to stay in a container ... 500 of this and 200 of that and 4000 of this other thing ? basicly my build box with a little bit of everything in it... - great script, cant wait for more, thanks!
hors of discordia 20 Feb, 2015 @ 12:30pm 
lcd screem!!! use it! to display the total of resource, pleace XD
Damaged Geeenius 19 Feb, 2015 @ 6:57pm 
It doesn't seem to like cooperative assemblers. I've tried "|$" as their name and a few other combinations but it doesn't seem to actually pull inventory from them.
Maspien 13 Feb, 2015 @ 12:33am 
staman it will not take from the refiners at all if you don't name the refiners. The script never touchs the input of a assembler/refiner unless you tell it to.
hors of discordia 8 Feb, 2015 @ 1:26pm 
seria genial colocar prioridades!
asi se podria hacer convoy de carga y descarga
starman01 8 Feb, 2015 @ 6:38am 
Hi,

i'm completly new to all this programming stuff... Since my base has become quite big, I would like to have my inventory sorted automatically (I would do it manually, but the list scrolling is getting longer and longer).

I'm not fully sure how to use this, but according to the explanation I should get along.

However, there is one thing unclear to me and I would like to have that checked first.

When I make one container to select "$ ore" so that it stashes everything not refined yet, and what doesn't fit into the inventory of my refiners, but my refiners already automatically fetch ore from the storage (vanilla, without your script), wouldn't I create a big loop ?

The container would try to collect the ore, and will also take it from the refiner, while the refiner then takes it back from the container.... How do I prevent that ?

Thanks for helping :)
Maspien 28 Jan, 2015 @ 4:11am 
Works great but I have a question. Is it possible to tell connectors to not grab items with this? I was looking to set up a system where the ore stays all together and once processed it gets pushed into a assemby area. Once something is made then it gets pushed to a final cargo container that I can pull from when I need stuff.

As of right now the connectors just grab everything and throw them out. You can make a loop but it defeats the purpose of the sorter.
DontBlameMe 26 Jan, 2015 @ 5:46pm 
Works great for me, thank you very much
Spiritwind 15 Jan, 2015 @ 8:36pm 
Working fine on my dedicated server.
Beach-Brews 15 Jan, 2015 @ 8:30pm 
Awesome! Thanks for the script. It has helped me with learning how to modify inventories using the programming block! I was trying to do something using assemblers and welders and couldn't figure out how to get their invetories. I am keeping it around just to keep organized!

However, as a suggestion, try and look into using Regular Expressions instead of using multiple string splits. It would also really help cut down the number of instructions in the "ParseInventoryString" method. Let me know if you want some help!
Capitalist 14 Jan, 2015 @ 7:46am 
Mister Goldstein thanks you for helping him sort all his valuable gems!
CoffinDodger 14 Jan, 2015 @ 7:44am 
Working as long as none of the continers gets full (which happens very often!)

Could you add more code comments to the next version? It might be easier for us to help you debug it and give feedback - something I'd be happy to help with if you need.
Morvar 13 Jan, 2015 @ 4:23am 
Didn't really work here either on dedicated server. Good potential though.
Foximion 13 Jan, 2015 @ 3:19am 
Автор вроде понимает русский)
В общем, если две дуговые печи назвать "$Дуговая печь 1 iron:ore |$" и "$Дуговая печь 2 iron:ore |$", то скрипт игнорирует вторую дуговую печь. Это можно как то исправить, либо это ограничение скрипта?

На всякий случай по нерусски затранслейтю)
----------------
If two arc furnaces give names: "$Arc furnace 1 iron:ore |$" and "$Arc furnace 2 iron:ore |$", then the second arc furnace is not processed by the script. Can fix it?
Wolfgang0117 11 Jan, 2015 @ 7:28pm 
@SkullBrother / Everyone: From what I understand use just a $ before the inventory name for the inventory to be considered for sorting. Used it on my 27 small drill miner containers and they emptied out into the corresponding large container on my large ship as my refineries were already full. Worked Beautifully.
Wolfgang0117 11 Jan, 2015 @ 7:23pm 
very good but does the system work where multiple inventories are all wanting to sort the same items. Like for instance 9x cargo containers (inventories) are all set to collect all the stone. Does each of the inventories share the stone or will only one container be sorted. I see massive utilization of this mod coming from me and my rather large group that plays Space Engineers. - [1COG] Griswaldwolfgan
The Great Ricktator 11 Jan, 2015 @ 4:56pm 
Had a little trouble figuring out at first but once I did it worked like a dream, its a very handy script
ChoMar 11 Jan, 2015 @ 6:37am 
No succes here either on a dedicated server
Ghost Catus 10 Jan, 2015 @ 1:51pm 
Can someone do a video tutorial on how this is supposed to work? I have alot of stuff in the #Other container and it's not sorting it to the proper places on my mothership. I have 6 Refineries, 4 Arc Furnaces, 4 Cargo Containers, and 2 Assemblers to handle all types of items, but nothing ever moves.
Drakeniir 10 Jan, 2015 @ 10:19am 
If I say, wanted to set some containers so that they were sorted but allowed no contents (for instance, when docked to a station, the containers would automatically empty) is that possible? I tried #OTHER but it didn't seem to work..
Caboose -1 9 Jan, 2015 @ 11:22pm 
ive tried dedicated servers.friends, self host, simple orders. complex orders. it just refuses to move for me. if anyone has any other troubleshooting ideas let me know please. i loved it when it did work.
Caboose -1 9 Jan, 2015 @ 10:10pm 
I've tried all flavors of ownership. no dice.... I've had it working before.... and beautifully at that.
Sakata 9 Jan, 2015 @ 9:31pm 
caboose - you probably need it set to owner='Me'. I'm really looking forward to the next bit of updates. This script is imho much better than the other one I've used from the workshop, and seems much more configurable.
Caboose -1 9 Jan, 2015 @ 9:20pm 
the scripit is running. but nothing is being moved. also have checked. and nothing is full. also everything is set to ownership nobody
Caboose -1 9 Jan, 2015 @ 6:20pm 
then.... i don't know
Gardentwine 9 Jan, 2015 @ 5:54pm 
i using it now and it works fine
Caboose -1 9 Jan, 2015 @ 5:26pm 
did the latest update break it. i can't seam to get it working. had it working before
Gardentwine 9 Jan, 2015 @ 4:40pm 
Great script Borg, just missing Amount of Item and Overide command would be very usefull for Fine tunning the assembler and refinery
Karelzarath 8 Jan, 2015 @ 11:29pm 
I fixed the bug where the script stops moving items when it hits a full container. Simply replace line 173 with the following:

var amount = otherItems[j].Amount;

if (amount <= 0)
{
//We moved it all!
break;
}

By default, the TransferItemTo method willl only move as much as it can. If you keep trying successive containers, either they will all fill up or you'll move it all. In light of this, you can also remove the "amount" parameter from CanCarry()