Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Installer for the Super Text Downloader GUI version.
- --This store detects if SimSoft is installed, and can download things to your desktop!
- -- Template designed by LDDestroier (me) and Simlor.
- local pF = {
- name = "STDgui",
- folder = "stdgui",
- colorCode = 8,
- liveSystem = "",
- files = {
- ["STDgui"] = "P9dDhQ2m",
- [".std_list"] = "FSCzZRUk",
- }
- }
- local getFromPastebin = function(code,path)
- if not type(code) == "string" then
- error("Expected pastebin code")
- elseif not type(path) == "string" then
- error("Expected file path")
- end
- local prog = http.get("http://pastebin.com/raw/"..code)
- if not code then
- return false, "could not connect"
- end
- prog = prog.readAll()
- if fs.exists(fs.getName(path)) and not fs.isDir(fs.getName(path)) then
- return false, "file exists in that path"
- end
- if not fs.exists(fs.getDir(path)) then
- fs.makeDir(fs.getDir(path))
- end
- local file = fs.open(path,"w")
- file.write(prog)
- file.close()
- return true, fs.getSize(path)
- end
- function appInstaller(name,farbe,ver,loesch,LiveJaNein,LivePfad)
- term.setBackgroundColor(128)
- term.setTextColor(1)
- term.clear()
- print("Starting installation...")
- --Absicherung
- local file = fs.open("SimSoft/Daten/SappS/A","r")
- local fileData = {}
- local line = file.readLine()
- repeat
- table.insert(fileData,line)
- line = file.readLine()
- until line == nil
- file.close()
- anz = tonumber(fileData[1])
- if anz >= 15 then
- print("Too many apps.")
- sleep(0.4)
- return
- else
- anz = (anz+1)
- local file = fs.open("SimSoft/Daten/SappS/A","w")
- file.write(anz)
- file.close()
- local file = fs.open("SimSoft/Daten/SappS/"..anz,"w")
- file.writeLine(name)
- file.writeLine(anz)
- file.writeLine(farbe.."\n")
- file.writeLine(ver)
- file.writeLine(loesch)
- if LiveJaNein ~= "" then
- file.writeLine("t")
- file.writeLine(LiveJaNein)
- else
- file.writeLine("f\n")
- end
- file.close()
- end
- end
- for k,v in pairs(pF.files) do
- getFromPastebin(v,fs.combine(fs.combine("SimSoft/SappS",pF.folder),k))
- end
- appInstaller(string.sub(pF.name,1,6),tostring(pF.colorCode)..".0",fs.combine(pF.folder,pF.name),pF.folder,pF.liveSystem)
Add Comment
Please, Sign In to add comment