Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local url = "https://raw.githubusercontent.com/SuperRavenSn1per/RavenPack/main/"
- local files = {"ravenpack/rpu.lua", "rpu_loader.lua"}
- local filesInstalled = 0
- local percent = 0
- function install(file, fileName)
- local dat = http.get(url..file).readAll()
- local f = fs.open(fileName, "w")
- f.write(dat)
- f.close()
- filesInstalled = filesInstalled + 1
- percent = math.floor(filesInstalled / #files * 100)
- print("Installing..."..file.." ("..percent.."%)")
- end
- term.clear()
- term.setCursorPos(1,1)
- term.setTextColor(colors.orange)
- print("-----------------------")
- print("| RavenPack Installer |")
- print("-----------------------")
- print("")
- term.setTextColor(colors.white)
- print("Would you like us to add our custom startup file? If not then you will have to run 'rpu_loader.lua' manually.")
- print("")
- while true do
- term.setTextColor(colors.red)
- write("Y/N >> ")
- term.setTextColor(colors.white)
- local input = read()
- if string.lower(input) == "y" then
- print("")
- if fs.exists("startup") then
- fs.delete("startup")
- elseif fs.exists("startup.lua") then
- fs.delete("startup.lua")
- end
- local sdat = http.get(url.."startup.lua").readAll()
- local sf = fs.open("startup.lua", "w")
- sf.write(sdat)
- sf.close()
- break
- elseif string.lower(input) == "n" then
- print("")
- break
- else
- print("Invalid input... please enter (y/n)")
- end
- end
- term.clear()
- term.setCursorPos(1,1)
- term.setTextColor(colors.orange)
- print("-----------------------")
- print("| RavenPack Installer |")
- print("-----------------------")
- print("")
- term.setTextColor(colors.white)
- print("Making directories...")
- fs.makeDir("ravenpack")
- for i,file in pairs(files) do
- install(file, file)
- end
- print("Installation finished. Would you like to reboot?")
- while true do
- term.setTextColor(colors.red)
- write("Y/N >> ")
- term.setTextColor(colors.white)
- local input = read()
- if string.lower(input) == "y" then
- print("Rebooting...")
- sleep(1)
- os.reboot()
- elseif string.lower(input) == "n" then
- term.clear()
- term.setCursorPos(1,1)
- print("RavenPack has successfully been installed!")
- break
- else
- print("Invalid input... please enter (y/n)")
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment