Page 1 of 1

How to reset a counter?

Posted: Tue Jun 28, 2016 6:37 pm
by ray4ever
Hi,

with 0.13 out it is fairly easy to make an item counter. Just connect your inserter/belt to a arithmetic combinator and wire the result back in (e.g. A + iron plates = A). But how do I reset the counter?

For example i would like to count 2 Iron Plates, wait till a trigger condition is met (so reset the counter), and than count another 2 Iron plates. Any ideas?

Re: How to reset a counter?

Posted: Wed Jun 29, 2016 1:55 am
by Piumosso
Only way that I have tried is to wire in an arithmetic combinator gives the negative of the current value, i.e. (A * -1 => A), then wire that back into your (A + iron plates => A) input. But then, you only want that to happen for a single tick, so you really want (A * B => A) where B pulses to -1 for a single tick on your trigger condition.

Re: How to reset a counter?

Posted: Thu Jun 30, 2016 10:33 pm
by The Eriksonn
Since the network adds by itself I usually do iron * green = iron and then just dump in the iron on another wire, and then just remove green to reset.

Re: How to reset a counter?

Posted: Thu Jun 30, 2016 10:35 pm
by DaveMcW
I use a decider combinator looped to itself, red=0, return everything. Every pulse gets counted, and it resets with a red signal.

Re: How to reset a counter?

Posted: Thu Jun 30, 2016 10:46 pm
by The Eriksonn
I never thought about that, and it would simplify alot of my stuff since the reset is 1 instead of 0. thx :)