Guest User

Untitled

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