Skip to content

Instantly share code, notes, and snippets.

@SquidDev
Last active September 10, 2015 20:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SquidDev/fd2fa1938cc2d27e9198 to your computer and use it in GitHub Desktop.
Save SquidDev/fd2fa1938cc2d27e9198 to your computer and use it in GitHub Desktop.
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