Light progress bar with combinators
Posted: Sat Jan 02, 2016 9:49 pm
Hello everyone,
New player here
For my first combinator experiment, I added a progress bar to my smart assembler line. You set how many of a thing you want with the constant combinator, and when that many are in the chest production stops. The three lamps turn on at 33%, 67%, and 100% completion respectively.
You read it right-to-left (that's just how my factory was laid out). The messiest part is that each good needs to have a corresponding signal channel (belt -> [0], lamp -> [1], etc). That signal contains how many of the good should be made.
There are two parts. The first is the middle divisor combinator, that calculates the "chunk" size for the progress bar (total / number of lamps)
Arithmetic [0] / 3. That then feeds into the multiplication combinators, of which you need 1 per lamp. A decider is also connected to each input.
The Decider combinator is a filter: it needs to strip the original [0] signal from the circuit. It's input is the circuit network that includes the smart chest and the constant combinator (number of goods we want.) It is set up: if belt > 0, output belt count. You need one of these per lamp - if you connect a single one to all three lamps then it mixes up the arithmetic signals.
It's pretty fiddly to set this up right. Not being able to visualize wires easily, nor reset them if I mis-click made for a lot of remaking! I'd like to come up with a better way that allows for > 3 lamps without having to use extra vertical space, and that is easier to set up so I can use on many different chests.
Hopefully this is useful to someone!
Xavier
New player here
For my first combinator experiment, I added a progress bar to my smart assembler line. You set how many of a thing you want with the constant combinator, and when that many are in the chest production stops. The three lamps turn on at 33%, 67%, and 100% completion respectively.
You read it right-to-left (that's just how my factory was laid out). The messiest part is that each good needs to have a corresponding signal channel (belt -> [0], lamp -> [1], etc). That signal contains how many of the good should be made.
There are two parts. The first is the middle divisor combinator, that calculates the "chunk" size for the progress bar (total / number of lamps)
Arithmetic [0] / 3. That then feeds into the multiplication combinators, of which you need 1 per lamp. A decider is also connected to each input.
Code: Select all
Decider (Filter) --+---------------------+-- Lamp ( number of goods >= [0] )
[0] = [0] / 3 ---> [0] = [0] * 1 -/
It's pretty fiddly to set this up right. Not being able to visualize wires easily, nor reset them if I mis-click made for a lot of remaking! I'd like to come up with a better way that allows for > 3 lamps without having to use extra vertical space, and that is easier to set up so I can use on many different chests.
Hopefully this is useful to someone!
Xavier