Advertisement
Guest User

lockout

a guest
Feb 22nd, 2017
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.45 KB | None | 0 0
  1. if fs.exists(".logInfo") == false then
  2. shell.run("mkdir .logInfo")
  3. end
  4. if fs.exists(".logInfo/user") == false then
  5. shell.run("pastebin get RxMFL0jM .logInfo/user")
  6. end
  7. if fs.exists(".logInfo/pass") == false then
  8. shell.run("pastebin get ePbRStMG .logInfo/pass")
  9. end
  10. os.pullEvent = os.pullEventRaw
  11. shell.run("gFunctions")
  12. local function login(usnm,pswd)
  13. shell.run(".logInfo/user")
  14. shell.run(".logInfo/pass")
  15. if usnm == user1 then
  16. if pswd == pass1 then
  17. osPrint("Welcome, "..usnm)
  18. sleep(1)
  19. term.clear()
  20. term.setCursorPos(1,1)
  21. shell.run("rom/programs/shell")
  22. else
  23. printError("Incorrect username or password!")
  24. sleep(1)
  25. os.shutdown()
  26. end
  27. elseif usnm == user2 then
  28. if pswd == pass2 then
  29. osPrint("Welcome, "..usnm)
  30. sleep(1)
  31. term.clear()
  32. term.setCursorPos(1,1)
  33. shell.run("rom/programs/shell")
  34. else
  35. printError("Incorrect username or password!")
  36. sleep(1)
  37. os.shutdown()
  38. end
  39. else
  40. printError("Incorrect username or password!")
  41. sleep(1)
  42. os.shutdown()
  43. end
  44. end
  45. term.clear()
  46. term.setCursorPos(1,1)
  47. osWrite("Welcome, would you like to ")
  48. writeError("R")
  49. osWrite("estart, ")
  50. writeError("L")
  51. osPrint("ogin, or")
  52. writeError("S")
  53. osPrint("hutdown?")
  54. osWrite("> ")
  55. rd1 = read()
  56. if rd1 == "R" or rd1 == "r" then
  57. os.reboot()
  58. elseif rd1 == "S" or rd1 == "s" then
  59. os.shutdown()
  60. elseif rd1 == "L" or rd1 == "l" then
  61. term.clear()
  62. term.setCursorPos(1,1)
  63. osWrite("Username: ")
  64. rd1 = read()
  65. osWrite("Password: ")
  66. ps1 = read("*")
  67. login(rd1,ps1)
  68. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement