updated
This commit is contained in:
@@ -33,6 +33,12 @@ local function playInternalAlarm(speakers)
|
|||||||
playSound(speakers,"internal_alarm")
|
playSound(speakers,"internal_alarm")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local function prepareFile(name)
|
||||||
|
local file = fs.open(name,"w")
|
||||||
|
file.write("")
|
||||||
|
file.close()
|
||||||
|
end
|
||||||
|
|
||||||
local function createSoundFile(fileName)
|
local function createSoundFile(fileName)
|
||||||
|
|
||||||
local baseRoute = "https://git.astrocore.space/root/NovaCorpLLC/raw/branch/main/"
|
local baseRoute = "https://git.astrocore.space/root/NovaCorpLLC/raw/branch/main/"
|
||||||
@@ -43,13 +49,18 @@ local function createSoundFile(fileName)
|
|||||||
|
|
||||||
local response = http.get(fullPath)
|
local response = http.get(fullPath)
|
||||||
local fileData = response.readAll()
|
local fileData = response.readAll()
|
||||||
|
|
||||||
|
prepareFile(name)
|
||||||
|
|
||||||
local file = fs.open(name,"w")
|
local file = fs.open(name,"w")
|
||||||
|
file.close()
|
||||||
file.write(fileData)
|
file.write(fileData)
|
||||||
file.close()
|
file.close()
|
||||||
response.close()
|
response.close()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function addSoundFile(fileName)
|
function addSoundFile(fileName)
|
||||||
createSoundFile(fileName)
|
createSoundFile(fileName)
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user