Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local repo = "https://raw.githubusercontent.com/SuperRavenSn1per/SoarOS/"
- local branch = "main/"
- local function download(fileName)
- local content = http.get(repo..branch..fileName).readAll()
- local f = fs.open(fileName, "w")
- f.write(content)
- f.close()
- end
- function writeQ(type)
- if type == "q" then
- write("[")
- term.setTextColor(colors.orange)
- write("?")
- term.setTextColor(colors.white)
- write("] : ")
- elseif type == "w" then
- write("[")
- term.setTextColor(colors.red)
- write("!")
- term.setTextColor(colors.white)
- write("] : ")
- elseif type == "g" then
- write("[")
- term.setTextColor(colors.green)
- write("@")
- term.setTextColor(colors.white)
- write("] : ")
- end
- end
- term.clear()
- term.setCursorPos(1,1)
- print("[ SoarOS Installer ]")
- print("Are you sure you want to install SoarOS? (Y/N)\n")
- while true do
- writeQ("q")
- local input = read()
- if string.lower(input) == "y" then
- writeQ("Downloading installer...", "g")
- download("installer.lua")
- writeQ("Running installer...", "g")
- shell.run("installer.lua")
- break
- elseif string.lower(input) == "n" then
- term.clear()
- term.setCursorPos(1,1)
- print("Installation cancelled.")
- else
- print("Please answer with 'Y' or 'N'")
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement