Advertisement
PaymentOption

Key access

Jul 30th, 2012
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.73 KB | None | 0 0
  1. -- Key card access by PaymentOption and sambosch --
  2. local sPasswordPath = "disk/.lockInformation"
  3. local sPassword = "" -- This is loaded from the disk on runtime
  4.  
  5. local sReal_Password = "sambosch" -- This is the actual password for validation comparison.
  6. local file = nil
  7. -- END VARS --
  8.  
  9. term.clear(); term.setCursorPos(1, 1)
  10.  
  11. while true do
  12.     event, side = os.pullEventRaw()
  13.    
  14.     if event == "disk" then
  15.         if fs.exists(sPasswordPath) then
  16.             file = fs.open(sPasswordPath, "r")
  17.             if file.readAll() == sReal_Password then term.clear(); term.setCursorPos(1, 1); print(os.version()); break
  18.             else print("Access Denied."); shell.run("eject", side) end
  19.         else print("Password not found on disk."); shell.run("eject", side) end
  20.     end
  21. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement