Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local w,h = term.getSize()
- --local FILE = fs.open(".version","r")
- --local Ver = FILE.readLine()
- --FILE.close()
- --functions
- local function printCentered(str, ypos)
- term.setCursorPos(w/2 - #str/2, ypos)
- term.write(str)
- end
- local function logIn()
- term.clear()
- term.setCursorPos(1,1)
- local linfo = fs.exists("logInfo")
- if linfo == true then
- printCentered("Please login to continue",1)
- printCentered(string.rep("-",w),2)
- printCentered("username:",5)
- local user = read()
- printCentered("password:",7)
- local pass = read()
- local User = fs.open("logInfo/.UserName","r")
- local Pass = fs.open("logInfo/.PassWord","r")
- local Username = User.readLine()
- local Password = Pass.readLine()
- if user == Username and pass == Password then
- printCentered("login sucsseful",9)
- sleep(1)
- shell.run(".menu")
- else
- printCentered("login incorrect",9)
- sleep(1)
- os.shutdown()
- end
- else
- print("so your new?")
- print("what would you like to be called?")
- newUser = read()
- print("what would you like for a password?")
- newPass = read()
- fs.makeDir("logInfo")
- newU = fs.open("logInfo/.UserName","a")
- newU.writeLine(newUser)
- newU.close()
- newP = fs.open("logInfo/.PassWord","a")
- newP.writeLine(newPass)
- newP.close()
- shell.run("reboot")
- end
- end
- local function updateCheck()
- term.clear()
- printCentered("checking for updates",h/2)
- term.setCursorPos(1,h+1)
- local True = shell.run("pastebin get","Qvzk5rrV","versionCheck")
- if True == true then
- local File1 = fs.open("versionCheck","r")
- local File2 = fs.open(".version","r")
- local Lver = File2.readLine()
- local Gver = File1.readLine()
- os.sleep(1)
- if Gver == Lver then
- File1.close()
- File2.close()
- printCentered("this system is up to date",h/2)
- os.sleep(2)
- shell.run("delete","versionCheck")
- else
- File1.close()
- File2.close()
- printCentered("there is a new update",h/2)
- os.sleep(0.2)
- printCentered("installing now",h/2)
- shell.run("delete","versionCheck")
- shell.run("pastebin run","kVGQjw3A")
- end
- end
- end
- --initilizer
- printCentered("initailizing FToS",1)
- term.setCursorPos(1,2)
- print(string.rep("-",w))
- os.sleep(2)
- term.setCursorPos(2,h-2)
- for i = 0,w - 4 do
- term.setBackgroundColor(colors.blue)
- write(" ")
- os.sleep(0.2)
- term.setBackgroundColor(colors.black)
- write(" ")
- end
- term.setBackgroundColor(colors.black)
- os.sleep(1)
- updateCheck()
- logIn()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement