This commit is contained in:
2025-06-15 20:28:38 -04:00
parent 4a7a0153c4
commit 10ffbbfb4b

View File

@@ -37,19 +37,19 @@ end
local function createSoundFile(fileName) local function createSoundFile(fileName)
--local placeholder = "https://git.astrocore.space/root/NovaCorpLLC/raw/branch/main/placeholder.dfpwm" --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 baseRoute = "https://git.astrocore.space/root/NovaCorpLLC/raw/branch/main/"
local name = getFileName(fileName) local name = getFileName(fileName)
local fullPath = baseRoute .. name local fullPath = baseRoute .. name
shell.execute("rm", 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(handle.readAll())
print("Downloading sound file: " .. name)
sleep(20)
print(response.readAll())
local fileData = response.readAll() local fileData = response.readAll()
local file = fs.open(name,"w") local file = fs.open(name,"w")
@@ -57,7 +57,7 @@ local function createSoundFile(fileName)
file.write(fileData) file.write(fileData)
file.close() file.close()
response.close() handle.close()
end end