Scripted/Background...
 
Notifications
Clear all

Scripted/Background Sequence Not Starting

12 Posts
6 Users
0 Reactions
4,590 Views
cbell
Posts: 462
(@cbell)
Honorable Member
Joined: 18 years ago
ElectricCraft1 wrote:One question is if there are multiple start / end definitions, ie: start0, start1, etc.; how do these get defined prior to the loop. I too have had problems with the not starting and this seems to be my answer.

I think this is what you are looking for


DateTime now = DateTime.Now; //get the current time
DateTime start1 = new DateTime(now.Year, now.Month, now.Day, 17, 30, 00);
DateTime end1 = new DateTime(now.Year, now.Month, now.Day, 22, 00, 00);
DateTime start2 = new DateTime(now.Year, now.Month, now.Day, 22, 30, 00);
DateTime end2 = new DateTime(now.Year, now.Month, now.Day, 23, 30, 00);

	while ((now.CompareTo(start1) >= 0 && now.CompareTo(end1) <= 0) || (now.CompareTo(start2) >= 0 && now.CompareTo(end2) <= 0))
	{

           // Inner Loop

         }
}

Reply
Posts: 34
(@electriccraft1)
Eminent Member
Joined: 18 years ago

Thanks for the help. See tonight if it works.


Reply
Page 3 / 3
Share: