Advertisement
Guest User

Untitled

a guest
Jul 15th, 2018
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.37 KB | None | 0 0
  1. local function detectOreDown()
  2. turle.select(2);
  3. local d = turtle.compareDown();
  4. turtle.turnLeft();
  5. local l = turtle.compare();
  6. turtle.turnRight();
  7. turtle.turnRight();
  8. local r = turtle.compare();
  9. turtle.turnLeft();
  10. if (d or l or r) then
  11. turtle.select(3);
  12. turtle.turnLeft();
  13. turtle.turnLeft();
  14. turtle.place();
  15. turtle.turnRight();
  16. turtle.turnRight();
  17. end
  18. end
  19.  
  20. local function detectOreUp()
  21. turle.select(2);
  22. local u = turtle.compareUp();
  23. turtle.turnLeft();
  24. local l = turtle.compare();
  25. turtle.turnRight();
  26. turtle.turnRight();
  27. local r = turtle.compare();
  28. turtle.turnLeft();
  29. if (u or l or r) then
  30. turtle.select(3);
  31. turtle.turnLeft();
  32. turtle.turnLeft();
  33. turtle.place();
  34. turtle.turnRight();
  35. turtle.turnRight();
  36. end
  37. end
  38.  
  39. turtle.select(1);
  40. turtle.refuel(1);
  41.  
  42. for i=0,4 do
  43.  
  44. turtle.dig();
  45. while turtle.detect() do
  46. sleep(0.8);
  47. turtle.dig();
  48. end
  49. turtle.forward();
  50. detectOreDown();
  51.  
  52. turtle.digUp();
  53. while turtle.detectUp() do
  54. sleep(0.8);
  55. turtle.digUp();
  56. end
  57. turtle.up();
  58. detectOreUp();
  59.  
  60. if i % 4 == 0 then
  61. turtle.select(16);
  62. turtle.placeUp();
  63. end
  64.  
  65. turtle.dig();
  66. while turtle.detect() do
  67. sleep(0.8);
  68. turtle.dig();
  69. end
  70. turtle.forward();
  71. detectOreUp();
  72.  
  73. turtle.digDown();
  74. turtle.down();
  75. detectOreDown();
  76.  
  77. if turtle.getFuelLevel() < 20 then
  78. turtle.select(1);
  79. turtle.refuel(1);
  80. end
  81.  
  82. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement