Advertisement
Ubidibity

clearchunk.lua

Jun 23rd, 2025 (edited)
31
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.46 KB | Gaming | 0 0
  1. -- A different version of my chunk clearing to bedrock program that goes one level at a time instead of strip mining up and down
  2. -- like a sewing needle. The idea here is if I go down with the turtle I should be able to patch fluids as we go to (hopefully)
  3. -- avoid ending up with a hole full of water; which has happened enough lately to justify the rewrite.
  4. width=16 -- usually 16 but can be smaller for troubleshooting/testing
  5. -- depth=3 -- dito, worth doing enough to ensure the level transitions work
  6.  
  7. -- kickstart to get on the 3 block cycle
  8. turtle.up()
  9. turtle.placeDown()
  10.  
  11. local function digger()
  12. while not turtle.forward() do
  13. turtle.dig() -- should overcome sand and gravel
  14. end
  15. turtle.digUp()
  16. turtle.digDown()
  17. end
  18.  
  19. local function flip(flipper)
  20. if flipper==0 then
  21. turtle.turnRight()
  22. digger()
  23. turtle.turnRight()
  24. else
  25. turtle.turnLeft()
  26. digger()
  27. turtle.turnLeft()
  28. end
  29. end
  30.  
  31. -- for z=1,depth do
  32. while turtle.digDown() do -- should fail when we get to bedrock
  33. turtle.down()
  34. turtle.digDown()
  35. turtle.down()
  36. turtle.digDown()
  37. turtle.down()
  38. turtle.digDown()
  39.  
  40. flop=0
  41. for y=1,width do
  42. for x=1,width-1 do -- -1 because the turtle takes up a spot.
  43. digger()
  44. end
  45. print(y)
  46. if y~=width then
  47. flip(flop)
  48. flop=1-flop
  49. end
  50. end
  51. turtle.digDown()
  52. if flop==1 then
  53. turtle.turnRight()
  54. else
  55. turtle.turnLeft()
  56. end
  57. turtle.placeDown()
  58. end
  59.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement