Advertisement
cul8ter

Untitled

Jan 20th, 2024 (edited)
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. local worked,block=turtle.inspectDown()
  2. local blockName=block.name
  3. function checkFront()
  4. worked,block=turtle.inspect()
  5. if worked and block.name==blockName then
  6. turtle.dig()
  7. i=i+1
  8. turtle.forward()
  9. spin()
  10. i=i-1
  11. if i==-1 then return end
  12. turtle.back()
  13. end
  14. end
  15. function checkDown()
  16. worked,block=turtle.inspectDown()
  17. if worked and block.name==blockName then
  18. turtle.digDown()
  19. i=i+1
  20. turtle.down()
  21. spin()
  22. i=i-1
  23. if i==-1 then return end
  24. turtle.up()
  25. end
  26. end
  27. function checkUp()
  28. worked,block=turtle.inspectUp()
  29. if worked and block.name==blockName then
  30. turtle.digUp()
  31. i=i+1
  32. turtle.up()
  33. spin()
  34. i=i-1
  35. if i==-1 then return end
  36. turtle.down()
  37. end
  38. end
  39. function spin()
  40. checkDown()
  41. for _=1,4 do
  42. checkFront()
  43. turtle.turnLeft()
  44. end
  45. checkUp()
  46. end
  47. i=0
  48. spin()
  49.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement