Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[ Login screen ]]--
- username = "Admin"
- Access = "Login"
- password = "password"
- currentVersion = "1.3.2"
- updateAvailable = "false"
- autoUpdate = "true"
- os.pullEvent = os.pullEventRaw
- --[[ functions ]]--
- function startscreen(print)
- term.clear()
- term.setCursorPos(1,1)
- print("+========+")
- print("|Craft OS|")
- print("+========+")
- print("")
- print("+=======================+")
- print("|Username: |")
- print("+=======================+")
- print("")
- print("+=======================+")
- print("|Password: |")
- print("+=======================+")
- print("")
- print("Access: "..Access.."")
- end
- function login()
- term.setCursorPos(12,6)
- unbox = read()
- if unbox == "update" then
- autoupdate()
- elseif unbox ~= username then
- term.setCursorPos(9,13)
- print("Incorrect username!")
- sleep(2)
- shell.run("startup")
- else
- term.setCursorPos(1,13)
- term.setCursorPos(1,13)
- term.setCursorPos(12,10)
- pwbox = read("*")
- if pwbox == password then
- term.setCursorPos(1,13)
- print("")
- term.setCursorPos(1,13)
- Access = "Granted!"
- print("Access: "..Access.."")
- sleep(3)
- term.clear()
- term.setCursorPos(1,1)
- else
- os.reboot()
- end
- end
- end
- function updateCheck()
- term.clear()
- term.setCursorPos(1,1)
- print("+--------------------------+")
- print("|Checking for updates... |")
- print("+--------------------------+")
- print("+--------------------------+")
- print("| |")
- print("+--------------------------+")
- term.setCursorPos(2,5)
- textutils.slowPrint("//////////////////////////", 8)
- term.clear()
- term.setCursorPos(1,1)
- local h, version = http.get( "http://pastebin.com/raw.php?i=9nXEnf7x" )
- if h then
- version = h.readAll()
- if version ~= currentVersion then
- print("+--------------------------+")
- print("|Update found! |")
- print("+--------------------------+")
- print("+--------------------------+")
- print("|Version: |")
- print("+--------------------------+")
- print("+--------------------------+")
- print("|Downloading... |")
- print("+--------------------------+")
- term.setCursorPos(11,5)
- print(version)
- sleep(3)
- shell.run("pastebin run JuYtAwrk")
- else
- print("+--------------------------+")
- print("|Current update owned! |")
- print("+--------------------------+")
- end
- else
- print( "Couldn't connect to pastebin!" )
- end
- end
- updateCheck()
- startscreen(print)
- login()
Advertisement
Add Comment
Please, Sign In to add comment