ThreeWestCreative Posted May 20, 2011 Share Posted May 20, 2011 *************** nevermind, its working now. I don't really understand why I did move "var mytime : DateTime = now;" after "var start_time_rockzillasat, end_time_rockzillasat : DateTime" but I don't understand why that would matter. Either that or the script doesn't work if I start it after one of the program times. For instance, I just started it about 8-9 minutes ago (right before 5am) and my alternative rock program starts at 5 and the script started working at 5. But I'm worried now because if my system goes down, the script isn't going to work for possibly hours. :( ************************ Hi there, I put together a weekly schedule script I copied from the SAM broadcaster Wiki site. It was working wonderfully but I noticed these past couple of days my lounge and alternative songs were being played amongst the Hard Rock (Yikes!). And I realized tonight, the script was running but had stopped working. I hadn't changed a thing. I looked over the code again and again and it's not adding songs to the queue like it should. Any help on this would be appreciated. I also tested the original script from the wiki site and it won't work either. PAL.Loop := True; var mytime : DateTime = now; var D: Integer; var start_time_rush, end_time_rush : DateTime; var start_time_rockzilla, end_time_rockzilla : DateTime; var start_time_lava, end_time_lava : DateTime; var start_time_boudoir, end_time_boudoir : DateTime; var start_time_rockzillasat, end_time_rockzillasat : DateTime; {************************************************************* Rush - 5am - 5pm - Mon - Fri, Sun **************************************************************} start_time_rush := date + EncodeTime(05,00,00,0); end_time_rush := date + EncodeTime(17,00,00,0); {************************************************************* Rockzilla - 5pm - 5am - Mon - Fri, Sun **************************************************************} start_time_rockzilla := date + EncodeTime(17,00,00,0); end_time_rockzilla := date + EncodeTime(05,00,00,0); {************************************************************* Lava - 5pm - 7pm - Sat **************************************************************} start_time_lava := date + EncodeTime(17,00,00,0); end_time_lava := date + EncodeTime(19,00,00,0); {************************************************************* The Boudoir - 7pm - 10pm - Sat **************************************************************} start_time_boudoir := date + EncodeTime(19,00,00,0); end_time_boudoir := date + EncodeTime(22,00,00,0); {************************************************************* Rockzilla - 10pm - 5am - Sat **************************************************************} start_time_rockzillasat := date + EncodeTime(22,00,00,0); end_time_rockzillasat := date + EncodeTime(05,00,00,0); {************************************************************* Monday **************************************************************} if DayOfWeek(Now) = Monday then begin if( mytime >= start_time_rush) and (mytime begin WriteLn('Welcome to Rush!'); cat['Rush'].QueueBottom(smLemmingLogic,EnforceRules); PAL.WaitForQueue(2) end; if( mytime >= start_time_rockzilla) and (mytime begin WriteLn('Welcome to RockZilla!'); cat['Rockzilla'].QueueBottom(smLemmingLogic,EnforceRules); PAL.WaitForQueue(2) end; end; {************************************************************* Tuesday **************************************************************} if DayOfWeek(Now) = Tuesday then begin if( mytime >= start_time_rush) and (mytime begin WriteLn('Welcome to Rush!'); cat['Rush'].QueueBottom(smLemmingLogic,EnforceRules); PAL.WaitForQueue(2) end; if( mytime >= start_time_rockzilla) and (mytime begin WriteLn('Welcome to RockZilla!'); cat['Rockzilla'].QueueBottom(smLemmingLogic,EnforceRules); PAL.WaitForQueue(2) end; end; {************************************************************* Wednesday **************************************************************} if DayOfWeek(Now) = Wednesday then begin if( mytime >= start_time_rush) and (mytime begin WriteLn('Welcome to Rush!'); cat['Rush'].QueueBottom(smLemmingLogic,EnforceRules); PAL.WaitForQueue(2) end; if( mytime >= start_time_rockzilla) and (mytime begin WriteLn('Welcome to RockZilla!'); cat['Rockzilla'].QueueBottom(smLemmingLogic,EnforceRules); PAL.WaitForQueue(2) end; end; {************************************************************* Thursday **************************************************************} if DayOfWeek(Now) = Thursday then begin if( mytime >= start_time_rush) and (mytime begin WriteLn('Welcome to Rush!'); cat['Rush'].QueueBottom(smLemmingLogic,EnforceRules); PAL.WaitForQueue(2) end; if( mytime >= start_time_rockzilla) and (mytime begin WriteLn('Welcome to RockZilla!'); cat['Rockzilla'].QueueBottom(smLemmingLogic,EnforceRules); PAL.WaitForQueue(2) end; end; {************************************************************* Friday **************************************************************} if DayOfWeek(Now) = Friday then begin if( mytime >= start_time_rush) and (mytime begin WriteLn('Welcome to Rush!'); cat['Rush'].QueueBottom(smLemmingLogic,EnforceRules); PAL.WaitForQueue(2) end; if( mytime >= start_time_rockzilla) and (mytime begin WriteLn('Welcome to RockZilla!'); cat['Rockzilla'].QueueBottom(smLemmingLogic,EnforceRules); PAL.WaitForQueue(2) end; end; {************************************************************* Saturday **************************************************************} if DayOfWeek(Now) = Saturday then begin if( mytime >= start_time_rush) and (mytime begin WriteLn('Welcome to Rush!'); cat['Rush'].QueueBottom(smLemmingLogic,EnforceRules); PAL.WaitForQueue(2) end; if( mytime >= start_time_lava) and (mytime begin WriteLn('Welcome to Lava!'); cat['Lava'].QueueBottom(smLemmingLogic,EnforceRules); PAL.WaitForQueue(2) end; if( mytime >= start_time_boudoir) and (mytime begin WriteLn('Welcome to The Boudoir!'); cat['Rhythmz'].QueueBottom(smLemmingLogic,EnforceRules); PAL.WaitForQueue(2) end; if( mytime >= start_time_rockzillasat) and (mytime begin WriteLn('Welcome to RockZilla!'); cat['Rockzilla'].QueueBottom(smLemmingLogic,EnforceRules); PAL.WaitForQueue(2) end; end; {************************************************************* Sunday **************************************************************} if DayOfWeek(Now) = Sunday then begin if( mytime >= start_time_rush) and (mytime begin WriteLn('Welcome to Rush!'); cat['Rush'].QueueBottom(smLemmingLogic,EnforceRules); PAL.WaitForQueue(2) end; if( mytime >= start_time_rockzilla) and (mytime begin WriteLn('Welcome to RockZilla!'); cat['Rockzilla'].QueueBottom(smLemmingLogic,EnforceRules); PAL.WaitForQueue(2) end; end; Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.