Advertisement
Tomyf4

WorldEaterTurtle

Feb 7th, 2020
283
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. function refuel()
  2. while turtle.getFuelLevel() < 40 do
  3. turtle.refuel()
  4. end
  5. end
  6.  
  7. refuel()
  8.  
  9. function dig()
  10. turtle.dig()
  11. turtle.forward()
  12. end
  13.  
  14. function CheckLeft()
  15. turtle.turnLeft()
  16. if turtle.detect() == true then
  17. dig()
  18. else
  19. CheckRight()
  20. end
  21. end
  22. function CheckRight()
  23. turtle.turnRight()
  24. if turtle.detect() == true then
  25. dig()
  26. else
  27. CheckLeft()
  28. end
  29. end
  30. function CheckForward()
  31. if turtle.detect() == true then
  32. dig()
  33. else
  34. CheckRight()
  35. CheckLeft()
  36. end
  37. end
  38. function CheckDown()
  39. if turtle.detectDown() == true then
  40. turtle.digDown()
  41. turtle.down()
  42. else
  43. CheckForward()
  44. end
  45. end
  46. function CheckUp()
  47. if turtle.detectUp() == true then
  48. turtle.digUp()
  49. turtle.up()
  50. else
  51. CheckForward()
  52. end
  53. end
  54.  
  55. while true do
  56. CheckDown()
  57. CheckUp()
  58. CheckForward()
  59. CheckLeft()
  60. CheckRight()
  61. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement