I'm expecting "6" to be displayed but instead I'm seeing "3" which is telling me I'm using !SetVariable improperly. What would be the correct way to do this?
[Variables]
var=3
[MyMeter]
DynamicVariables=1
Meter=String
MeterStyle=TextStyle
SolidColor=255,255,255,255
BackgroundMode=2
!SetVariable var (#var#+3)
Text=#var#
X=0
Y=0
W=50
H=50
It is currently May 3rd, 2024, 10:24 pm
SetVariable not updating the way I think it's supposed to
-
- Posts: 2
- Joined: January 17th, 2013, 4:24 pm
-
- Posts: 291
- Joined: July 25th, 2011, 9:53 am
- Location: Lublin, Poland
Re: SetVariable not updating the way I think it's supposed t
Yo have to assign !SetVariable to some action (ex. mouse hover)
"Never argue with an idiot, he will drag you down to his level and beat you with experience."
my deviantART | Alternative Rainmeter tray icons
my deviantART | Alternative Rainmeter tray icons
-
- Posts: 2
- Joined: January 17th, 2013, 4:24 pm
Re: SetVariable not updating the way I think it's supposed t
Is there a way to achieve what I'm trying to do that updates the variable on it's own using some other method?
-
- Rainmeter Sage
- Posts: 5407
- Joined: April 12th, 2012, 9:40 pm
- Location: Cedar Point, Ohio, USA
Re: SetVariable not updating the way I think it's supposed t
In your example, it appears you want to add 3 to the #var# value...
You should use a Calc Measure to do this...
I included 2 formulas:
The first one adds 3 to the value of #var# and displays it ("6")...
The second one adds the value of #var# on each update ("3, 6, 9,...") until refreshed.
The FinishAction= sets the variable to the new calculated value.
Un-comment (remove ";") the second formula and comment out (add ";") the first formula to see the difference.
Since X & Y default to zero, you do not need those settings.
By adding the MeasureName=, the meter will display that value without the need for Text= unless
you want to add to the value: Text=The current count is %1
You should use a Calc Measure to do this...
I included 2 formulas:
The first one adds 3 to the value of #var# and displays it ("6")...
The second one adds the value of #var# on each update ("3, 6, 9,...") until refreshed.
The FinishAction= sets the variable to the new calculated value.
Un-comment (remove ";") the second formula and comment out (add ";") the first formula to see the difference.
Since X & Y default to zero, you do not need those settings.
By adding the MeasureName=, the meter will display that value without the need for Text= unless
you want to add to the value: Text=The current count is %1
Code: Select all
[Rainmeter]
Update=1000
[Variables]
var=3
[mAddThree]
Measure=Calc
Formula=(#var#+3)
;Formula=(mAddThree+#var#)
FinishAction=[!SetVariable var [mAddThree]]
DynamicVariables=1
[MyMeter]
DynamicVariables=1
Meter=String
MeterStyle=TextStyle
MeasureName=mAddThree
SolidColor=255,255,255,255
BackgroundMode=2
;Text=#var#
;X=0
;Y=0
W=50
H=50
:: My DA Gallery :: Rainmeter DA Gallery :: Rainmeter Workshops :: Rainmeter Documentation :: BBCode Guide ::