Advertisement
Guest User

pass

a guest
Mar 25th, 2017
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.57 KB | None | 0 0
  1. os.pullEvent() = os.pullEventRaw()
  2.  
  3. local pass = "password"
  4.  
  5. while true do -- infinite loop
  6.   term.clear() -- clear the screen
  7.   term.setCursorPos(1,1)
  8.   print("SecurityOS Access Terminal")
  9.   sleep(2)
  10.   print("Authentication Required")
  11.   write("Password> ")
  12.   local input = read("*")
  13.   if input == pass then -- if the password is correct
  14.     shell.run("door")
  15.     break -- break the loop, end the program
  16.   else -- if it's not
  17.     print("Password Incorrect") -- say it's wrong
  18.     sleep(1) -- wait some time and then start over (because of the loop)
  19.   end
  20. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement