AdditionalPylons

sheep.lua

Sep 2nd, 2025
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.02 KB | None | 0 0
  1. turtle.select(1)
  2. local data = turtle.getItemDetail()
  3. while not data or data.name~="minecraft:shears" do
  4. print("Please insert shears into the first slot.")
  5. os.pullEvent("turtle_inventory")
  6. data = turtle.getItemDetail()
  7. end
  8. turtle.up()
  9. turtle.forward()
  10. turtle.forward()
  11. turtle.forward()
  12. turtle.down()
  13. local rotateright = true
  14. while true do
  15. turtle.placeDown()
  16. if turtle.getItemCount()==0 then
  17. print("Shears broke! Program stopped.")
  18. break
  19. end
  20. if turtle.detect() then
  21. if rotateright then
  22. turtle.turnRight()
  23. if turtle.detect() then break end
  24. turtle.up()
  25. turtle.forward()
  26. turtle.down()
  27. turtle.turnRight()
  28. else
  29. turtle.turnLeft()
  30. if turtle.detect() then break end
  31. turtle.forward()
  32. turtle.turnLeft()
  33. end
  34. rotateright = not rotateright
  35. else
  36. turtle.up()
  37. turtle.forward()
  38. turtle.down()
  39. end
  40. end
  41.  
Advertisement
Add Comment
Please, Sign In to add comment