Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- turtle.select(2)
- turtle.refuel()
- turtle.select(1)
- while true do
- function check() if turtle.select(1) == turtle.compareDown() then return true else return false end
- end
- function direction()
- turtle.forward()
- if check() == true then
- turtle.back()
- return 1
- else
- turtle.back()
- turtle.turnLeft()
- turtle.forward()
- end
- if check() == true then
- turtle.back()
- turtle.turnRight()
- return 2
- else
- turtle.back()
- turtle.turnRight()
- turtle.turnRight()
- turtle.forward()
- end
- if check() == true then
- turtle.back()
- turtle.turnLeft()
- return 3
- end
- end
- tampon = direction()
- if(tampon == 1) then turtle.forward()
- os.sleep(0.5)
- elseif(tampon == 2) then turtle.turnLeft()
- turtle.forward()
- os.sleep(0.5)
- elseif(tampon == 3) then turtle.turnRight()
- turtle.forward()
- os.sleep(0.5)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement