Advertisement
Guest User

startup

a guest
Apr 14th, 2016
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.62 KB | None | 0 0
  1. term.clear()
  2. term.setCursorPos(1,1)
  3.  
  4. print("Enter username and password to login")
  5. print(" ")
  6. print("Username: ")
  7. print("Password: ")
  8. term.setCursorPos(11,3)
  9. local userInput = read()
  10. term.setCursorPos(11,4)
  11. local passInput = read("*")
  12. local u = fs.open("sys/username", "r")
  13. local username = u.readLine()
  14. u.close()
  15. local p = fs.open("sys/password", "r")
  16. local password = p.readLine()
  17. p.close()
  18. if userInput == username and passInput == password then
  19. print("Welcome "..username)
  20. sleep(2)
  21. term.clear()
  22. term.setCursorPos(1,1)
  23. shell.run("sys/os")
  24. else
  25. print("Incorrect username or password")
  26. sleep(2)
  27. os.reboot()
  28. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement