Advertisement
Guest User

Stuff

a guest
May 21st, 2016
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.04 KB | None | 0 0
  1. local pass = "Temp"
  2. local dPas = "Debug"
  3. local timer = 5
  4. local delay = 1
  5. local side = "left"
  6. local dside = "bottom"
  7. --//This code runs first on computer startup, checking for a valid keycard in the bottom disk
  8. while true do
  9.         if disk.isPresent(dside) then
  10.         if fs.exists("disk/security/key") then
  11.         shell.run("disk/security/key")
  12.         if key == "Code" then
  13.         disk.eject(dside)
  14.         rs.setOutput(side,false)
  15.         sleep(timer)
  16.         rs.setOutput(side,true)
  17.        
  18. else
  19. disk.eject(dside)
  20. end
  21. else
  22. disk.eject(dside)
  23. end
  24. end
  25.  
  26. else
  27. --// This code must run only if user has turned on the computer without a keycard in the bottom disk driver, or if the keycard is invalid
  28. print("Door is Locked")
  29. sleep(delay)
  30. print("Insert Password:   ")
  31. sleep(delay)
  32. local input = read("x")
  33. if input == pass then --If the password is correct do
  34. rs.setOutput(side,false)
  35. sleep(timer)
  36. rs.setOutput(side,true)
  37. sleep(delay)
  38. os.shutdown()
  39. else --If the password is incorrect do
  40. print ("Incorrect password)
  41. sleep(delay)
  42. os.shutdown()
  43. end
  44. end
  45. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement