Advertisement
ceribia

cowCounter

Jun 27th, 2017
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. redstone.setAnalogOutput("back", 15)
  2. while true do
  3. os.pullEvent("redstone")
  4. local babyCount = redstone.getAnalogInput("front") + 6
  5. local adultCount = redstone.getAnalogInput("top")
  6.  
  7. if babyCount == 15 and adultCount == 15 then
  8. print("15 adults and 15 children. Moving adults for slaughter.")
  9. redstone.setAnalogOutput("back", 0)
  10. else
  11. print("Children <= " .. babyCount .. " Adults =" .. adultCount)
  12. redstone.setAnalogOutput("back", 15)
  13. end
  14. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement