I'm working on making a skin for my company where it shows when is our service is online and when it's not depending on the schedule we have. It's basically depends on our schedule. I'm able to create this using IfCondition but it's not going to work when more conditions are introduced. This is what I have as of now.
It's broken! I'd like it to Change the text as following:
8AM to 11:59AM - Online
12PM to 12:59PM - Offline
1PM to 4:59PM - Online
Saturday & Sunday Closed
I'm already struggling after introducing weekends into IfConditions and the status label closed. I need to make follow an entire year schedule that we have including stat holidays. What's the best way to achieve this?
Hi, can you post more context for the whole code? I actually just posted something similar to this question a few minutes ago, except referring to seconds.
jasonvertez wrote: ↑November 16th, 2022, 6:04 pm
Hi, can you post more context for the whole code? I actually just posted something similar to this question a few minutes ago, except referring to seconds.
foreverNoob wrote: ↑November 16th, 2022, 6:13 pm
There's a lot in my .ini. What do you need to see?
Nothing, the posted code is completely enough. There are a few logical mistakes in the IfConditions:
If you want to set the same things (in this case the Text option of the [MeterSupportStatus] meter and the statusColor variable), it's not recommended to use both, IfTrueAction and IfFalseAction options on all IfConditions. Instead work only with IfTrueAction. If the conditions are set correctly only one of them is true at a time and the appropriate IfTrueAction is executed, which sets a well-defined value for the Text option and a well-defined value for the variable. If you have IfTrueAction and IfFalseActions on all IfConditions, there applies always one IfTrueAction and more IfFalseActions. So what value will get the Text option and what one the variable? This is why in such cases using only IfTrueActions is a much better idea.
The parenthesis in the IfCondition2 option are not in pair. Accordingly none of the IfTrueAction2 and IfFalseAction2 options is executed. If you take a look there are more parenthesis closed, than opened: IfCondition2=((Measure24Hr >= 12) && (Measure24Hr < 13)) && (MeasureDayOfWeek < 6)). Remove the not-needed parentheses: IfCondition2=((Measure24Hr >= 12) && (Measure24Hr < 13) && (MeasureDayOfWeek < 6)).
The IfCondition4 is not complete. This is what you have: IfCondition4=((Measure24Hr >= 17) || (Measure24Hr = 0)). But with this option which condition is true before 8? None. So, I assume this condition should be IfCondition4=((Measure24Hr >= 17) || (Measure24Hr < 8)).
In the condition list you didn't say anything about what should happen between 5PM and 8AM, but you did include this into the IfCondition4.
The IfConditions don't include what should happen Saturday and Sunday, but you did post this into the condition list above.
Accordingly the IfConditions should look like this (might look other ways as well, this is just my example):
Thank you for my error rectification. It seems to be working perfectly now. The last condition was the big culprit.
Now, I'm hoping the status can change depending on the Stat Holidays as well and not just for the weekends. I understand it's a bigger task and I'm willing to invest time in this if it can be achieved. Will you able to direct me into right direction? What's the best way to achieve this? I believe using && operators in IfConditions will make it real messy.
foreverNoob wrote: ↑November 16th, 2022, 8:42 pm
Now, I'm hoping the status can change depending on the Stat Holidays as well and not just for the weekends. I understand it's a bigger task and I'm willing to invest time in this if it can be achieved. Will you able to direct me into right direction?
How are you keeping track of those holidays? Do you have their dates in some variables? Or are using another method?
balala wrote: ↑November 16th, 2022, 9:25 pm
How are you keeping track of those holidays? Do you have their dates in some variables? Or are using another method?
Yep, but how do you want to use them? Do you want to get them from the site, or you gonna enter them manually into the skin? Second case is much easier to handle.
balala wrote: ↑November 17th, 2022, 4:05 pm
Yep, but how do you want to use them? Do you want to get them from the site, or you gonna enter them manually into the skin? Second case is much easier to handle.
I'm hoping to change the status to Emergency Only if the date of the month matches. So, this will somehow has to be part of the conditions.
foreverNoob wrote: ↑November 17th, 2022, 4:59 pm
I'm hoping to change the status to Emergency Only if the date of the month matches. So, this will somehow has to be part of the conditions.
Sorry, have no idea what you are talking about. What Emergency Only is?