vvenaya

Untitled

Jan 1st, 2013
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.63 KB | None | 0 0
  1.  
  2. -- Variables
  3.  
  4. local password="open"
  5.  
  6. -- Overrides
  7.  
  8. local oldPull = os.pullEvent;
  9. os.pullEvent = os.pullEventRaw;
  10.  
  11. -- Code
  12.  
  13. local function getPassword()
  14.     term.clear()
  15.     term.setCursorPos(1,1)
  16.     write("Enter Password: ")
  17.     pass = read("*")
  18.     if pass == password then
  19.         write("Opening Door")
  20.         redstone.setOutput("back", true )
  21.         sleep(3)
  22.         redstone.setOutput("back", false )
  23.     else
  24.         write("Incorrect Password")
  25.         sleep(3)
  26.         term.clear()
  27.         term.setCursorPos(1,1)
  28.         textutils.slowPrint("Terminal Locking Down in 3... 2... 1...")
  29.         sleep(.5)
  30.     end
  31. end
  32.  
  33. -- Start here
  34.    
  35. getPassword()  
  36. os.shutdown()
  37. os.pullEvent = oldPull;
Advertisement
Add Comment
Please, Sign In to add comment