Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local function get(paste)
- local response = http.get("https://pastebin.com/raw/"..textutils.urlEncode( paste ))
- if response then
- local sResponse = response.readAll()
- response.close()
- return sResponse
- else
- print( "Failed." )
- end
- end
- local tArgs = { ... }
- local sCode = tArgs[2]
- local sFile = tArgs[3]
- local res = get(sCode)
- if res then
- local file = fs.open( shell.resolve( sFile ), "w" )
- file.write( res )
- file.close()
- print( "Downloaded as "..sFile )
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement