Little Scripting He...
 
Notifications
Clear all

Little Scripting Help

6 Posts
3 Users
0 Reactions
1,921 Views
Posts: 30
Topic starter
(@love2cad)
Eminent Member
Joined: 18 years ago
[#9026]

Hey there everyone,

Can someone please give a little guidance on how to use and write a simply script that will turn on my lights @ 5:30 and off @ 11:00? I found this code but not sure how to use it. I played with the time to see if I could get it to fire off but no luck.

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, 17, 30, 00);
	DateTime end = new DateTime(now.Year, now.Month, now.Day, 23, 00, 00);

        //We only want the channels to turn on while the current time is
        //between 5:30 and 11 pm
	while (now.CompareTo(start) >= 0 && now.CompareTo(end) <= 0)
	{
               On (Channels(Tree_1), At(100));
               On (ChannelRange(1,15), At(100));
               On (ChannelRange(18,7), At(100));
               On (ChannelRange(27,8), At(100));

               Random (ChannelRange(15,2), 50, For(50).Second);

	       now = DateTime.Now;  //update the current time
	}
}

Thanks for your time,
Bobby


5 Replies
Posts: 30
Topic starter
(@love2cad)
Eminent Member
Joined: 18 years ago

no one.. not a single suggestion 🙁 total bummer


Reply
dirknerkle
Posts: 10311
(@dirknerkle)
Illustrious Member
Joined: 18 years ago

I think people are so busy trying to get their systems up and running that the programming side of things has taken a back seat... Give it a couple days and let folks get past Thanksgiving which is the general "deadline" most folks put on themselves for going live...


Reply
dirknerkle
Posts: 10311
(@dirknerkle)
Illustrious Member
Joined: 18 years ago

Forgot to mention...

You can set up a "program" in Vixen and set it to turn on at a specified time, and then have it repeat until the "off" time.

You can also set up your computer using the Windows Scheduler to automatically start Vixen at a specific time of the day, too.

Lastly, your computer's CMOS settings probably have a selection to automatically power on the computer at a specific time, too.

So there are other ways around the issue that you can explore...


Reply
Posts: 375
(@gocats7)
Honorable Member
Joined: 18 years ago

Why not use Vixen to do so? It has a built in timer and if it doesnt quite meet your criteria, you can always manually modify the timers file to get more specific.


Reply
Posts: 30
Topic starter
(@love2cad)
Eminent Member
Joined: 18 years ago

Thanks guys... I was able to get around the issue. Was just hoping to pointed toward a clear explanation of how to use the scripting part of Vixen. Thanks again and good luck with your display's!!!


Reply
Share: