Advertisement
Spatzenhirn123

ChickenSpawn

Feb 12th, 2022 (edited)
1,341
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.74 KB | None | 0 0
  1. idleTime=60
  2. updateTime=5
  3.  
  4. timeHigh=0.1
  5. timeLow=0.1
  6.  
  7.  
  8. function FilterChest()
  9.     turtle.suckDown()
  10.     if (turtle.getItemCount(1)>0) then
  11.         if (turtle.compareTo(16)==true) then
  12.             turtle.drop()
  13.         else
  14.             turtle.turnRight()
  15.             turtle.turnRight()
  16.             turtle.drop()
  17.             turtle.turnRight()
  18.             turtle.turnRight()
  19.         end
  20.         FilterChest()
  21.     end    
  22. end
  23.  
  24. function SpawnChicken()
  25.     for i=1,150 do
  26.         redstone.setOutput("top",true)
  27.         os.sleep(timeHigh)
  28.         redstone.setOutput("top",false)
  29.         os.sleep(timeLow)
  30.         print(150-i)
  31.     end
  32. end
  33.  
  34. --Loop
  35. while true do
  36.     FilterChest()
  37.     for i=0,(idleTime/updateTime),1 do
  38.         if (redstone.getInput("left")==true) then
  39.             SpawnChicken()
  40.             i=idleTime/updateTime
  41.         else
  42.             os.sleep(updateTime)
  43.         end
  44.     end
  45. end
  46.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement