Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local inventory = require("component").inventory_controller
- local side = require("sides").front
- local fuel_names = { ["minecraft:coal"] = true, ["minecraft:planks"] = true, ["minecraft:log"] = true, ["minecraft:blaze_rod"] = true, ["minecraft:lava_bucket"] = true}
- local function getCoal(stack_info)
- if computer.energy() <= 200 then
- robot.select(5); robot.drop(); robot.select(16); robot.drop()
- robot.select(14); robot.place(); robot.select(15)
- return fuel_names[stack_info]
- end
- for slot=1,27 do
- local item = inventory.getStackInSlot(side, slot)
- if item and fuel_names[item.id] then
- inventory.suckFromSlot(sides.front, slot)
- break
- end
- end
- robot.select(16); inventory.dropIntoSlot(side, 1); robot.select(5); robot.swing(); robot.transferTo(14)
- end
- getCoal("minecraft:planks")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement