Advertisement
Guest User

Login

a guest
Sep 2nd, 2014
250
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.57 KB | None | 0 0
  1. --[[
  2.     Login for new Terminal in CraftOS 6.2,
  3.     this will use the username you set the
  4.     first time you booted this version!
  5. --]]
  6.  
  7. term.setBackgroundColour(colours.lightBlue)
  8. term.clear()
  9. term.setCursorPos(1, 1)
  10.  
  11. print ("User login")
  12. print ("---------------------------------------------------")
  13. print ("  ")
  14. print ("  To reset password run 'reset' in CraftOS folder")
  15.  
  16. term.setCursorPos(13, 7)
  17. term.setBackgroundColour(400)
  18.  
  19. print ("                          ")
  20. term.setCursorPos(13, 8)
  21. print ("                          ")
  22. term.setCursorPos(13, 9)
  23. print ("                          ")
  24. term.setCursorPos(13, 10)
  25. print ("                          ")
  26.  
  27. term.setCursorPos(17, 8)
  28.  
  29. write("Username: ")
  30.  
  31. password = fs.open("CraftOS/Terminal/Username","r")
  32.  if password then
  33.   password1 = password.readLine()
  34.  end
  35.  
  36. computer = read ()
  37. if computer == password1 then
  38. end
  39.  
  40. term.setCursorPos(17, 9)
  41.  
  42. write("Password: ")
  43.  
  44. username = fs.open("CraftOS/Terminal/Password","r")
  45.  if username then
  46.   username1 = username.readLine()
  47.  end
  48.  
  49. answer = read ('*')
  50. if answer == username1 then
  51.  term.setBackgroundColour(colours.lightBlue)
  52.  term.setCursorPos(13, 10)
  53.  term.clearLine()
  54.  term.setBackgroundColour(400)
  55.  print (" [Loading preferences...] ")
  56.  sleep(1.7)
  57. else
  58.  term.setBackgroundColour(colours.lightBlue)
  59.  term.setCursorPos(13, 10)
  60.  term.clearLine()
  61.  term.setBackgroundColour(400)
  62.  print ("    [Wrong username]      ")
  63.  sleep(1)
  64.  shell.run("CraftOS/Terminal/Login")
  65. end
  66.  
  67. term.setBackgroundColour(colours.black)
  68. term.clear()
  69. term.setCursorPos(1, 1)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement