-
-
Save SquidDev/fd2fa1938cc2d27e9198 to your computer and use it in GitHub Desktop.
Furnace
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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