Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function refuel()
- while turtle.getFuelLevel() < 40 do
- turtle.refuel()
- end
- end
- refuel()
- function dig()
- turtle.dig()
- turtle.forward()
- end
- function CheckLeft()
- turtle.turnLeft()
- if turtle.detect() == true then
- dig()
- else
- CheckRight()
- end
- end
- function CheckRight()
- turtle.turnRight()
- if turtle.detect() == true then
- dig()
- else
- CheckLeft()
- end
- end
- function CheckForward()
- if turtle.detect() == true then
- dig()
- else
- CheckRight()
- CheckLeft()
- end
- end
- function CheckDown()
- if turtle.detectDown() == true then
- turtle.digDown()
- turtle.down()
- else
- CheckForward()
- end
- end
- function CheckUp()
- if turtle.detectUp() == true then
- turtle.digUp()
- turtle.up()
- else
- CheckForward()
- end
- end
- while true do
- CheckDown()
- CheckUp()
- CheckForward()
- CheckLeft()
- CheckRight()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement