Crayder

Untitled

Jan 9th, 2021 (edited)
546
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.31 KB | None | 0 0
  1. params = {...}
  2.  
  3. tunnelDistance = tonumber(params[1] or 10)
  4. turtlePos = vector.new(0,0,0)
  5.  
  6. function checkSlot()
  7. currSlot = turtle.getSelectedSlot()
  8. if turtle.getItemCount(currSlot) == 0 then
  9. for i = 1,16 do
  10. if turtle.getItemCount(i) > 0 then
  11. turtle.select(i)
  12. return true
  13. end
  14. end
  15. return false
  16. end
  17. return true
  18. end
  19.  
  20. turtle.select(1)
  21.  
  22. while turtlePos.y ~= tunnelDistance do
  23. turtle.dig()
  24. turtle.forward()
  25.  
  26. turtle.placeDown()
  27. checkSlot()
  28.  
  29. turtle.turnLeft()
  30. turtle.place()
  31. checkSlot()
  32.  
  33. turtle.turnRight()
  34. turtle.turnRight()
  35. turtle.place()
  36. checkSlot()
  37.  
  38. turtle.turnLeft()
  39.  
  40. turtlePos.y = turtlePos.y + 1
  41. end
  42.  
  43. turtle.placeDown()
  44. checkSlot()
  45.  
  46. turtle.turnLeft()
  47. turtle.place()
  48. checkSlot()
  49.  
  50. turtle.turnRight()
  51. turtle.turnRight()
  52. turtle.place()
  53. checkSlot()
  54.  
  55. turtle.up()
  56. turtle.turnRight()
  57.  
  58. while turtlePos.y ~= 0 do
  59. turtle.dig()
  60. turtle.forward()
  61.  
  62. turtle.placeUp()
  63. checkSlot()
  64.  
  65. turtle.turnLeft()
  66. turtle.place()
  67. checkSlot()
  68.  
  69. turtle.turnRight()
  70. turtle.turnRight()
  71. turtle.place()
  72. checkSlot()
  73.  
  74. turtle.turnLeft()
  75.  
  76. turtlePos.y = turtlePos.y - 1
  77. end
  78.  
Add Comment
Please, Sign In to add comment