Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Define the function to download from Hastebin
- local function downloadFromHastebin(pasteCode)
- -- Define the Hastebin server address
- local hastebinServer = "https://paste.myftb.de/raw/"
- local url = hastebinServer .. pasteCode
- -- Fetch the data from the Hastebin server
- local response = http.get(url)
- -- Check if the request was successful
- if response then
- local content = response.readAll()
- response.close()
- -- Write the content to a file named with the paste code
- local file = fs.open(pasteCode, "w")
- file.write(content)
- file.close()
- print("Downloaded and saved as " .. pasteCode)
- else
- print("Failed to download from Hastebin. Check the paste code and try again.")
- end
- end
- -- Get the paste code from the command line arguments
- local args = {...}
- if #args < 1 then
- print("Usage: pasteDownload <pasteCode>")
- return
- end
- local pasteCode = args[1]
- downloadFromHastebin(pasteCode)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement