Advertisement
hjkook

Password

Dec 2nd, 2017
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. local side = 'bottom'
  2. local drive = peripheral.wrap('left')
  3. local dir = "disk/password"
  4.  
  5. while true do
  6. if not fs.exists(dir) then
  7. drive.eject()
  8. os.sleep(1)
  9. else
  10. local password = fs.open(dir,"r")
  11. if password.readLine() == 'chick' then
  12. redstone.setOutput(side,true)
  13. while true do
  14. if not fs.exists(dir) then
  15. break
  16. end
  17. os.sleep(1)
  18. end
  19. redstone.setOutput(side,false)
  20. else
  21. drive.eject()
  22. os.sleep(1)
  23. end
  24. password.close()
  25. end
  26. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement