Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local version =
- 0.07
- local pastebinlink = "5rALib9G" --The pastebin "code"
- local password = "123bacon" -- The password required to unlock the computer
- trys = 3 -- The number of trys before anti bruteforce
- bruteforcetime = 18 -- The amount of time the antibruteforce should take
- --==check version by Cranium==--
- function versioncheck()
- term.clear()
- term.setCursorPos(1,1)
- print("Program loading...")
- print("Current version: "..version)
- local updateSite = http.get("http://pastebin.com/raw.php?i="..pastebinlink)
- updateSite.readLine()
- local coding = updateSite.readLine()
- local newVersion = (tonumber(coding))
- sleep(2)
- if tonumber(newVersion) > version then
- print("Newest version is: "..newVersion)
- print("Update required. Updating now...")
- local updateSite = http.get("http://pastebin.com/raw.php?i="..pastebinlink)
- local siteFile = updateSite.readAll()
- local writeFile = fs.open(shell.getRunningProgram(),"w")
- writeFile.write(siteFile)
- writeFile.close()
- print("The program will now restart your computer.")
- sleep(2)
- os.reboot()
- end
- end
- --==Password protection function==--
- function locked()
- tryerror = trys
- locked = true
- while locked == true do
- term.clear()
- term.setCursorPos(1,1)
- print("Please enter the password:")
- input = read("*")
- if input == password then
- print("Welcome")
- tryerror = trys
- sleep(1)
- locked = false
- term.clear()
- term.setCursorPos(1,1)
- print("+--------------------{NewkOS}--------------------+\n")
- unlocked()
- else
- print("PASSWORD INCORRECT!")
- tryerror = tryerror - 1
- sleep(2)
- if tryerror < 1 then
- print("Brute Force Detected")
- sleep(bruteforcetime)
- tryerror = trys
- end
- end
- end
- end
- --==Beyond protection function==--
- function unlocked()
- input = read()
- if input == "version" then
- print("Current version: "..version)
- unlocked()
- elseif input == "lock" then
- locked = true
- elseif input == "shutdown" then
- print("Shutting down...")
- sleep(1)
- os.shutdown()
- elseif input == "reboot" then
- print("Rebooting")
- sleep(1)
- os.reboot()
- end
- end
- --==starting==--
- versioncheck()
- locked()
Advertisement
Add Comment
Please, Sign In to add comment