Is there a mod for count the items (e.g. fuel) that come from a chest
(with pipeworks) and they go to a furnace, so that there is no overflow (99)?
If there is no mod, is it possible to create it ?
local meta = minetest.get_meta(pos)
local inv = meta:get_inventory()
-- Get the width of the current list
local width = inv:get_width("foobar_list")
local items = {}
for i = 1, width do
-- Read stack at position 'i'
local stack = inv:get_stack("foobar_list", i)
if not items[stack:get_name()] then
items[stack:get_name()] = stack:get_count()
else
items[stack:get_name()] = items[stack:get_name()] + stack:get_count()
end
end
-- Output the items
print(dump(items))
Users browsing this forum: No registered users and 13 guests