hunters2020

sheeper

Apr 9th, 2020
815
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.73 KB | None | 0 0
  1. local function findShears()
  2.  
  3.     for i = 1, 16 do
  4.  
  5.         turtle.select(i)
  6.         local item = turtle.getItemDetail()
  7.        
  8.         if item and item.name == "minecraft:shears" then
  9.  
  10.             return true
  11.  
  12.         end
  13.     end
  14. end
  15.  
  16. while true do
  17.  
  18.     if findShears() then
  19.  
  20.         local state;
  21.  
  22.         repeat
  23.  
  24.             turtle.place()
  25.  
  26.             sleep(1)
  27.  
  28.             state = turtle.getItemDetail()
  29.  
  30.         until (not state) or (state.name ~= "minecraft:shears")
  31.  
  32.         for i = 1, 16 do
  33.  
  34.             turtle.select(i)
  35.             local item = turtle.getItemDetail()
  36.            
  37.             if item and item.name:match('wool$') then
  38.  
  39.                 turtle.dropDown()
  40.  
  41.             end
  42.         end
  43.  
  44.         sleep(1)
  45.  
  46.     else
  47.  
  48.         turtle.turnRight()
  49.         turtle.turnRight()
  50.         turtle.suck()
  51.         turtle.turnRight()
  52.         turtle.turnRight()
  53.  
  54.         sleep(2)
  55.  
  56.     end
  57. end
Advertisement
Add Comment
Please, Sign In to add comment