Page 1 of 1

Count of items in crafting machine

Posted: Sun Jul 02, 2017 9:18 am
by moon69
In a mod, how can I see how many input and output items a crafting machine is holding?

The info is available in the tool-tip, but I can't figure out how to access it programmatically.
Image

Thanks.

Re: Count of items in crafting machine

Posted: Sun Jul 02, 2017 3:38 pm
by DaveMcW

Code: Select all

local input_count = entity.get_inventory(defines.inventory.assembling_machine_input)[1].count
local output_count = entity.get_inventory(defines.inventory.assembling_machine_output)[1].count

Re: Count of items in crafting machine

Posted: Sun Jul 02, 2017 4:51 pm
by moon69
Thanks!