Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local lpath = shell.resolve(".").."/goldrunner"
- local exeCode = "bGdCnPmp"
- local levCodes = {
- [1] = { code = "ibFSWdZM"; name = "warmup.nfp"; };
- [2] = { code = "En1ZKwX6"; name = "homage.nfp"; };
- [3] = { code = "aBstxN1B"; name = "pyramid.nfp"; };
- [4] = { code = "neEApRwE"; name = "cavein.nfp"; };
- [5] = { code = "uGuThknj"; name = "skyislands.nfp"; };
- }
- if fs.exists(lpath) then
- print(lpath.." already exists. Rename or use another directory to install.")
- return
- end
- print("GoldRunner Installer")
- print("\nInstalling to the following directory:")
- term.setTextColour(colours.yellow)
- print(" "..lpath.."\n")
- term.setTextColour(colours.white)
- term.write("Ready to install? Y/N: ")
- while true do
- local _,p1 = os.pullEvent("key")
- if p1 == keys.y then
- term.setTextColour(colours.lime)
- print("Y\n")
- break
- elseif p1 == keys.n then
- term.setTextColour(colours.red)
- print("N\n")
- return
- end
- end
- term.setTextColour(colours.white)
- term.write("Creating "..lpath.."... ")
- fs.makeDir(lpath)
- term.write("Creating "..lpath.."/levels... ")
- fs.makeDir("/"..lpath.."/levels")
- term.setTextColour(colours.white)
- print("Downloading "..exeCode.."... ")
- if not shell.run("pastebin", "get", exeCode, lpath.."/GoldRunner") then
- term.setTextColour(colours.red)
- print("failed!")
- return
- else
- term.setTextColour(colours.lime)
- print("complete.")
- end
- for i=1,#levCodes do
- term.setTextColour(colours.white)
- print("Downloading "..levCodes[i].code.."... ")
- if not shell.run("pastebin", "get", levCodes[i].code, lpath.."/levels/"..i.."_"..levCodes[i].name) then
- term.setTextColour(colours.red)
- print("failed!")
- return
- else
- term.setTextColour(colours.lime)
- print("complete.")
- end
- end
- print("Installation complete!")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement