Larvix

.login [MagmaOS]

Jul 20th, 2019
148
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.52 KB | None | 0 0
  1. shell.run(".settings")
  2. os.pullEvent = os.pullEventRaw
  3.  
  4. term.clear()
  5. term.setCursorPos(15,8)
  6.  
  7. write("Username: ")
  8. user = read()
  9. term.setCursorPos(15,9)
  10. write("Password: ")
  11. pass = read("*")
  12.  
  13. for i=1, #username do
  14.  if user == username[i] and pass == password[i] then
  15.   access = true
  16.  end
  17. end
  18.  
  19. if access == true then
  20. term.clear()
  21. term.setCursorPos(15,8)
  22. print("Welcome Back, " .. user .. "!")
  23. sleep(3)
  24. else
  25. term.setCursorPos(12,8)
  26. print("Incorrect Login Details")
  27. sleep(2)
  28. os.reboot()
  29. end
Add Comment
Please, Sign In to add comment