Page 1 of 1

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*?

Posted: Sat Mar 22, 2025 1:37 pm
by NineNine
No, not right now, it isn't: 117032

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
Screenshot 2025-03-22 114803.png (906.92 KiB) Viewed 632 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*?

Posted: Sat Mar 22, 2025 7:49 pm
by eugenekay
Tertius wrote: Sat Mar 22, 2025 5:51 pm
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. :D

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. :twisted: