PDA

View Full Version : script prewritten please



buldog198
12-15-2009, 09:21 PM
Hi, i know nothing about writing script. so i was wondering if anybody would be willing to write me a script for a back ground sequence. that would run from 4 PM to 10 PM, all channels on at 100% and i have 12 channels. if you are willing and need more info let me know.


i would really appreciate it.

trains58554
12-15-2009, 11:59 PM
Here is a script that should do what you want.



void Start() {
Off (All);
DateTime now = DateTime.Now; //get the current time

//The DateTime constructor goes (YYYY, MM, DD, HH, MM, SS)
DateTime start = new DateTime(now.Year, now.Month, now.Day, 16, 00, 00);
DateTime end = new DateTime(now.Year, now.Month, now.Day, 22, 00, 00);

//We only want the channels to turn on while the current time is
//between 4:00 and 10 pm
while (now.CompareTo(start) >= 0 && now.CompareTo(end) <= 0)
{
On (All);
now = DateTime.Now; //update the current time

}
}


I hope this helps as I just learned to make background scripts so there may be a better way but I tested it this way and it worked for me.

I forgot to add this link http://www.doityourselfchristmas.com/forums/showthread.php?p=47828#post47828 This thread has the best documentation that I have found.

Jay

buldog198
12-16-2009, 09:25 AM
thank you so very much