http://pastebin.com/sdmtFLrF
Edited by goldensecret, 17 March 2014 - 02:55 PM.
Posted 17 March 2014 - 02:53 PM
Edited by goldensecret, 17 March 2014 - 02:55 PM.
Posted 17 March 2014 - 03:00 PM
parallel.waitForAll( function() shell.run"pastebin get whatever derpderp" end, term.clear )However, that's quite a retarded and stupid way of doing it
Edited by CometWolf, 17 March 2014 - 03:00 PM.
Posted 17 March 2014 - 03:11 PM
--[[
@description "Downloads a file from pastebin"
@param name, string
@param code, string
@return nil
--]]
function pastebin_get( name, code )
local response = http.get("http://pastebin.com/raw.php?i="..textutils.urlEncode(code))
if response then
local file = fs.open(name,"w")
local sCode = response.readAll()
response.close()
file.write(sCode)
file.close()
else
error("Error getting the file " .. name, 0)
end
end
And use it like thisprint( "I'm downloading a file now! :D/>/>") pastebin_get( "<Input filename>", "<Input pastebin code>" ) print( "Yay! Downloaded <Your file>! :D/>/>" )
Edited by Hellkid98, 17 March 2014 - 03:12 PM.
Posted 17 March 2014 - 05:01 PM
Posted 17 March 2014 - 06:32 PM
CometWolf, on 17 March 2014 - 05:01 PM, said:
Posted 18 March 2014 - 01:53 PM
Hellkid98, on 17 March 2014 - 03:11 PM, said:
--[[
@description "Downloads a file from pastebin"
@param name, string
@param code, string
@return nil
--]]
function pastebin_get( name, code )
local response = http.get("http://pastebin.com/raw.php?i="..textutils.urlEncode(code))
if response then
local file = fs.open(name,"w")
local sCode = response.readAll()
response.close()
file.write(sCode)
file.close()
else
error("Error getting the file " .. name, 0)
end
end
And use it like thisprint( "I'm downloading a file now! :D/>/>/>") pastebin_get( "<Input filename>", "<Input pastebin code>" ) print( "Yay! Downloaded <Your file>! :D/>/>/>" )
Posted 18 March 2014 - 02:32 PM
local content = http.get("http://pastebin.com/raw.php?i=PaStEiD").readAll()
Edited by Anavrins, 24 March 2014 - 07:55 PM.
Posted 18 March 2014 - 04:40 PM
goldensecret, on 18 March 2014 - 01:53 PM, said:
--[[
Let's say you've put the code in a file called
potatoes, Then you would have to use it like
this
--]]
os.loadAPI( "potatoes" ) -- Loading the API
potatoes.pastebin_get( "<Filename>", "<Code>" )
I mentioned above that it was a function, If you're unsure what that is I suggest you go and check out this site http://www.lua.org/p...ontents.html#P1 and learn what you need to learnPosted 24 March 2014 - 06:05 PM
0 members, 2 guests, 0 anonymous users