Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- print("\n\nlook in local library? (y/n)")
- local loc = read()
- print("\n\nprogram name/pasteID : ")
- local name = read()
- print("\n\nsave as ")
- local dest = read()
- print("\n\n")
- if loc == "y" then
- lib = fs.open("OS/lib.txt", "r")
- while true do
- paste = lib.readLine()
- if paste == nil then
- error("no program found in library.")
- end
- filename = lib.readLine()
- if name == filename then
- if dest ~= "" then
- savename = dest
- else
- savename = filename
- end
- shell.run("pastebin","get",paste,savename)
- local reg = fs.open("OS/programs.txt","a")
- reg.writeLine("")
- reg.writeLine(paste)
- reg.writeLine(savename)
- reg.close()
- error("done")
- end
- end
- end
- if loc == "n" then
- shell.run("pastebin","get",name,dest)
- local reg = fs.open("OS/programs.txt","a")
- reg.writeLine("")
- reg.writeLine(name)
- reg.writeLine(dest)
- reg.close()
- error("done")
- end
Advertisement
Advertisement