Advertisement
Spatzenhirn123

ChickenSort

Feb 12th, 2022 (edited)
1,166
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.50 KB | None | 0 0
  1. timeHigh=0.2
  2. timeLow=0.2
  3.  
  4.  
  5. function FilterChest()
  6.     turtle.suckDown()
  7.     if (turtle.getItemCount(1)>0) then
  8.         if (turtle.compareTo(16)==true) then
  9.             turtle.drop()
  10.         else
  11.             turtle.turnRight()
  12.             turtle.turnRight()
  13.             turtle.drop()
  14.             turtle.turnRight()
  15.             turtle.turnRight()
  16.         end
  17.         FilterChest()
  18.     end    
  19. end
  20.  
  21. function SpawnChicken()
  22.     for i=1,150 do
  23.         turtle.setOutput("top",true)
  24.         os.sleep(timeHigh)
  25.         turtle.setOutput("top",false)
  26.         os.sleep(timeLow)      
  27.     end
  28. end
  29.  
  30. FilterChest()
  31.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement