How to reset a counter?

Don't know how to use a machine? Looking for efficient setups? Stuck in a mission?
Post Reply
ray4ever
Long Handed Inserter
Long Handed Inserter
Posts: 86
Joined: Sun Jan 12, 2014 9:22 am
Contact:

How to reset a counter?

Post by ray4ever » Tue Jun 28, 2016 6:37 pm

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?

Piumosso
Burner Inserter
Burner Inserter
Posts: 5
Joined: Thu Jun 02, 2016 1:54 am
Contact:

Re: How to reset a counter?

Post by Piumosso » Wed Jun 29, 2016 1:55 am

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.

The Eriksonn
Fast Inserter
Fast Inserter
Posts: 230
Joined: Wed Jun 08, 2016 6:16 pm
Contact:

Re: How to reset a counter?

Post by The Eriksonn » Thu Jun 30, 2016 10:33 pm

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.

User avatar
DaveMcW
Smart Inserter
Smart Inserter
Posts: 2995
Joined: Tue May 13, 2014 11:06 am
Contact:

Re: How to reset a counter?

Post by DaveMcW » Thu Jun 30, 2016 10:35 pm

I use a decider combinator looped to itself, red=0, return everything. Every pulse gets counted, and it resets with a red signal.

The Eriksonn
Fast Inserter
Fast Inserter
Posts: 230
Joined: Wed Jun 08, 2016 6:16 pm
Contact:

Re: How to reset a counter?

Post by The Eriksonn » Thu Jun 30, 2016 10:46 pm

I never thought about that, and it would simplify alot of my stuff since the reset is 1 instead of 0. thx :)

Post Reply

Return to “Gameplay Help”

Who is online

Users browsing this forum: Serenity