Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- term.clear()
- term.setCursorPos(1,1)
- local name = ""
- local code = ""
- local names = {}
- local codes = {}
- local count = 0
- while true do
- term.clear()
- term.setCursorPos(1,1)
- print("To stop adding, type STOP in the \"name\" field.")
- print("Already added "..count.." downloads.")
- write("File name: ")
- name = read()
- if name == "STOP" then break end
- write("Pastebin code: ")
- code = read()
- count = count + 1
- names[count] = name
- codes[count] = code
- end
- if count == 0 then
- print("Add at least one file!")
- return
- end
- term.clear()
- term.setCursorPos(1,1)
- write("Save as: ")
- name = read()
- local file = fs.open(name, "w")
- for i = 1, count do
- file.writeLine([[shell.run("pastebin", "get", "]]..codes[i]..[[", "]]..names[i]..[[")]])
- file.flush()
- end
- file.close()
- print("Done! Saved as "..name)
Add Comment
Please, Sign In to add comment