updated
This commit is contained in:
@@ -37,19 +37,19 @@ end
|
||||
local function createSoundFile(fileName)
|
||||
--local placeholder = "https://git.astrocore.space/root/NovaCorpLLC/raw/branch/main/placeholder.dfpwm"
|
||||
local baseRoute = "https://git.astrocore.space/root/NovaCorpLLC/raw/branch/main/"
|
||||
|
||||
local name = getFileName(fileName)
|
||||
local fullPath = baseRoute .. name
|
||||
|
||||
shell.execute("rm", name)
|
||||
--shell.execute("wget", fullPath, name)
|
||||
local response = http.request(fullPath)
|
||||
|
||||
--print("Added placeholder sound file: " .. name)
|
||||
local event, url, handle
|
||||
repeat
|
||||
event, url, handle = os.pullEvent("http_success")
|
||||
print("Waiting for response from: " .. url)
|
||||
until url == fullPath
|
||||
|
||||
local response = http.get(fullPath)
|
||||
print("Downloading sound file: " .. name)
|
||||
sleep(20)
|
||||
print(response.readAll())
|
||||
print(handle.readAll())
|
||||
local fileData = response.readAll()
|
||||
|
||||
local file = fs.open(name,"w")
|
||||
@@ -57,7 +57,7 @@ local function createSoundFile(fileName)
|
||||
file.write(fileData)
|
||||
|
||||
file.close()
|
||||
response.close()
|
||||
handle.close()
|
||||
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user