Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local args = {...}
- local blocks = args[1]
- function checkForLava(direction)
- if direction == "up" then
- local success, data = turtle.inspectUp()
- if success then
- if data.name == "minecraft:lava" or data.name == "minecraft:flowing_lava" then
- turtle.place()
- end
- end
- elseif direction == "down" then
- local success, data = turtle.inspectUp()
- if success then
- if data.name == "minecraft:lava" or data.name == "minecraft:flowing_lava" then
- turtle.place()
- end
- end
- elseif direction == "front" then
- local success, data = turtle.inspect()
- if success then
- if data.name == "minecraft:lava" or data.name == "minecraft:flowing_lava" then
- turtle.place()
- end
- end
- end
- end
- function refuel()
- for i = 1, 16 do
- turtle.select(i)
- if turtle.getItemDetail() then
- local slot = turtle.getItemDetail()
- if slot.name == "minecraft:coal" then
- turtle.refuel()
- break
- end
- end
- end
- end
- function checkLeftRight()
- turtle.turnLeft()
- checkForLava("front")
- turtle.turnRight()
- turtle.turnRight()
- checkForLava("front")
- turtle.turnLeft()
- end
- for i = 1, blocks do
- refuel()
- if turtle.detect() then
- turtle.dig()
- end
- turtle.forward()
- if turtle.detectUp() then
- turtle.digUp()
- end
- if turtle.detectDown() then
- turtle.digDown()
- end
- checkLeftRight()
- turtle.down()
- checkLeftRight()
- checkForLava("down")
- turtle.up()
- turtle.up()
- checkLeftRight()
- turtle.down()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement