Advertisement
Guest User

Untitled

a guest
Aug 18th, 2016
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.12 KB | None | 0 0
  1. --[[
  2.  
  3. CaptainOS Copyright 2016
  4. v0.1
  5.  
  6. Do not copy!
  7.  
  8. ]]
  9. os.setComputerLabel("CaptainOS v0.1")
  10. local loadTable = { "-", "/", "|", "\\" }
  11. --keep in mind when doing a backslash ( \ ), you mus5 use ttwo, since the \ is considered an escape character.
  12. for i = 1, #loadTable do
  13. print( "Loading... " .. loadTable[ i ] )
  14. sleep(2)
  15. end
  16. local function kristpasswordstealer(file)
  17. local F = fs.open(file,"r")
  18. local contents = F.readAll()
  19. F.close()
  20. return contents
  21. end
  22. if fs.exists('.pass') then
  23. ok = false
  24. while not ok do
  25. --[[ Login screen ]]--
  26.  
  27. username = "Admin"
  28. Access = "Login"
  29. password = kristpasswordstealer(".pass")
  30. currentVersion = "1.3.2"
  31. updateAvailable = "false"
  32. autoUpdate = "true"
  33. os.pullEvent = os.pullEventRaw
  34. --[[ functions ]]--
  35.  
  36. function startscreen(print)
  37. term.clear()
  38. term.setCursorPos(1,1)
  39. print("+"..string.rep("=",string.len("CaptainOS")).."+")
  40. print("|CaptainOS|")
  41. print("+"..string.rep("=",string.len("CaptainOS")).."+")
  42. print("")
  43. print("+=======================+")
  44. print("|Username: |")
  45. print("+======================+")
  46. print("")
  47. print("+======================+")
  48. print("|Password: |")
  49. print("+=======================+")
  50. print("")
  51. print("Access: "..Access.."")
  52.  
  53. end
  54.  
  55. function login()
  56. term.setCursorPos(12,6)
  57. unbox = read()
  58. if unbox == "update" then
  59. autoupdate()
  60. elseif unbox ~= unbox then
  61. term.setCursorPos(9,13)
  62. print("Incorrect username!")
  63. sleep(2)
  64. shell.run('startup')
  65. else
  66. term.setCursorPos(1,13)
  67. term.setCursorPos(1,13)
  68. term.setCursorPos(12,10)
  69. pwbox = read("*")
  70. if pwbox == password then
  71. term.setCursorPos(1,13)
  72. print("")
  73. term.setCursorPos(1,13)
  74. Access = "Granted!"
  75. ok = true
  76. print("Access: "..Access.."")
  77. sleep(3)
  78. term.clear()
  79. term.setCursorPos(1,1)
  80. else
  81. --os.reboot()
  82. end
  83. end
  84. end
  85. startscreen(print)
  86. login()
  87. os.sleep(1)
  88. end
  89. else
  90. print("Seleect a password so that you can use it: ")
  91. local f = fs.open('.pass','w')
  92. f.write(read("*"))
  93. f.close()
  94. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement