I have a simple script I am using to change the display of my Russound Keypads to cycle thru the artist and the title of the song that is being played. What I was wanting to do is have it display each for 10 seconds, which does seem to happen when the script initially starts. But eventually it gets out of sync and starts going haywire. Am I doing something wrong here?
Code:
Sub Main(ByVal parm As Object) DiM Title as string Dim Artist as string Dim Is_Music_Playing as integer = hs.devicevalue(614) If Is_Music_Playing = 1 then Do Title = (hs.DeviceString(624)) hs.PluginFunction("BLRussound", "", "SendMessageZone", {1,2,Title,"Left",0}) hs.PluginFunction("BLRussound", "", "SendMessageZone", {1,3,Title,"Left",0}) hs.PluginFunction("BLRussound", "", "SendMessageZone", {1,4,Title,"Left",0}) hs.waitsecs(10) Artist = (hs.deviceString(622)) hs.PluginFunction("BLRussound", "", "SendMessageZone", {1,2,Artist,"Left",0}) hs.PluginFunction("BLRussound", "", "SendMessageZone", {1,3,Artist,"Left",0}) hs.PluginFunction("BLRussound", "", "SendMessageZone", {1,4,Artist,"Left",0}) hs.waitsecs(10) 'hs.writelog("Russound Script", "In Loop") Is_Music_Playing = hs.devicevalue(614) Loop Until Is_Music_Playing = 2 'hs.writelog("Russound Script", "Loop Ending") hs.runScript("Russound_Time.vb",False,False) Else 'Do Nothing 'hs.writelog("Russound Script", "Music isn't on, exiting script.") End If End Sub
Comment