smarty Super User
Joined: May 21 2006 Location: United States
Online Status: Offline Posts: 728
|
Posted: October 02 2006 at 21:56 | IP Logged
|
|
|
OK..this should be an easy one, but I am stumped. I am trying to update a Global Variable {COUNTER} that I am using as a loop counter. In the macro below, I have Xlobby send a radio station to Powerhome to be announced via Winamp (using a variation of TonyNo's announce macro). If the station is "not there", the macro below closes a Winamp window that opens, and then retries the station up to 4 times (if the counter works). What am I doing wrong with the counter. It does not appear to count. Ideas? Am I not adding to it properly? I am not checking it properly? I do have it defined as a Global Variable.
Edit: Nevermind. My Goto label text was NOT in Quotes as it should have been.
insert into macroheader values ('WINAMP NOWPLAYING','WA SONG TITLE',0,0,1);
insert into macrodetail values ('WINAMP NOWPLAYING',1,10,'COUNTER',NULL,'int(0)',0,'');
insert into macrodetail values ('WINAMP NOWPLAYING',2,26,'',NULL,'start',0,'');
insert into macrodetail values ('WINAMP NOWPLAYING',3,38,'',NULL,'ph_winampctrl("pause",0,"")',0,'') ;
insert into macrodetail values ('WINAMP NOWPLAYING',4,31,'',NULL,'2',0,'');
insert into macrodetail values ('WINAMP NOWPLAYING',5,10,'NOWPLAYING',NULL,'ph_replaceall(ph_replace all(ph_replaceall(ph_replaceall(ph_replaceall(ph_winampinfo( "title",0),"''",""),"- Winamp [Paused] ",""),"mms://uni1.cox.streamaudio.com/",""),"mms://2.uni1.co x.streamaudio.com/",""),":","")',0,'');
insert into macrodetail values ('WINAMP NOWPLAYING',6,16,'',NULL,'if(ph_findwindow("Open file(s)", 1)=0, 12, 1)',0,'');
insert into macrodetail values ('WINAMP NOWPLAYING',7,38,'',NULL,'ph_addtoglobal("COUNTER",1)',0,'') ;
insert into macrodetail values ('WINAMP NOWPLAYING',8,38,'',NULL,'ph_switchto("Open file(s)", 1)',0,'');
insert into macrodetail values ('WINAMP NOWPLAYING',9,31,'',NULL,'.1',0,'');
insert into macrodetail values ('WINAMP NOWPLAYING',10,38,'',NULL,'ph_sendkeys("{esc}")',0,'');
insert into macrodetail values ('WINAMP NOWPLAYING',11,37,'',NULL,'3 attemts and no luck. Station is Unresponsive',0,'');
insert into macrodetail values ('WINAMP NOWPLAYING',12,16,'',NULL,'if({COUNTER}>3, 4, 1)',0,'');
insert into macrodetail values ('WINAMP NOWPLAYING',13,38,'',NULL,'ph_tts("close") + ph_tts("{COUNTER}")',0,'');
insert into macrodetail values ('WINAMP NOWPLAYING',14,38,'',NULL,'ph_ssrequest("192.168.0.101", 8500, "smarty", "12345", "FORMULA", "ph_run(''c:\program files\xlobby\xsend.exe ~~"plugin:command:XEvent:Add Immediat Event:&radio:retry station&~~" 8000 192.168.0.101'')")',0,'');
insert into macrodetail values ('WINAMP NOWPLAYING',15,27,'',NULL,'start',0,'');
insert into macrodetail values ('WINAMP NOWPLAYING',16,38,'',NULL,'ph_ssrequest("192.168.0.101", 8500, "smarty", "12345", "FORMULA", "ph_run(''c:\program files\xlobby\xsend.exe ~~"command:xlobby:button set text:playing:Station Unavailable~~" 8000 192.168.0.101'')")',0,'');
insert into macrodetail values ('WINAMP NOWPLAYING',17,16,'',NULL,'if(1=1, 999, 999)',0,'');
insert into macrodetail values ('WINAMP NOWPLAYING',18,38,'',NULL,'ph_macroparm( "ANNOUNCE", "{NOWPLAYING}", 7, 1, 2, 1,)',0,'');
insert into macrodetail values ('WINAMP NOWPLAYING',19,38,'',NULL,'ph_ssrequest("192.168.0.101", 8500, "smarty", "12345", "FORMULA", "ph_run(''c:\program files\xlobby\xsend.exe ~~"command:xlobby:button set text:playing:{NOWPLAYING}~~" 8000 192.168.0.101'')")',0,'');
insert into macrodetail values ('WINAMP NOWPLAYING',20,38,'',NULL,'ph_ssrequest("192.168.0.100", 8500, "smarty", "12345", "FORMULA", "ph_run(''c:\program files\xlobby\xsend.exe ~~"command:xlobby:button set text:playing:{NOWPLAYING}~~" 8000 192.168.0.100'')")',0,'');
Edited by smarty - October 03 2006 at 08:49
__________________ Elk - Insteon - BlueIris - DMC1 - PowerHome - XLobby - HA_Bridge w/Dots - Brultech
|