Advertisement
Guest User

Untitled

a guest
Dec 15th, 2019
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.72 KB | None | 0 0
  1. function isblock_f(id)
  2. local success, data = turtle.inspect()
  3. if success then
  4. if id == data.name then
  5. return true
  6. end
  7. end
  8. end
  9.  
  10. function isblock_l(id)
  11. turtle.turnLeft()
  12. local success, data = turtle.inspect()
  13. turtle.turnRight()
  14. if success then
  15. if id == data.name then
  16. return true
  17. end
  18. end
  19. end
  20.  
  21. function isblock_r(id)
  22. turtle.turnRight()
  23. local success, data = turtle.inspect()
  24. turtle.turnLeft()
  25. if success then
  26. if id == data.name then
  27. return true
  28. end
  29. end
  30. end
  31.  
  32. function isblock_u(id)
  33. local success, data = turtle.inspectUp()
  34. if success then
  35. if id == data.name then
  36. return true
  37. end
  38. end
  39. end
  40.  
  41. function isblock_d(id)
  42. local success, data = turtle.inspectDown()
  43. if success then
  44. if id == data.name then
  45. return true
  46. end
  47. end
  48. end
  49.  
  50. function isblock_b(id)
  51. turtle.turnLeft()
  52. turtle.turnLeft()
  53. local success, data = turtle.inspect()
  54. turtle.turnRight()
  55. turtle.turnRight()
  56. if success then
  57. if id == data.name then
  58. return true
  59. end
  60. end
  61. end
  62.  
  63. function minevein(id)
  64. if isblock_f(id) then
  65. print("f")
  66. turtle.dig()
  67. turtle.forward()
  68. return minevein(id)
  69. end
  70. if isblock_u(id) then
  71. print("u")
  72. turtle.dig()
  73. turtle.up()
  74. return minevein(id)
  75. end
  76. if isblock_d(id) then
  77. print("d")
  78. turtle.dig()
  79. turtle.down()
  80. return minevein(id)
  81. end
  82. turtle.turnLeft()
  83. if isblock_f(id) then
  84. print("l")
  85. turtle.dig()
  86. turtle.forward()
  87. return minevein(id)
  88. end
  89. turtle.turnLeft()
  90. if isblock_f(id) then
  91. print("b")
  92. turtle.dig()
  93. turtle.forward()
  94. return minevein(id)
  95. end
  96. turtle.turnLeft()
  97. if isblock_f(id) then
  98. print("r")
  99. turtle.dig()
  100. turtle.forward()
  101. return minevein(id)
  102. end
  103.  
  104.  
  105.  
  106. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement