It is currently April 24th, 2024, 7:20 pm

simple IfCondition by Time to Variable

Get help with creating, editing & fixing problems with skins
User avatar
AnimaliX
Posts: 33
Joined: August 22nd, 2016, 9:22 pm

simple IfCondition by Time to Variable

Post by AnimaliX »

hello,
I can't find what I'm missing in this part of the script... the variable is never set by conditions and is always "100"

Code: Select all

[Variables]
FC=100

[MeasureTime]
Measure=Time
Format=%H%M

[MeasureCalc]
Measure=Calc
Formula=MeasureTime
IfCondition=(MeasureTime > 0700) && (MeasureTime < 1800)
IfTrueAction=[!SetVariable FC "0"][!UpdateMeter *][!Redraw]
User avatar
balala
Rainmeter Sage
Posts: 16167
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: simple IfCondition by Time to Variable

Post by balala »

AnimaliX wrote: February 21st, 2023, 9:30 am I can't find what I'm missing in this part of the script... the variable is never set by conditions and is always "100"
No, it's not. It is set correctly to 0 when the time meats the condition. However what could be a problem is that in order to get the new value of the variable, you have to use a DynamicVariables=1 option on any measure or meter on which you want to use the FC variable. Without this option added, you get it always 100 for the variable. So make sure you have added this option to the proper section.
User avatar
AnimaliX
Posts: 33
Joined: August 22nd, 2016, 9:22 pm

Re: simple IfCondition by Time to Variable

Post by AnimaliX »

balala wrote: February 21st, 2023, 10:15 am So make sure you have added this option to the proper section.
yes exactly, put it into right section (alongside with meter in this case) as always trivial mistake :)
thx
User avatar
balala
Rainmeter Sage
Posts: 16167
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: simple IfCondition by Time to Variable

Post by balala »

AnimaliX wrote: February 21st, 2023, 10:23 am yes exactly, put it into right section (alongside with meter in this case) as always trivial mistake :)
thx
Often forgotten detail. Don't worry, I'm glad you got it working as expected.
:thumbup: