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.38 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. term.setTextColor(colors.orange);
  16.  
  17. term.setTextColor(colors.green);
  18.  
  19. textutils.slowPrint("Login:");
  20. term.setTextColor(colors.blue);
  21. textutils.slowPrint(" Username:");
  22. term.setTextColor(colors.red);
  23. local username = read();
  24. term.setTextColor(colors.blue);
  25. textutils.slowPrint(" Password:");
  26. term.setTextColor(colors.red);
  27. local password = read("*");
  28.  
  29. function check(u, p)
  30.  
  31. if users[u] == p then
  32. loggedin = true;
  33. user = u;
  34. return true;
  35. end
  36. end
  37.  
  38. if check(username, password) then
  39. term.setTextColor(colors.green);
  40. term.clear();
  41. textutils.slowPrint("Welcome back " .. user);
  42. os.sleep(3);
  43. term.clear();
  44. term.setCursorPos(1, 1);
  45. else
  46. term.clear();
  47. term.setCursorPos(1, 1);
  48. term.setTextColor(colors.red);
  49. textutils.slowPrint("Login information was incorrect!");
  50. shell.run("startup");
  51. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement