Advertisement
Guest User

.account

a guest
Apr 15th, 2017
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.93 KB | None | 0 0
  1. local pass = fs.open(".accounts/password", "r")
  2. local password = pass.readAll()
  3. pass.close()
  4. local use = fs.open(".accounts/username", "r")
  5. local username = user.readAll()
  6. use.close()
  7. version = "1.0"
  8. term.setBackgroundColour(colors.lightBlue)
  9. term.setTextColour(colors.orange)
  10. local function clear (version)
  11. term.clear()
  12. term.setCursorPos(1,1)
  13. term.write("MathOS " .. version)
  14. term.setCursorPos(1,2)
  15. term.write("Computer's ID is " .. os.getComputerID() .. " and the label is " .. os.getComputerLabel())
  16. term.setCursorPos(1,4)
  17. end
  18. while true do
  19. clear(version)
  20. term.write("what is the username?")
  21. term.setCursorPos(1,5)
  22. local userinput = read()
  23. if userinput == username then
  24. break
  25. else
  26. print("incorrect")
  27. end
  28. end
  29. while true do
  30. clear(version)
  31. term.write("what is the password?")
  32. term.setCursorPos(1,5)
  33. local passinput = read("*")
  34. if passinput == password then
  35. break
  36. end
  37. print("incorrect")
  38. end
  39. shell.run(".MathOS")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement