SimSoft Yellow - A Simple And Fast OS
Description
App Installer - by LDDestroier and SimlorLP
Installation
Copy one of these commands into your ComputerCraft terminal:
Pastebin:
pastebin get KBRxL3B6 simsoft_yellow_-_a_simple_and_fast_oswget:
wget https://pastebin.com/raw/KBRxL3B6 simsoft_yellow_-_a_simple_and_fast_osArchive:
wget https://cc.shobie.xyz/cc/get/pb-KBRxL3B6 simsoft_yellow_-_a_simple_and_fast_os
Quick Install:
wget https://cc.shobie.xyz/cc/get/pb-KBRxL3B6 SimSoft Yellow - A Simple And Fast OS
Usage
Run the program after downloading
Tags
Source
View Original SourceCode Preview
--App Installer - by LDDestroier and SimlorLP
--Free for use and modification
local pF = {
name = "Example", --name of executed program
folder = "exampleFolder", --folder of executed program and other files
colorCode = 1, --number code of icon, 1-20 currently (http://simsoft-en.jimdo.com/for-developers)
liveSystem = "", --enables livesystem file
files = { --names and pasteIDs of all files. allows directories too
["Example"] = "pasteID", --make SURE to make one entry the same as 'name', or else it won't execute anything
["cfg/exampleAPI"] = "anotherPasteID" --this works
}
}
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("App limit has been reached! Delete one to make space. Sorry.")
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)