Killer-Mark

NewkOS

Nov 7th, 2012
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.00 KB | None | 0 0
  1. local version =
  2. 0.07
  3. local pastebinlink = "5rALib9G" --The pastebin "code"
  4. local password = "123bacon" -- The password required to unlock the computer
  5. trys = 3 -- The number of trys before anti bruteforce
  6. bruteforcetime = 18 -- The amount of time the antibruteforce should take
  7.  
  8.  
  9. --==check version by Cranium==--
  10. function versioncheck()
  11. term.clear()
  12. term.setCursorPos(1,1)
  13. print("Program loading...")
  14. print("Current version: "..version)
  15. local updateSite = http.get("http://pastebin.com/raw.php?i="..pastebinlink)
  16. updateSite.readLine()
  17. local coding = updateSite.readLine()
  18. local newVersion = (tonumber(coding))
  19. sleep(2)
  20. if tonumber(newVersion) > version then
  21. print("Newest version is: "..newVersion)
  22. print("Update required. Updating now...")
  23. local updateSite = http.get("http://pastebin.com/raw.php?i="..pastebinlink)
  24. local siteFile = updateSite.readAll()
  25. local writeFile = fs.open(shell.getRunningProgram(),"w")
  26. writeFile.write(siteFile)
  27. writeFile.close()
  28. print("The program will now restart your computer.")
  29. sleep(2)
  30. os.reboot()
  31. end
  32. end
  33.  
  34.  
  35. --==Password protection function==--
  36. function locked()
  37. tryerror = trys
  38. locked = true
  39. while locked == true do
  40. term.clear()
  41. term.setCursorPos(1,1)
  42. print("Please enter the password:")
  43. input = read("*")
  44. if input == password then
  45. print("Welcome")
  46. tryerror = trys
  47. sleep(1)
  48. locked = false
  49. term.clear()
  50. term.setCursorPos(1,1)
  51. print("+--------------------{NewkOS}--------------------+\n")
  52. unlocked()
  53. else
  54. print("PASSWORD INCORRECT!")
  55. tryerror = tryerror - 1
  56. sleep(2)
  57. if tryerror < 1 then
  58. print("Brute Force Detected")
  59. sleep(bruteforcetime)
  60. tryerror = trys
  61. end
  62. end
  63. end
  64. end
  65.  
  66.  
  67. --==Beyond protection function==--
  68. function unlocked()
  69. input = read()
  70. if input == "version" then
  71. print("Current version: "..version)
  72. unlocked()
  73. elseif input == "lock" then
  74. locked = true
  75. elseif input == "shutdown" then
  76. print("Shutting down...")
  77. sleep(1)
  78. os.shutdown()
  79. elseif input == "reboot" then
  80. print("Rebooting")
  81. sleep(1)
  82. os.reboot()
  83. end
  84. end
  85.  
  86.  
  87. --==starting==--
  88. versioncheck()
  89. locked()
Advertisement
Add Comment
Please, Sign In to add comment