## Copy counter value on signal

Don't know how to use a machine? Looking for efficient setups? Stuck in a mission?
ShyLion
Burner Inserter
Posts: 11
Joined: Fri Jan 22, 2021 7:43 am
Contact:

### Copy counter value on signal

Hi. I have a circling belt with items A and one item R.
My counter counts A and resets on R.
I can put another item S right before R.
Is there any way to save A value on S pulse, right before A resets?

Amarula
Filter Inserter
Posts: 398
Joined: Fri Apr 27, 2018 1:29 pm
Contact:

### Re: Copy counter value on signal

If there will be only one item S, use an arithmetic combinator with inputs A and S, outputs A x S: if S is zero, output is zero, otherwise, it outputs A...
Luck is not a robust control.

mmmPI
Filter Inserter
Posts: 839
Joined: Mon Jun 20, 2016 6:10 pm
Contact:

### Re: Copy counter value on signal

I'm not sure it's the best way but i made this :
I
beltcircling2.jpg (428.19 KiB) Viewed 287 times
copper plate is item A
iron plate is item R
red belt is item S

Combinator A i suppose is what you have already to count.

B is a decider that let through the number of copper plate from the counter A only when red belt>0

C is a decider that will loop the total amount of copper, that's where you read the total amount of copper plate

Rest is a way to manually reset the save because otherwise it will add up the number everytime.

it should be made different if you want to only save once and then disable the counter, or if you want to reset it everytime there is an S item. ( which in the latter case i didnt see the point, since the counter A already reset everytime).
beltcircling 2.zip

DaveMcW
Smart Inserter
Posts: 3509
Joined: Tue May 13, 2014 11:06 am
Contact:

### Re: Copy counter value on signal

Here is my solution, which uses the same item for save and reset.

The arithmetic combinators stop saved values from adding together. If you want them to add, it can be done in 3 combinators.

copy_counter.jpg (167.91 KiB) Viewed 286 times

ShyLion
Burner Inserter
Posts: 11
Joined: Fri Jan 22, 2021 7:43 am
Contact:

### Re: Copy counter value on signal

DaveMcW wrote:
Thu Oct 14, 2021 12:51 pm
Here is my solution, which uses the same item for save and reset.
Thanks! It works!