Advertisement
0xSRK6

Computercraft Volume Mine

Apr 12th, 2023
23
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.14 KB | None | 0 0
  1. local LENGTH = 16
  2. local WIDTH = 16
  3. local HEIGHT = 16
  4.  
  5. local function leftRes()
  6. turtle.turnLeft()
  7. turtle.dig()
  8. turtle.forward()
  9. turtle.turnLeft()
  10. turtle.digUp()
  11. end
  12.  
  13. local function rightRes()
  14. turtle.turnRight()
  15. turtle.dig()
  16. turtle.forward()
  17. turtle.turnRight()
  18. turtle.digUp()
  19. end
  20.  
  21. local function initDig()
  22. turtle.dig()
  23. turtle.forward()
  24. turtle.digUp()
  25. end
  26.  
  27. local function reset(mw)
  28. turtle.turnRight()
  29. for _ = 1, mw do
  30. turtle.forward()
  31. end
  32. turtle.turnLeft()
  33. turtle.digDown()
  34. turtle.down()
  35. end
  36.  
  37. local function mainMine(ml, mw, mh)
  38. initDig()
  39. local isTurningLeft = true
  40. for i = 1, mh do --height
  41. for j = 1, mw do --width
  42. for k = 1, ml - 1 do --length
  43. turtle.dig()
  44. turtle.forward()
  45. turtle.digUp()
  46. end
  47. if isTurningLeft then
  48. leftRes()
  49. else
  50. rightRes()
  51. end
  52. isTurningLeft = not isTurningLeft
  53. end
  54. reset(mw)
  55. end
  56. end
  57.  
  58.  
  59. mainMine(LENGTH, WIDTH, HEIGHT)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement