PDA

View Full Version : TriggerEvent from LUA Bug?



martys
December 15th, 2012, 04:35 PM
I am experiencing some unexpected behavior when trying to trigger an event from LUA, possibly due to operator error or maybe a bug. The LUA script below (Pause Playing Source) works perfectly if executed by pressing F5, but when it is called as member of macro, the "gir.TriggerEventEx(".....",18,1) doesn't seem to execute. The events "Pause..." are user defined events within several other macros. I know the pause script is executing because the print commands are executing, but when when PauseScript is a step in a macro, the TriggerEvent seems to get skipped. I have tried using TriggerEvent and TriggerEventEX, both have the same results. I have also tried on Girder 5.0.14 and Girder 5.1, again, same results. Why isn't the TriggerEvent executing when called as a member of a macro? I have attached the GML files for reference.


Pause Playing Source:
if (gir) then

if (strSource == "Pandora") then
if (boolCPUPlaying == 1) then
gir.TriggerEventEx("PausePandora", 18,1)
print("Pandora Pause Event Issued")
end

elseif (strSource == "last.fm") then
if (boolCPUPlaying == 1) then
gir.TriggerEventEx("PauseLastFM", 18,1)
print("Last.FM Pause Event Issued")
end

elseif (strSource == "Foobar2000") then
if (boolCPUPlaying == 1) then
gir.TriggerEventEx("PauseFoobar", 18,1)
print("Foobar2000 Pause Event Issued")
end

elseif (strSource == "SiriusXM") then
if (boolCPUPlaying == 1) then
gir.TriggerEventEx("PauseSiriusXM", 18,1)
print("SiriusXM Pause Event Issued")
end

else -- 'Source does not match
print("No matching Source")
end

else
print("Girder ActiveX Issues")
end