Advertisement
Guest User

login

a guest
Apr 13th, 2016
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.86 KB | None | 0 0
  1. os.loadAPI("Sysyem/apis/tntapi")
  2. local password = tntapi.readFile("System/etc/passwd")
  3. local username = tntapi.readFile("System/etc/users")
  4. tntapi.setScreen(10,10,colors.white,colors.blue)
  5. tntapi.easyText("Enter username",1,17,10)
  6. term.setCursorPos(17,11)
  7. userinput = read()
  8. if userinput ~= username then
  9.  tntapi.setScreen(1,1,colors.white,colors.red)
  10.  tntapi.easyText("Invalid Username!",1,1,1)
  11.  os.sleep(2)
  12.  os.reboot()
  13. end
  14.  
  15. tntapi.setScreen(10,10,colors.white,colors.blue)
  16. tntapi.easyText("Enter password",1,17,10)
  17. term.setCursorPos(17,11)
  18. passwordInput = read("*")
  19. if passwordInput ~= password then
  20.   tntapi.setScreen(10,10,colors.white,colors.red)
  21.   tntapi.easyText("Invalid Password!",1,1,1)
  22.   os.sleep(2)
  23.   os.reboot()
  24. end
  25. term.setCursorPos(1,1)
  26. tntapi.easyTextwColor(colors.lime,"Logging in...",1)
  27. os.sleep(2)
  28. shell.run("System/user/startdesktop")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement