How to find out the ingredients an assembling machine is missing?
Posted: Wed Jan 04, 2023 5:30 pm
Once I've got a reference to an assembling machine, is there a way to find out what ingredients it needs to craft its current recipe that it doesn't already have enough of?
I realise "enough" is a rather difficult concept here, as an inserter can put half a dozen of something into a machine and call it enough while a miniloader from the miniloaders mod can put 200 of the same item into the machine before it thinks that is "enough". I'm not really fussy about which of these definitions is used.
To put it another way, if I had an assembling machine and a box with all the ingredients for the current recipe, and an inserter putting the items from the box into the assembling machine, is there a way in Lua code to predict what item the inserter will put into the assembling machine next?
I realise "enough" is a rather difficult concept here, as an inserter can put half a dozen of something into a machine and call it enough while a miniloader from the miniloaders mod can put 200 of the same item into the machine before it thinks that is "enough". I'm not really fussy about which of these definitions is used.
To put it another way, if I had an assembling machine and a box with all the ingredients for the current recipe, and an inserter putting the items from the box into the assembling machine, is there a way in Lua code to predict what item the inserter will put into the assembling machine next?