r/factorio 7d ago

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

8 Upvotes

126 comments sorted by

View all comments

1

u/Tolvinar 2d ago

I have a circuit network question.

Is there a way to have an inserter work only when a chest is full, have it completely drain the chest, and then turn off until it is full again? Ive never used combinators and can't figure out if it's possible or not.

2

u/gHx4 2d ago

Yeah, totally. It's easiest to do with unmixed, single item chests.

First you need to set the inserter to enable when the chest is full. You'll need a stack size selector combinator, and use it to do this formula, where parenthesis are combinators: (each / (stack size)) == chest slots. You will need to sum the value of each signal to get the amount of stacks in the chest. The combinator doing == should output a unique signal value (maybe A) that is not on the item list.

Feed the A signal to a memory cell, a decider combinator with A =/= 0: A input count, and wire the output back to the input. Now, to reset the memory cell, you wire its input to a decider set to Everything == 0: A, and an arithmetic combinator that does A * -1. Inputting -A clears the memory. Now set the inserter to enable itself when A =/= 0

There will be a slight delay (1 tick per combinator) before the inserter turns off when the chest has emptied.

2

u/Tolvinar 2d ago

After searching a bit more I think what I need is called a "latch." It is interesting trying to learn combinators. It might take me some time to learn all this but it seems to have some cool applications in the game.