Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- startupexist = fs.exists("startup")
- --shellrun = fileLineGet("startup", zeile)
- running = shell.getRunningProgram()
- version = os.version()
- okay = false
- okay2 = false
- geklickt = false
- backupname = "startupbackup"
- term.setBackgroundColour( colors.green )
- term.setTextColour( colors.cyan )
- term.clear()
- term.setCursorPos(1,1)
- print("PSAV - BETA")
- term.setCursorPos(47,1)
- print("setup")
- term.setCursorPos(1,4)
- if version ~= "CraftOS 1.5" then
- error("Running on "..version..", you need CraftOS 1.4 or higher!")
- end
- if not term.isColor() then
- error("You need an advanced(Golden) computer.")
- end
- if startupexist == true then
- term.setTextColor(colors.red)
- print ("A startup already exists. This may cause problems and the PSAV can't be started at boot.")
- term.setTextColor(colors.white)
- print ("Would you like to copy and rename the current startup file? (please click)")
- term.setCursorPos(3,9)
- term.setBackgroundColour( colors.yellow )
- term.setTextColour( colors.cyan )
- write("yes")
- term.setCursorPos(9,9)
- write("no")
- term.setCursorPos(14,9)
- write("cancel")
- term.setBackgroundColour ( colors.green )
- term.setTextColour( colors.white)
- while geklickt == false do
- event, knopf, x, y = os.pullEvent("mouse_click")
- if (x >= 3) and (x <= 6) and (y == 9) then
- geklickt = true
- print("")
- if fs.exists("/PSAVbackup/startupbackup") then
- repeat
- print("Please choose a name for the renamed startup file.")
- backupname = read()
- until not fs.exists("/PSAVbackup/"..backupname)
- end
- fs.makeDir("PSAVbackup")
- fs.copy("startup", "/PSAVbackup/"..backupname)
- term.setTextColour( colors.yellow )
- print("A folder called \"PSAVbackup\" was created. The startup is now called \""..backupname.."\"")
- end
- if (x >= 14) and (x <= 19) and (y == 9) then
- geklickt = true
- term.setBackgroundColour( colors.black )
- shell.run("clear")
- shell.run("shell")
- end
- if (x >= 9) and (x <= 10) and (y == 9) then
- geklickt = true
- print("")
- end
- end
- end
- f = io.open("/startup", "w")
- f:write("shell.run\(\"PSAV/psav\"\)")
- f:close()
- term.setTextColor(colors.orange)
- print("The necessary files will be downloaded now and placed in a folder called PSAV.")
- print("Please do not terminate this setup, and run a scan at the end, or PSAV won't work.")
- term.setCursorPos(3,19)
- term.setBackgroundColour( colors.yellow )
- term.setTextColour( colors.cyan )
- write("okay")
- while okay == false do
- event, knopf, x, y = os.pullEvent("mouse_click")
- if (x >= 3) and (x <= 7) and (y == 19) then
- okay = true
- fs.makeDir("/PSAV")
- shell.run("pastebin get A2ANd03G /PSAV/psav")
- shell.run("pastebin get Gdnjpv2W /PSAV/scan")
- shell.run("pastebin get Ev5qReqD /PSAV/details")
- fs.makeDir("/PSAV/reports/")
- shell.run("pastebin get dF82bcmi /PSAV/problems.txt")
- shell.run("pastebin get rvP2fXrn /PSAV/settings")
- fs.makeDir("/PSAV/config/")
- shell.run("pastebin get T9sTsgti /PSAV/config/config.txt")
- term.setBackgroundColour( colors.black )
- fs.makeDir("/PSAV/reports/")
- end
- end
- term.setBackgroundColour( colors.green )
- term.setTextColour( colors.cyan )
- term.clear()
- term.setCursorPos(1,1)
- print("PSAV - BETA")
- term.setCursorPos(47,1)
- print("setup")
- term.setCursorPos(2,4)
- term.setTextColour( colors.lime )
- print("The setup is nearly done! Please run a first time scan. Necessary files will be created while the scan.")
- term.setCursorPos(3,19)
- term.setBackgroundColour( colors.yellow )
- term.setTextColour( colors.cyan )
- write("okay")
- term.setBackgroundColour( colors.green )
- while okay2 == false do
- event, knopf, x, y = os.pullEvent("mouse_click")
- if (x >= 3) and (x <= 7) and (y == 19) then
- shell.run("/PSAV/scan")
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment