Advertisement
Guest User

Untitled

a guest
Sep 2nd, 2014
238
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. local password = "something random"
  2. local monitor = peripheral.wrap('top')
  3.  
  4. while true do
  5. os.pullEvent('disk')
  6.  
  7. local file = fs.open('disk/key', 'r')
  8. local content
  9. if file then
  10. content = file.readAll()
  11. file.close()
  12. end
  13.  
  14. disk.eject('back')
  15.  
  16. if content == password then
  17. rs.setOutput('front', true)
  18. monitor.setBackgroundColor(colors.lime)
  19. monitor.clear()
  20. sleep(3)
  21. else
  22. monitor.setBackgroundColor(colors.red)
  23. monitor.clear()
  24. sleep(1)
  25. end
  26.  
  27. rs.setOutput('front', false)
  28. monitor.setBackgroundColor(colors.black)
  29. monitor.clear()
  30. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement