Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local coal = "minecraft:chest_269"
- local input = "minecraft:chest_270"
- local output = "minecraft:chest_271"
- local self = "turtle_157"
- local furnaces = {}
- local periphs = {}
- for k, v in pairs(peripheral.getNames()) do
- periphs[v] = peripheral.wrap(v)
- end
- for k,v in pairs(periphs) do
- if k:find("furnace") then
- furnaces[#furnaces + 1] = k
- end
- end
- print("loading coal")
- for k,v in pairs(periphs[coal].list()) do
- periphs[coal].pushItems(self, k, v.count, 1)
- for i = 1, v.count do
- periphs[furnaces[math.random(1, #furnaces)]].pullItems(self, 1, 1, 2)
- end
- sleep(0.1)
- periphs[coal].pullItems(self, 1, 64)
- end
- print("load input")
- for k,v in pairs(periphs[input].list()) do
- local times = math.floor(v.count / 7)
- if times > 0 then
- periphs[input].pushItems(self, k, times * 7, 1)
- for i = 1, times do
- periphs[furnaces[math.random(1, #furnaces)]].pullItems(self, 1, 7, 1)
- sleep(0.1)
- end
- periphs[input].pullItems(self, 1, 64)
- end
- end
- print("collecting output")
- for i = 1, #furnaces do
- local inputper = periphs[furnaces[i]]
- local outputper = periphs[output]
- inputper.pushItems(self, 3, 64, 1)
- outputper.pullItems(self, 1, 64)
- sleep(0.1)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement