Page 1 of 1

Help with storage chest comparison please!

Posted: Wed Dec 18, 2024 11:31 pm
by Trollvano
I'm currently trying to figure out how to set assemblers to only build an item if the contents on the storage network of 2 items total equal together, is less than a certain amount.
PXL_20241218_230311624.jpg
PXL_20241218_230311624.jpg (4.16 MiB) Viewed 628 times
I have assemblers set to if the value is over 0, then disable.
PXL_20241218_230311624.jpg
PXL_20241218_230311624.jpg (4.16 MiB) Viewed 628 times
So I have this setup, and I KNOW it's wrong and not working at all. But can't figure out for the life of me how to do this. Any help would be greatly greatly appreciated .

Not sure if I need to use decider or arithmetic, but basically, I want the assemblers to turn on and make additional barrels, if the TOTAL number of empty AND crude oil filled barrels is < 3 million. I could only figure out having the separate values of < 3 of each, but once the regular barrels go to curde it will be under 3m and try to make more barrels. Which I don't want. I don't want to over exceed my storage but I want to maintain close to full.

Re: Help with storage chest comparison please!

Posted: Wed Dec 18, 2024 11:51 pm
by Loewchen
The individual comparison is a dead end, if one is 1G and the other is 0 you still do not want to produce more.
What you want to do is add both values, there are several ways to do this, most straight forward is adding them in an arithmetic combinator and outputting the sum on a signal of your choice. Then you can simply set the condition in the assembler for what ever output signal you decided on to be <3M.

Re: Help with storage chest comparison please!

Posted: Thu Dec 19, 2024 4:26 am
by Trollvano
There helpful thank you!

So I got it done by

Network storage went into those 2 arithmetics via red.
Item1 * 1 -- output to whatever signal (X)
Item2 * 1 -- output to same signal

Both go into a decider view red aswell.
X < 3,000,000 -- output X 1

That goes into the assembler via red wires
Enable/disable = X > 0

Send to be working. Though I would pay the solution incase it helps anyone because I'm a simpleton and it took me way to long even with Loewchens help. Thank you again Loewchens!

Re: Help with storage chest comparison please!

Posted: Thu Dec 19, 2024 10:22 am
by Tertius
Trollvano wrote: Thu Dec 19, 2024 4:26 am Network storage went into those 2 arithmetics via red.
Item1 * 1 -- output to whatever signal (X)
Item2 * 1 -- output to same signal
You're able to do this with just 1 arithmetic combinator, since you can simply add both values directly. You don't need to cast them to a common signal before adding them

And now you have the sum in N, so you can use N in the activation condition of the assembler directly. You don't need the intermediate decider. Just wire the output of the arithmetic combinator with the assembler and use N < 3.000.000 as activation condition in the assembler instead of red cross > 0.
12-19-2024, 11-21-41.png
12-19-2024, 11-21-41.png (167.24 KiB) Viewed 532 times

Re: Help with storage chest comparison please!

Posted: Thu Dec 19, 2024 10:25 am
by Trollvano
That must be what he was talking about, but I couldn't figure out how. This is actually incredibly easy lol thank you guys for the help!

Re: Help with storage chest comparison please!

Posted: Thu Dec 19, 2024 10:27 am
by Tertius
Also see my edit to also get rid of the decider. [that's also what Loewchen was talking about]