It is currently April 25th, 2024, 11:31 am

Check if a measure changed

Tips and Tricks from the Rainmeter Community
User avatar
smurfier
Moderator
Posts: 1931
Joined: January 29th, 2010, 1:43 am
Location: Willmar, MN

Check if a measure changed

Post by smurfier »

There are certain situations where you only want to take an action if the value of your measure changes. To accomplish this we need to use a variable and a separate measure to do our bidding.

Note: This method will only work for numbers as Rainmeter cannot compare text.

Code: Select all

[Variables]
TestVar=0

[SomeMeasure]
Measure=Calc
Formula=1-SomeMeasure

[TestMeasure]
Measure=Calc
Formula=SomeMeasure<>#TestVar#
IfAboveValue=0
IfAboveAction=[!SetVariable TestVar [SomeMeasure]][!SomeAction]
DynamicVariables=1
GitHub | DeviantArt | Tumblr
This is the song that never ends. It just goes on and on my friends. Some people started singing it not knowing what it was, and they'll continue singing it forever just because . . .