Posted 03 October 2012 - 09:49 AM
Im trying to write a program on a floppy disk that will automatically download programs from pastebin how would i do so or is it even possible
Pastebin(pastebinID,"fileName")
Pastebin(EwL1C0qw,"disk/startup")
Pastebin(EwL1C0qw,"startup")
local tCodes = {"code1", "code2", "code3"} --replace with actual codes
local tFiles = {"file1","file2","file3"} --and replace these will the names you want the files to have
for x=1, #tFiles do
Pastebin(tCodes[x],tFiles[x])
end
What. Pastebin isn't a function.
shell.run("pastebin", "code", "location")
function Pastebin( sCode, sPath )
local response = http.get("http://pastebin.com/raw.php?i="..textutils.urlEncode( sCode ))
if response then
local sResponse = response.readAll()
response.close()
local file = fs.open( sPath, "w" )
file.write( sResponse )
file.close()
end
end