Advertisement
karelvysinka

Mining turtle 10x10x30 v3

Mar 14th, 2023
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.41 KB | Gaming | 0 0
  1. local function moveToStart()
  2. turtle.turnRight()
  3. turtle.turnRight()
  4. for _ = 1, 10 do
  5. turtle.forward()
  6. end
  7. turtle.turnLeft()
  8. for _ = 1, 10 do
  9. turtle.forward()
  10. end
  11. turtle.turnLeft()
  12. end
  13.  
  14. local function moveForward()
  15. while not turtle.forward() do
  16. turtle.dig()
  17. end
  18. end
  19.  
  20. local function moveToNextLayer()
  21. turtle.turnRight()
  22. moveForward()
  23. turtle.turnLeft()
  24. end
  25.  
  26. local function mineLayer()
  27. for y = 1, 10 do
  28. for x = 1, 10 do
  29. dig()
  30. refuel()
  31. if x < 10 then
  32. moveForward()
  33. end
  34. end
  35. if y < 10 then
  36. if y % 2 == 1 then
  37. turtle.turnRight()
  38. moveForward()
  39. turtle.turnRight()
  40. else
  41. turtle.turnLeft()
  42. moveForward()
  43. turtle.turnLeft()
  44. end
  45. end
  46. end
  47. end
  48.  
  49. local function mineDownAndUp()
  50. for i = 1, 30 do
  51. mineLayer()
  52. if i % 10 == 0 then
  53. findChestAndEmptyInventory()
  54. moveToStart()
  55. end
  56. if i < 30 then
  57. moveDown()
  58. moveToNextLayer()
  59. end
  60. end
  61. for _ = 1, 30 do
  62. moveUp()
  63. end
  64. end
  65.  
  66. initialRefuel()
  67. print("Zahajuji tezbu tunelu 10x10x30...")
  68. mineDownAndUp()
  69. print("Tezba tunelu dokoncena.")
  70.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement