Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function detectLeft()
- turtle.turnLeft()
- for i = 0, 20, 1 do
- turtle.select(Block)
- detected = turtle.compare()
- if detected == true then turtle.turnRight() return true end
- end
- turtle.turnRight()
- return false
- end
- function detectRight()
- turtle.turnRight()
- for i = 0, 20, 1 do
- turtle.select(Block)
- detected = turtle.compare()
- if detected == true then turtle.turnLeft() return true end
- end
- turtle.turnLeft()
- return false
- end
- for i = 0, 20, 1 do
- if turtle.getFuelLevel() < 200 then
- turtle.refuel(1)
- print("Refueling")
- end
- if detectLeft() == true then
- turtle.turnLeft()
- turtle.dig()
- turtle.turnRight()
- end
- if detectRight() == true then
- turtle.turnRight()
- turtle.dig()
- turtle.turnLeft()
- end
- turtle.forward()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement