Is it possible to read recipe and contents from a machine *separately*?
Posted: Sat Mar 22, 2025 12:21 pm
by pf_moore
I'm trying to manage my biter eggs, so I want to see how many crafts my production module assembler can craft, and request precisely that many eggs.
I can do this with two assemblers - from one (a dummy), I read the recipe, and from the other (the actual crafter) I read the contents. The I divide contents by recipe (arithmetic combinator), take the minimum (selector combinator), and convert it to egg requests (arithmetic combinator). But that extra assembler is a problem - in terms of the wasted machine, the space needed, and the fact that I need to set the recipe twice.
Is it possible to read both the recipe and the contents from one assembler, but keep them distinct (have one on a red wire and the other on a green wire)? I couldn't find a way, unfortunately. Or alternatively, is there another way of getting the recipe for an item *without* setting it in an assembler and reading it from there?
I could of course, just hard code the recipe into a combinator, but if I do that I can't copy the construction for the various qualities, without a bunch of work. Which I'll do if I have to, but I'm lazy
Re: Is it possible to read recipe and contents from a machine *separately*?
Re: Is it possible to read recipe and contents from a machine *separately*?
Posted: Sat Mar 22, 2025 2:25 pm
by pf_moore
Ah, cool, thanks. I'll try to do it with a parametrised blueprint - I think the p0_i1 style variables might be a possibility here, although when I tried earlier I got *very* confused.
Re: Is it possible to read recipe and contents from a machine *separately*?
Posted: Sat Mar 22, 2025 3:14 pm
by NineNine
I ran into this problem too, but I ended up working around it. I honestly don't remember what it was, but it had something to do with nutrients that were an ingredient (and a fuel).
Re: Is it possible to read recipe and contents from a machine *separately*?
Posted: Sat Mar 22, 2025 3:54 pm
by eugenekay
Yes, but also No:
Screenshot 2025-03-22 114803.png (906.92 KiB) Viewed 2574 times
Introducing.... the Unpossible Crafter! Basic operating idea, see also the Description of each Combinator inside the Blueprint:
When the Memory Cell is empty, waits for a Read Ingredients Input signal
Stores this Input Signal on the Red Wire on the pole
Listens for the Read Contents (without Include in Crafting, adjust to taste) signal
Subtracts the stored Ingredients to obtain Current Contents as the Green Wire on the Pole
Selector Combinators setup Inserter Filters to ensure the Machine is only loaded once the Circuit is ready.
If the Input Signal goes to zero (Recipe was Unset), or has different Items from the Ingredients (Recipe Changed) then the Memory Cell is cleared
I hope this helps!
Re: Is it possible to read recipe and contents from a machine *separately*?
Posted: Sat Mar 22, 2025 5:51 pm
by Tertius
eugenekay wrote: Sat Mar 22, 2025 3:54 pm
the Unpossible Crafter!
Impossible Crafter.
As far as I understand, it reads the signal from the assembler and uses the fact the first tick the recipe is set the assembler is still empty and just outputs the recipe ingredients. This signal is stored independently and subtracted from later readings to continuously reconstruct the actual assembler content. Nice idea!
Re: Is it possible to read recipe and contents from a machine *separately*?
eugenekay wrote: Sat Mar 22, 2025 3:54 pm
the Unpossible Crafter!
Impossible Crafter.
As far as I understand, it reads the signal from the assembler and uses the fact the first tick the recipe is set the assembler is still empty and just outputs the recipe ingredients. This signal is stored independently and subtracted from later readings to continuously reconstruct the actual assembler content. Nice idea!
UnPossible - I made it; I get to name it.
Yes, it uses the "First Tick Output" when first-stamped down to fill the Memory Combinator. However, this alone is not reliable! You need to set the Inserter Filters based upon the Ingredients Signal alone (optionally using Selector Combinators to split the ingredients, for throughput). If you do not, then changing Recipes will break the setup - Items can get inserted before the Memory Combinator has Reset/ReFilled.... so you'll get a slightly-wrong Ingredient Count.
Off-by-one errors matter when trying to count Eggs.
Re: Is it possible to read recipe and contents from a machine *separately*?
Posted: Fri Jun 12, 2026 5:19 am
by Robro0625
Have 2 relevant blueprints to share
These are mainly for people who find themselves here after a google search since the original question is quite old.
The Unpossible assembler but compacted (3 assemblers vs 5)
I embedded the clearing mechanism into the memory cell directly Making it a bit smaller.
This one works by reading the inserters attached to the assembler and reading the assembler itself to check when its done crafting to remove the ingredients from the cache.
This uses 4 combinators (3 if you're willing to put up with the negated memory cell which may be beneficial. i.e in my use case I wanted something to stop my automall from storing hundreds of extra ingredients in the assembler, and I can subtract the stored value by just mixing the wires)
It can handle changing recipes however productivity modules will break it, as will productivity in general.
I Attached a bunch of these to my automall and except for some issues at the start from improper setup they haven't broken yet.
Edit: they now have see below
Edit: So there is a bug, Basically when a dynamically assigned recipe stops being assigned mid-craft the assembler doesn't output the recipe the same tick as the finish signal so I added another combinator to fix it basically it just delays the recipe by one tick and gives it to the other combinator that checks if the assembler is finished.
Fixed blue print: