Aixler

wool

Nov 4th, 2013
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.83 KB | None | 0 0
  1. function drop()
  2.     slot = 1
  3.     turtle.select(slot)
  4.     for x=1, 12 do
  5.         if turtle.getItemCount(slot) > 0 then
  6.             turtle.select(slot)
  7.             turtle.dropDown()
  8.         end
  9.         slot = slot + 1
  10.     end
  11.     slot = 1
  12. end
  13.  
  14. function place()
  15.     turtle.select(shear)
  16.     while turtle.getItemCount(shear) == 0 do
  17.         shear = shear + 1
  18.         if shear == 17 then
  19.             redstone.setOutput("top", false)
  20.             error()
  21.         end
  22.     end
  23.     turtle.place()
  24. end
  25.  
  26. function wool()
  27.     while true do
  28.         turtle.turnRight()
  29.         place()
  30.         drop()
  31.         sleep(60)
  32.     end
  33. end
  34.  
  35. shear = 13
  36. redstone.setOutput("top", true)
  37.  
  38. repeat
  39.         result, err = pcall(wool)
  40.         if not result then
  41.                 print("Horrible nasty stuff happened...")
  42.                 print(err)
  43.                 print("Whatever happend... The killing needs to resume!")
  44.         end    
  45.         os.sleep(60)
  46. until false
Advertisement
Add Comment
Please, Sign In to add comment