Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function setup()
- turtle.refuel()
- end
- function goFront()
- if turtle.detect() then
- local success, data = turtle.inspect()
- if success then
- if data.name == "minectaft:water" or data.name == "minecraft:lava" then
- turtle.select(3)
- turtle.place()
- turtle.select(1)
- end
- end
- turtle.dig()
- end
- turtle.forward()
- if turtle.detectUp() then
- local success, data = turtle.inspectUp()
- if data.name == "minectaft:water" or data.name == "minecraft:lava" then
- turtle.select(3)
- turtle.placeUp()
- turtle.select(1)
- end
- turtle.digUp()
- end
- if turtle.detectDown() then
- local success, data = turtle.inspectDown()
- if data.name == "minectaft:water" or data.name == "minecraft:lava" then
- turtle.select(3)
- turtle.placeDown()
- turtle.select(1)
- end
- turtle.digDown()
- end
- end
- function mainLoop()
- setup()
- while turtle.getFuelLevel() > 1 do
- print(turtle.getFuelLevel())
- goFront()
- turtle.turnLeft()
- for i = 10,1,-1 do
- goFront()
- end
- turtle.turnLeft()
- turtle.turnLeft()
- for i = 21,1,-1 do
- goFront()
- end
- turtle.turnLeft()
- turtle.turnLeft()
- for i = 11,1,-1 do
- goFront()
- end
- turtle.turnRight()
- goFront()
- goFront()
- turtle.select(2)
- turtle.turnLeft()
- turtle.dig()
- turtle.place()
- turtle.turnRight()
- end
- mainLoop()
- end
- goFront()
- mainLoop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement