funnybunnyofdoom

bunnydoorlight

Nov 30th, 2019
549
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. --This program controls doors with only
  2. --a disk drive
  3.  
  4. function doorCheck()
  5. while true do
  6. event,x,y,side = os.pullEvent() --Listen for events
  7. if event == "disk" then --Check for disks
  8. disk.eject("right") --kick out disk
  9. redstone.setAnalogOutput("front",10) --open door
  10. os.sleep(10) --pause
  11. redstone.setAnalogOutput("front",0) --close door
  12. disk.eject("right") --kick out any extra disks
  13. os.reboot() -- clean reboot each time.
  14. end
  15. end
  16. end
  17.  
  18. doorCheck()
Add Comment
Please, Sign In to add comment