It is currently April 28th, 2024, 8:28 am

If Statements

Get help with creating, editing & fixing problems with skins
User avatar
UnforgivenRevival
Posts: 310
Joined: June 7th, 2012, 2:25 am
Location: Philadelphia, PA

Re: If Statements

Post by UnforgivenRevival »

If you look on this page, (http://rainmeter.net/cms/Measures-IfActions), It shows you cannot have more than 1 of each "if statements" per measure. You can only have 3 "variable equations" per measure that will work. (Below x, Equal to x, And above x) Rainmeter does not yet support more than 3 at this time.

IfActions are done by using pairs of Above, Equal, and Below Value and Action statements. You may have one of each kind of IfAction in a single measure.
WezzLee
Posts: 35
Joined: June 11th, 2012, 5:29 pm

Re: If Statements

Post by WezzLee »

Okay well I'll try some stuff, however about the setvariable not setting variable?
User avatar
Brian
Developer
Posts: 2688
Joined: November 24th, 2011, 1:42 am
Location: Utah

Re: If Statements

Post by Brian »

WezzLee wrote:Okay well I'll try some stuff, however about the setvariable not setting variable?
Do you have DynamicVariables=1 in every meter/measure that uses that variable? It is required when setting a variable dynamically.

Here is some more information on !Bangs.

-Brian
WezzLee
Posts: 35
Joined: June 11th, 2012, 5:29 pm

Re: If Statements

Post by WezzLee »

Yes DynamicVariables=1 is in almost every meter and measure in the entire skin. Still doesn't work
User avatar
MerlinTheRed
Rainmeter Sage
Posts: 889
Joined: September 6th, 2011, 6:34 am

Re: If Statements

Post by MerlinTheRed »

WezzLee wrote:I have one that has 1 to 4, what do I do when there is 4?
IfBelowValue=2
IfBelowAction=!execute [!ShowMeter MeterSkypeTab][!HideMeter MeterMumbleTab][!HideMeter MeterVentriloTab][!HideMeter MeterTeamspeakTab][!RainmeterRedraw]
IfEqualValue=2
IfEqualAction=!execute [!ShowMeter MeterMumbleTab][!HideMeter MeterSkypeTab][!HideMeter MeterVentriloTab][!HideMeter MeterTeamspeakTab][!RainmeterRedraw]
IfAboveValue=2
IfAboveAction=!execute [!ShowMeter MeterVentriloTab][!HideMeter MeterMumbleTab][!HideMeter MeterSkypeTab][!HideMeter MeterTeamspeakTab][!RainmeterRedraw]
If???Value=4
If???Action=!execute [!ShowMeter MeterTeamspeakTab][!HideMeter MeterMumbleTab][!HideMeter MeterVentriloTab][!HideMeter MeterSkypeTab][!RainmeterRedraw]
Also the variables aren't changing.

I'm using [!SetVariable Tab2 "2"] is this right?
For more than 4 values you could do it with a Lua script. Perhaps that's not the best way to do it, but you could have a Lua script check the Variable's value every now and then and change the visibility of your meters/groups accordingly. Perhaps you can even add the Lua script to the !execute statements so that it is only run when you actually change tabs.
Have more fun creating skins with Sublime Text 2 and the Rainmeter Package!