They work fine if I just use one or the other but how can I combine the code together. End result is if the scene is triggered play the wave file but only trigger the scene a maximum of once a hour. Thanks
local result = true
local now = os.time()
if (LastTime) then
result = now - LastTime >3600
end
if (result) then
LastTime = now
os.execute('curl -g "http://192.168.100.49:8080/requests/status.xml?command=in_play&input=file:///c:/audio/nofreeze.wav"')
end
return result
I also fixed a bug in your logic … you should have only set LastTime if result was true!
The way you had it, if you triggered every 30 minutes it would never fire.