Guest User

door

a guest
Mar 6th, 2013
165
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.97 KB | None | 0 0
  1. local sleepTime = 2.5
  2. local debug = "4244"
  3. local oldPull = os.pullEvent
  4. s = fs.open("doorSide", "r")
  5.  texts = s.readAll()
  6.   s.close()
  7. p = fs.open("passWord", "r")
  8.  textp = p.readAll()
  9.   p.close()
  10. u = fs.open("userName", "r")
  11.  textu = u.readAll()
  12.   u.close()
  13. os.pullEvent = os.pullEventRaw
  14.   while true do
  15.    term.clear()
  16.    term.setCursorPos(1,1)
  17.      print("User: "..textu)
  18.    term.setCursorPos(1,2)
  19.      write("Password:")
  20.    input = read("*")
  21.   if input == debug then
  22.     term.clear()
  23.     term.setCursorPos(1,1)
  24.      print("Entering debug mode...")
  25.       sleep(sleepTime)
  26.     term.clear()
  27.     term.setCursorPos(1,1)
  28.      break
  29.   elseif input == textp then
  30.    term.clear()
  31.    term.setCursorPos(1,1)
  32.     print("Password correct!")
  33.     rs.setOutput(texts, true)
  34.     sleep(sleepTime)
  35.     rs.setOutput(texts, false)
  36.   else
  37.    term.clear()
  38.    term.setCursorPos(1,1)
  39.     print("Password incorrect...")
  40.     sleep(sleepTime)
  41.  end
  42. end
  43. os.pullEvent = oldPull
Advertisement
Add Comment
Please, Sign In to add comment