It is currently April 26th, 2024, 9:45 am

Help with pausing and variables

Get help with creating, editing & fixing problems with skins
Logan206
Posts: 1
Joined: June 28th, 2019, 2:47 am

Help with pausing and variables

Post by Logan206 »

When this code is run, 5 clocks are displayed so that they update every 5 seconds with the current time in %X format. However, I'm trying to make it so only one clock updates per second instead of all of them. Even though there seems to be one ifcondition updating one variable, everything updates at the same time. If anyone knows whats going on it would be a lot of help. Thank you.

Code: Select all

[Rainmeter]
Update = 1000

[Variables]
pauseVariable0 = 1
pauseVariable1 = 1
pauseVariable2 = 1
pauseVariable3 = 1
pauseVariable4 = 1

[MeasureCount]
Measure = Calc
Formula = MeasureCount + 1
IfAboveValue = 5
IfAboveAction = [!SetOption MeasureMove Formula 0][!Refresh]
DynamicVariables = 1

;==========================================

[Measure0]
Measure = Time
Format = %X
IfCondition MeasureCount = 0
IfTrueAction [!SetVariable pauseVariable0 0]
IfFalseAction [!SetVariable pauseVariable0 1]
paused = #pauseVariable0#

[Measure1]
Measure = Time
Format = %X
paused = #pauseVariable1#

[Measure2]
Measure = Time
Format = %X
paused = #pauseVariable2#

[Measure3]
Measure = Time
Format = %X
paused = #pauseVariable3#

[Measure4]
Measure = Time
Format = %X
paused = #pauseVariable4#

;================================

[ClockText0]
Meter = String
MeasureName = Measure0
FontColor = 255, 255, 255
Text = "Time0: %1"
SolidColor = 50, 50, 50
X = 0
Y = 0R


[ClockText1]
Meter = String
MeasureName = Measure1
FontColor = 255, 255, 255
Text = "Time1: %1"
SolidColor = 50, 50, 50
X = 0
Y = 0R

[ClockText2]
Meter = String
MeasureName = Measure2
FontColor = 255, 255, 255
Text = "Time2: %1"
SolidColor = 50, 50, 50
X = 0
Y = 0R

[ClockText3]
Meter = String
MeasureName = Measure3
FontColor = 255, 255, 255
Text = "Time3: %1"
SolidColor = 50, 50, 50
X = 0
Y = 0R

[ClockText4]
Meter = String
MeasureName = Measure4
FontColor = 255, 255, 255
Text = "Time4: %1"
SolidColor = 50, 50, 50
X = 0
Y = 0R
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5406
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: Help with pausing and variables

Post by eclectic-tech »

You have several errors in your IfCondition code (missing equal signs) and that conditional test should be moved to a measure that is not paused.

Change these 2 sections and it will work as expected; I moved the conditional test to [MeasureCount], added an update to the affected measure, and added DynamicVariables=1 to [Measure0]. The IfFalse portion is useless since the skin is refreshed 1 second later. There is no code for a [MeasureMove]...

Code: Select all

...

[MeasureCount]
Measure=Calc
Formula=MeasureCount+1
IfCondition=(MeasureCount<=5)
IfTrueAction=[!SetVariable "pauseVariable0" "0"][!UpdateMeasure Measure0]
IfFalseAction=[!SetVariable "pauseVariable0" "1"][!UpdateMeasure Measure0]
IfAboveValue=5
IfAboveAction=[!SetOption MeasureMove Formula 0][!Refresh]
DynamicVariables=1

;==========================================

[Measure0]
Measure=Time
Format=%X
paused=#pauseVariable0#
DynamicVariables=1

...