Advertisement
Guest User

Untitled

a guest
May 21st, 2017
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.41 KB | None | 0 0
  1. loggedin = false;
  2. local user = "null";
  3. users = {["werty"] = "Werty", ["human"] = "hi"};
  4.  
  5. term.setTextColor(colors.green);
  6. textutils.slowPrint("Welcome to Human-OS");
  7. textutils.slowPrint("");
  8. textutils.slowPrint(" _ _ ____ _____
  9. textutils.slowPrint(" / / / / / __ \ / ____|
  10. textutils.slowPrint(" / /__/ / | | | | (___
  11. textutils.slowPrint(" / __ / | | | |\___ \
  12. textutils.slowPrint(" / / / / | |__| |____) |
  13. textutils.slowPrint(" /_/ /_/ \____/|_____/
  14. textutils.slowPrint("
  15. textutils.slowPrint("
  16. textutils.slowPrint("
  17. term.setTextColor(colors.orange);
  18.  
  19. term.setTextColor(colors.green);
  20.  
  21. textutils.slowPrint("Login:");
  22. term.setTextColor(colors.blue);
  23. textutils.slowPrint(" Username:");
  24. term.setTextColor(colors.red);
  25. local username = read();
  26. term.setTextColor(colors.blue);
  27. textutils.slowPrint(" Password:");
  28. term.setTextColor(colors.red);
  29. local password = read("*");
  30.  
  31. function check(u, p)
  32.  
  33. if users[u] == p then
  34. loggedin = true;
  35. user = u;
  36. return true;
  37. end
  38. end
  39.  
  40. if check(username, password) then
  41. term.setTextColor(colors.green);
  42. term.clear();
  43. textutils.slowPrint("Welcome back " .. user);
  44. os.sleep(3);
  45. term.clear();
  46. term.setCursorPos(1, 1);
  47. else
  48. term.clear();
  49. term.setCursorPos(1, 1);
  50. term.setTextColor(colors.red);
  51. textutils.slowPrint("Login information was incorrect!");
  52. shell.run("startup");
  53. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement