Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local OutputFile = nil
- local outfile = nil
- local GluedFile = "LAPIPack"
- local GluedFileData = nil
- local running = true
- term.setBackgroundColor(colors.white)
- term.setTextColor(colors.blue)
- tx, ty = term.getSize()
- term.clear()
- term.setCursorPos(tx/2-11, ty/2)
- write("Install LayerAPI? y/n")
- local _, key = os.pullEvent("char")
- if (key == "n") then shell.run("reboot") end
- term.clear()
- term.setCursorPos(1, 1)
- print("Download LAPI packet...")
- if (not shell.run("pastebin get eiKE970W LAPIPack")) then
- term.clear()
- term.setCursorPos(tx/2-8, ty/2)
- write("Error. Reboot...")
- sleep(2)
- end
- infile = fs.open(GluedFile, "r")
- function unglue()
- GluedFileData = infile.readLine()
- if GluedFileData == "<eof>" then outfile.close() running = false return end
- local _, _i = string.find(GluedFileData, "<GluePath>")
- if _i then
- print("Unpack " .. string.sub(GluedFileData, _i) .. " file...")
- if outfile then outfile.close() print("Done.")end
- outfile = fs.open(string.sub(GluedFileData, _i), "a")
- --unglue() --KILL MEGA RECURSIVE
- else
- if outfile then
- outfile.writeLine(GluedFileData)
- unglue()
- else outfile.close() return end
- end
- end
- while running do
- unglue()
- end
- infile.close()
- print("/nLAPI installed. Press any key.")
- shell.run("reboot")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement