script prewritten p...
 
Notifications
Clear all

script prewritten please

3 Posts
2 Users
0 Reactions
2,387 Views
Posts: 21
Topic starter
(@buldog198)
Eminent Member
Joined: 17 years ago
[#9629]

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.


2 Replies
Posts: 25
(@trains58554)
Eminent Member
Joined: 19 years ago

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


Reply
Posts: 21
Topic starter
(@buldog198)
Eminent Member
Joined: 17 years ago

thank you so very much


Reply
Share: