Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local tArg = {...}
- local Path = "boot/files/apis.txt"
- local APIs = {}
- function AddAPI(Pro)
- local file = fs.open(Path,"r")
- APIs = textutils.unserialize(file.readAll())
- file.close()
- APIs[#APIs + 1] = Pro
- local Doc = fs.open(Path,"w")
- Doc.write(textutils.serialize(APIs))
- Doc.close()
- end
- function LoadAPI()
- local file = fs.open(Path,"r")
- APIs = textutils.unserialize(file.readAll())
- file.close()
- for i = 1, #APIs do
- os.loadAPI(APIs[i])
- end
- end
- function Setup()
- APIs = {"os/System/Tools/App.lua","os/System/Tools/fsAdv.lua","os/System/Tools/Sec.lua"}
- local file = fs.open(Path,"w")
- file.write(textutils.serialize(APIs))
- file.close()
- end
- if tArg[1] == "add" then
- AddAPI(tArg[2])
- elseif tArg[1] == "start" then
- LoadAPI()
- elseif tArg[1] == "setup" then
- Setup()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement