mercwear

turtle chunk light placer

May 18th, 2025 (edited)
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.23 KB | None | 0 0
  1. --16X16 space break and place lights every other block
  2. local space_x = 16
  3. local space_y = 16
  4. local moves = 0
  5. local fuel_level = 0
  6. local drops = 0
  7. local last_turn = 'left' --Based on where turtle starts from
  8. turtle.select(1) --Fuel
  9. turtle.refuel()
  10. fuel_level = turtle.getFuelLevel()
  11.  
  12. --Select item to place
  13. turtle.select(2)
  14.  
  15.  
  16. while true do
  17. turtle.digDown()
  18. turtle.placeDown()
  19.  
  20. drops = drops + 1
  21. if drops >= 64 then
  22. turtle.select(3) -- Select the second slot with lights in it
  23. --drops = 0
  24. end
  25. if drops >= 128 then
  26. --exit
  27. os.exit()
  28. end
  29.  
  30.  
  31.  
  32. if moves < 16 then
  33. turtle.forward()
  34. turtle.forward()
  35. moves = moves + 2
  36. end
  37.  
  38. --Turn right
  39. if moves >= 16 and last_turn == 'left' then
  40. --Move over one row then turn around
  41. turtle.turnRight()
  42. turtle.forward()
  43. turtle.turnRight()
  44. last_turn = 'right'
  45. moves = 0
  46. end
  47.  
  48. --Turn left
  49. if moves >= 16 and last_turn == 'right' then
  50. --Move over one row then turn around
  51. turtle.turnLeft()
  52. turtle.forward()
  53. turtle.turnLeft()
  54. last_turn = 'left'
  55. moves = 0
  56. end
  57.  
  58.  
  59.  
  60.  
  61.  
  62. end
Advertisement
Add Comment
Please, Sign In to add comment