herobrinethree

miner-empty

Jan 22nd, 2021 (edited)
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. lastempty = function()
  2. turtle.digUp()
  3. turtle.select(2)
  4. turtle.placeUp()
  5. for i = 3, 16, 1
  6. do
  7. turtle.select(i)
  8. turtle.dropUp(64)
  9. end
  10. turtle.select(2)
  11. turtle.digUp()
  12. turtle.select(1)
  13. end
  14. empty = function()
  15. if turtle.getItemCount(15) >= 1 then
  16. turtle.digUp()
  17. turtle.select(2)
  18. turtle.placeUp()
  19. for i = 3, 16, 1
  20. do
  21. turtle.select(i)
  22. turtle.dropUp(64)
  23. end
  24. turtle.select(2)
  25. turtle.digUp()
  26. turtle.select(1)
  27. end
  28. end
  29.  
  30. destroy = function()
  31. empty()
  32. turtle.digDown()
  33. turtle.digUp()
  34. while turtle.detect() == true do
  35. turtle.dig()
  36. end
  37. end
  38. lastdestroy = function()
  39. empty()
  40. turtle.digUp()
  41. turtle.digDown()
  42. end
  43. row = function(distance)
  44. for i = 0, distance, 1
  45. do
  46. destroy()
  47. turtle.forward()
  48. end
  49. end
  50. righthook = function()
  51. empty()
  52. turtle.turnRight()
  53. destroy()
  54. turtle.forward()
  55. turtle.turnRight()
  56. end
  57. lefthook = function()
  58. empty()
  59. turtle.turnLeft()
  60. destroy()
  61. turtle.forward()
  62. turtle.turnLeft()
  63. end
  64. square = function(Length, Depth)
  65. empty()
  66. if Length % 2 == 0 then
  67. for i = 1, Length, 2
  68. do
  69. row(Depth)
  70. righthook()
  71. row(Depth)
  72. lefthook()
  73. end
  74. row(Depth)
  75. righthook()
  76. row(Depth)
  77. lastdestroy()
  78. turtle.turnRight()
  79. for i = 0, Length, 1
  80. do
  81. turtle.forward()
  82. end
  83. turtle.turnRight()
  84. elseif Length % 2 ~= 0 then
  85. for i = 0, Length, 2
  86. do
  87. row(Depth)
  88. righthook()
  89. row(Depth)
  90. lefthook()
  91. end
  92. row(Depth)
  93. lastdestroy()
  94. turtle.turnLeft()
  95. turtle.turnLeft()
  96. for i = 0, Depth, 1
  97. do
  98. turtle.forward()
  99. end
  100. turtle.turnRight()
  101. for i = 0, Length, 1
  102. do
  103. turtle.forward()
  104. end
  105. turtle.turnRight()
  106. elseif Length == 0 then
  107. row(Depth)
  108. turtle.turnLeft()
  109. turtle.turnLeft()
  110. for i = 0, Depth, 1
  111. do
  112. turtle.forward()
  113. end
  114. turtle.turnRight()
  115. turtle.turnRight()
  116. elseif Depth == 0 then
  117. turtle.turnRight()
  118. row(Length)
  119. turtle.turnLeft()
  120. turtle.turnLeft()
  121. for i = 0, Length, 1
  122. do
  123. turtle.forward()
  124. end
  125. turtle.turnRight()
  126. end
  127. lastempty()
  128. end
  129.  
  130. term.write("Select Depth: ")
  131. local depth = read()
  132. depth = depth - 2
  133. term.write("Select Length: ")
  134. local length = read()
  135. length = length - 2
  136.  
  137. square(length, depth)
  138. print("Mining Completed")
Add Comment
Please, Sign In to add comment