Advertisement
pfgpastebin

Untitled

Jun 11th, 2023
40
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.79 KB | None | 0 0
  1. local function digFwd()
  2. digFwdNoDeposit()
  3. checkDeposit()
  4. end
  5. local function digFwdNoDeposit()
  6. if not turtle.dig() do error("dig fail") end
  7. end
  8. local function digDown()
  9. digDownNoDeposit()
  10. checkDeposit()
  11. end
  12. local function digDownNoDeposit()
  13. if not turtle.digDown() do error("dig fail") end
  14. end
  15. local function checkDeposit()
  16. local item_count = turtle.getItemCount(14)
  17. if item_count > 0 then
  18. depositNow()
  19. end
  20. end
  21. local function depositNow()
  22. local chest_count = turtle.getItemCount(16)
  23. if item_count <= 0 then
  24. error("no chests")
  25. end
  26. turtle.select(16)
  27. turtle.turnRight()
  28. turtle.turnRight()
  29. digDownNoDeposit()
  30. turtle.place()
  31. for j=1,14 do
  32. turtle.transferTo(j)
  33. end
  34. turtle.turnRight()
  35. turtle.turnRight()
  36. end
  37. local forward_dist = 20
  38. local right_dist_over_two = 10
  39. while true do
  40. for j=1,right_dist_over_two do
  41. for i=1,forward_dist do
  42. digFwd()
  43. turtle.forward()
  44. end
  45. turtle.turnRight()
  46. digFwd()
  47. turtle.forward()
  48. turtle.turnRight()
  49. for i=1,forward_dist do
  50. digFwd()
  51. turtle.forward()
  52. end
  53. turtle.turnLeft()
  54. digFwd()
  55. turtle.forward()
  56. turtle.turnLeft()
  57. end
  58. depositNow()
  59. turtle.turnLeft()
  60. digDownNoDeposit()
  61. turtle.down()
  62. for j=1,right_dist_over_two * 2 do
  63. digFwdNoDeposit()
  64. turtle.forward()
  65. end
  66. turtle.turnRight()
  67. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement