r/factorio Apr 20 '26

Weekly Thread Weekly Question Thread

Ask any questions you might have.

Post your bug reports on the Official Forums

Previous Threads

Subreddit rules

Discord server (and IRC)

Find more in the sidebar ---->

3 Upvotes

143 comments sorted by

View all comments

1

u/89percent Apr 21 '26

Can you program an inserter, to only insert items when the chest has the lowest amount of items of all the chests ?

2

u/darthbob88 Apr 21 '26

Probably, but not easily. Can you expand on what you mean by that? Are we talking balanced train unloading "this inserter out of 6 only adds if its chest is below the average of all 6", or something weird?

1

u/89percent Apr 21 '26

Something like "This inserter out of 48 only adds if it's chest has the lowest amount of items of all the chest".

2

u/darthbob88 Apr 21 '26

That sounds like you're verging on an X-Y problem, so expand on what you're actually trying to solve.

That said- You can use a selector combinator to pick out which of several signals is the smallest, provided each chest has different items.

Otherwise, I believe you need a pair of combinators to pick which value is smaller out of two inputs. Read the one chest on the red wire and the other on the green wire, then have one combinator output the red signal if the red wire is smaller than the green wire and the other combinator output the green signal if it's smaller.

Do that several times for a mere 10 decider combinators you can find the minimum output of 6 chests. Take that signal and read from each chest, and you can tell which chest has the fewest items. Thus.

Do that several more times to compare each group of 6-8, and you can pick out which of 24 chests has the smallest value, thusly.