robathome

Untitled

Sep 30th, 2025
518
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.05 KB | None | 0 0
  1. -- super simple zig-zag column miner
  2. local X=3 -- width (x)
  3. local Z=3 -- length (z)
  4. local Y=3 -- height (y)
  5. local COB=2
  6.  
  7. local function stepF()
  8. while turtle.detect() do turtle.dig() end
  9. while not turtle.forward() do turtle.attack(); turtle.dig() end
  10. end
  11. local function stepD()
  12. while turtle.detectDown() do turtle.digDown() end
  13. while not turtle.down() do turtle.attackDown(); turtle.digDown() end
  14. end
  15. local function stepU()
  16. while turtle.detectUp() do turtle.digUp() end
  17. while not turtle.up() do turtle.attackUp(); turtle.digUp() end
  18. end
  19.  
  20. local function column()
  21. for i=2,Y do stepD() end
  22. if not turtle.detectDown() then turtle.select(COB); turtle.placeDown() end
  23. for i=2,Y do stepU() end
  24. end
  25.  
  26. local dir=1
  27. for z=1,Z do
  28. if dir==1 then
  29. column()
  30. for x=2,X do stepF(); column() end
  31. else
  32. column()
  33. for x=2,X do stepF(); column() end
  34. end
  35. if z<Z then
  36. if dir==1 then turtle.turnRight(); stepF(); turtle.turnRight()
  37. else turtle.turnLeft(); stepF(); turtle.turnLeft() end
  38. dir=1-dir
  39. end
  40. end
  41.  
Advertisement
Add Comment
Please, Sign In to add comment