Advertisement
appollon41

autono

Sep 23rd, 2018
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. turtle.select(2)
  2. turtle.refuel()
  3. turtle.select(1)
  4. while true do
  5. function check() if turtle.select(1) == turtle.compareDown() then return true else return false end
  6. end
  7.  
  8. function direction()
  9. turtle.forward()
  10.  
  11. if check() == true then
  12. turtle.back()
  13. return 1
  14. else
  15. turtle.back()
  16. turtle.turnLeft()
  17. turtle.forward()
  18. end
  19. if check() == true then
  20. turtle.back()
  21. turtle.turnRight()
  22. return 2
  23. else
  24. turtle.back()
  25. turtle.turnRight()
  26. turtle.turnRight()
  27. turtle.forward()
  28. end
  29. if check() == true then
  30. turtle.back()
  31. turtle.turnLeft()
  32. return 3
  33. end
  34. end
  35.  
  36.  
  37. tampon = direction()
  38.  
  39. if(tampon == 1) then turtle.forward()
  40. os.sleep(0.5)
  41. elseif(tampon == 2) then turtle.turnLeft()
  42. turtle.forward()
  43. os.sleep(0.5)
  44. elseif(tampon == 3) then turtle.turnRight()
  45. turtle.forward()
  46. os.sleep(0.5)
  47. end
  48. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement