97 posts
Posted 20 August 2014 - 07:58 AM
I was wondering if it's possible to make it will put all the files in a directory into pastebin then make a text copy of the filename and code that it uploaded to pastebin?
1080 posts
Location
In the Matrix
Posted 20 August 2014 - 08:33 AM
I'm afraid i don't understand what you're asking. Are you asking if you can use a single pastebin paste to install multiple files? Or are you asking if you can save where the computer's uploads to pastebin get sent? The answer to the first is yes, you can use it just do shell.run("pastebin get <paste> <filename>") for each file and then shell.run("firstfile"). If you're asking about the second i would look into tables and the fs API, a simple tutorial to file saving can be found
here.
97 posts
Posted 21 August 2014 - 04:03 AM
Ok I'll try to explain it better. I write one file that uploads to pastebin multiple files. Then it saves the pastebin code for each file that's uploaded into another file. I know how to write info into a file now but the problem is the http api. I looked into the pastebin code but for some reason when I try to grab the info that reads back the pastebin info it returns nil.
here's the test program I tried to use to test it out.
shell.run("pastebin", "put", "filename")
-- I can't remember exactly what it was now but I think it was sFile that I was trying to call to get the pastebin code back.
print()
print(sFile)
print("If there's a code above it's working.")
But I'm thinking because the pastebin program has local infront of what I'm trying to grab from it. It's not grabbing it to return.
7083 posts
Location
Tasmania (AU)
Posted 21 August 2014 - 04:11 AM
Indeed, if the pastebin script has its variables correctly localised (and I'd be surprised if it doesn't), you won't be able to access them once it's finished running.
You could make a copy of the pastebin script and inject your own code into that.