Advertisement
Burrito33

chop2

Aug 19th, 2023 (edited)
10
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.67 KB | None | 0 0
  1. function digAndMove()
  2. local i = 1
  3. local w = 5 -- width
  4. local r = 5 -- row
  5. local h = 1 -- height
  6. local s = 1
  7.  
  8. if turtle.detect() then
  9. turtle.dig()
  10. turtle.forward()
  11. turtle.digUp()
  12. turtle.digDown()
  13. i = i + 1
  14. turtle.back()
  15. turtle.back()
  16. turtle.turnLeft()
  17. turtle.forward()
  18. turtle.forward()
  19. turtle.turnRight() -- start in corner so that the whole 5x5 can be cleaned
  20.  
  21. while h < 10 do
  22. while i < w do
  23. turtle.dig()
  24. turtle.forward() -- start cleaning
  25. i = i + 1
  26. turtle.dig()
  27. if i % 2 == 0 then
  28. turtle.turnLeft()
  29. else
  30. turtle.turnRight()
  31. end
  32. turtle.forward()
  33. turtle.turnLeft()
  34. i = 1
  35. turtle.forward()
  36. turtle.turnRight()
  37. i = 1
  38. turtle.up()
  39. h = h + 1
  40. end
  41.  
  42. for count = 1, h do
  43. turtle.down()
  44. end
  45. end
  46.  
  47. turtle.turnRight()
  48. turtle.forward()
  49. turtle.forward()
  50. turtle.turnRight()
  51. turtle.forward()
  52. turtle.forward()
  53. turtle.turnRight()
  54. turtle.select(2)
  55. turtle.dropDown()
  56. turtle.forward()
  57. turtle.forward()
  58. turtle.turnRight()
  59. turtle.forward()
  60. turtle.select(1)
  61. turtle.place()
  62. turtle.up()
  63. end
  64. end
  65.  
  66. while true do
  67. digAndMove()
  68. sleep(60) -- Sleep for 1 minute
  69. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement