Advertisement
Guest User

Floppy

a guest
Jul 19th, 2016
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.94 KB | None | 0 0
  1. os.pullEvent = os.pullEventRaw
  2. local locker = true
  3. local failed = true
  4. local attempted_login = true
  5. local password_server = 7
  6. rednet.open("front")
  7. while locker do
  8.  attempted_login = false
  9.  term.clear()
  10.  term.setCursorPos(1,1)
  11.  print("Welcome to a Users PC : Roaming Profile Enabled")
  12.  print("What would you like to do?")
  13.  print("[1] Login (*)")
  14.  print("[2] Shutdown")
  15.  write("> ")
  16.  local input = read()
  17.  if input == "2" then
  18.   os.shutdown()
  19.  elseif input == "1" then
  20.   attempted_login = true
  21.   print("Please login...")
  22.   write("Username: ")
  23.   local username = read()
  24.   write("Password: ")
  25.   local password = read("*")
  26.   rednet.send(password_server, username, true)
  27.   senderID, message, distance = rednet.recieve(5)
  28.   if password == message then
  29.    failed = false
  30.    locker = false
  31.    term.clear()
  32.    term.setCursorPos(1,1)
  33.    print("welcome", username
  34.   else
  35.    print("invalid Username or Password.")
  36.    sleep(2)
  37.   end
  38.  end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement