updated
This commit is contained in:
@@ -49,13 +49,17 @@ local function createSoundFile(fileName)
|
||||
|
||||
local event, url, handle
|
||||
repeat
|
||||
event, url, handle = os.pullEvent("http_success")
|
||||
print("Waiting for response from: " .. url)
|
||||
until url == fullPath
|
||||
event, url, handle = os.pullEvent()
|
||||
if event == "http_failure" and url == fullPath then
|
||||
print("HTTP request failed for: " .. url)
|
||||
return nil
|
||||
end
|
||||
if event == "http_success" then
|
||||
print("Waiting for response from: " .. url)
|
||||
end
|
||||
until event == "http_success" and url == fullPath
|
||||
|
||||
print(handle.readAll())
|
||||
local fileData = handle.readAll()
|
||||
|
||||
local file = fs.open(name,"w")
|
||||
|
||||
file.write(fileData)
|
||||
|
||||
Reference in New Issue
Block a user