Advertisement
Guest User

Untitled

a guest
Nov 25th, 2014
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. os.pullEvent = os.pullEventRaw
  2. local password = "fuckoff"
  3. local secondPassword = "fuckoff2"
  4.  
  5. function secondaryPassword()
  6.   while true do
  7.     textutils.slowPrint("RESTRICTED AREA! ENTER PASSWORD TO UNLOCK PC:");
  8.     input = read("*");
  9.     if (input == secondPassword) then
  10.       return true;
  11.     else
  12.       textutils.slowPrint("ACCESS DENIED. STARTING ALARM!");
  13.       rs.setOutput("top",true);
  14.       os.sleep(10);
  15.       rs.setOutput("top",false);
  16.     end
  17.   end
  18. end
  19.  
  20. function primaryPassword()
  21.  write("LIMITED ACCESS. ENTER PASSWORD:")
  22.  local input = read("*")
  23.  if input == password then
  24.   term.clear()
  25.   term.setCursorPos(1,1)
  26.   textutils.slowPrint("ACCESS GRANTED")
  27.   textutils.slowPrint("DOOR IS OPENING PLEASE WAIT...")
  28.   rs.setOutput("left",true)
  29.   sleep(4)
  30.   rs.setOutput("left",false)
  31.   return true;
  32.  else
  33.   term.clear()
  34.   term.setCursorPos(1,1)
  35.   print("WRONG PASSWORD. ACCESS DENIED")
  36.   --rs.setOutput("bottom",true)
  37.   return false;
  38.  end
  39. end
  40.  
  41. function checkPass()
  42.   if(primaryPassword()) then
  43.     return true;
  44.   else
  45.     if(secondaryPassword()) then
  46.       return false;
  47.     end
  48.   end
  49. end
  50.  
  51. repeat
  52.   term.clear();
  53.   term.setCursorPos(1,1);
  54. until(checkPass())
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement