It is currently April 25th, 2024, 4:35 am

Some tricks with !SetVariable bang

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

Re: Some tricks with !SetVariable bang

Post by smurfier »

Quite some time ago someone asked how to cycle a value going in the negative direction instead of the positive. Here is a good way to accomplish that:

Cycle Variable A between B-1 and 0
!SetVariable A ((#A#-1+#B#)%#B#)

If I were to use 10, then this formula would cycle between 9 and 0.
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 . . .