Guest User

Untitled

a guest
Oct 14th, 2018
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.77 KB | None | 0 0
  1. os.pullEvent = os.pullEventRaw
  2.  
  3. local users={"orloc","vsandrew"}
  4. local side = "right"
  5. local opentime = 4
  6.  
  7. while true do
  8.  term.clear()
  9.  term.setCursorPos(1,1)
  10.  write("Username: ")
  11.  local name = read()
  12.  for i=0, 1 do
  13.    if users[i] ~= name then
  14.      write("Username not in our records! Forcing Logout")
  15.      sleep(2)
  16.      os.reboot()
  17.    end
  18.  end
  19.  
  20.  if name == "orloc" then
  21.    local password = "jak3"
  22.  elseif name =="vsandrew" then
  23.    local password ="password")
  24.  end
  25.  
  26.  write("Password: ")
  27.  local input = read("*")
  28.  if input == password then
  29.   term.clear()
  30.   term.setCursorPos(1,1)
  31.   print("Password correct!")
  32.   rs.setOutput(side,true)
  33.   sleep(opentime)
  34.   rs.setOutput(side,false)
  35.  else
  36.   print("Password incorrect!")
  37.   sleep(2)
  38.  end
  39. end
Add Comment
Please, Sign In to add comment