Skip to content

Instantly share code, notes, and snippets.

@SquidDev
Last active Sep 10, 2015
Embed
What would you like to do?
Furnace
local furni = {
peripheral.wrap("container_furnace_1"),
peripheral.wrap("container_furnace_2"),
peripheral.wrap("container_furnace_3"),
peripheral.wrap("container_furnace_4"),
}
-- Chest has to smelt on first row, fuel on second, results on third
local container = "container_chest_3"
while true do
for index, name in ipairs(furni) do
-- Pull items to smelt from chest
local contents = name.pullItemRemote(container, index, 64, 1)
-- Pull fuel from chest
local fuel = name.pullItemRemote(container, index + 9, 64, 2)
-- Push product back into chest.
local product = name.pushItemRemote(container, 3)
if contents > 0 then
print(index .. " stocked " .. contents)
end
if fuel > 0 then
print(index .. " refueled " .. fuel)
end
if product > 0 then
print(index .. " produced " .. product)
end
sleep(1)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment