It is currently April 26th, 2024, 11:52 am

String meter won't update

Get help with creating, editing & fixing problems with skins
User avatar
death.crafter
Rainmeter Sage
Posts: 1399
Joined: April 24th, 2021, 8:13 pm

Re: String meter won't update

Post by death.crafter »

sl23 wrote: October 19th, 2021, 8:43 am :rofl: I have no idea! :oops:

I imagine the order matters, but logic doesn't help me decide which is better.

If you are referring to the extra #'s then that doesn't seem to matter as the !WriteKey bangs work fine.

When I tried to use ##CURRENTSECTION# in the !SetVariable, it didn't work. It showed the command in the text meter instead of the text. Hence I removed two #'s and explains why it is different. I really haven't a clue how or why it works, it's a happy accident. But it isn't working in the second skin.

My problem probably lies in my lack of understanding what a nested variable is and how it works. I couldn't really get any further understanding about it from the manual. Are you using a variable within a variable? I just can't get my head around how that works! But either way, I also don't understand how one skin can work but the other doesn't, even though it uses the same code! :?
Well, just use #CURRENTSECTION#? I don't see why you're using [##CURRENTSECTION#] while writing ActionText. That would resolve to the variable's value, even though the syntax is incorrect.

You need to write Act as [#[#CURRENTSECTION]] and ActionText as #CURRENTSECTION#. Same goes for SetVariable.
Last edited by death.crafter on October 19th, 2021, 9:48 am, edited 1 time in total.
from the Realm of Death
User avatar
sl23
Posts: 1140
Joined: February 17th, 2011, 7:45 pm
Location: a Galaxy S7 far far away

Re: String meter won't update

Post by sl23 »

Damn! Yeah forgot to change that! I'll have to go through everything and change it! Thanks, I'll give that a try. :thumbup:
- MuLab -
User avatar
death.crafter
Rainmeter Sage
Posts: 1399
Joined: April 24th, 2021, 8:13 pm

Re: String meter won't update

Post by death.crafter »

sl23 wrote: October 19th, 2021, 9:48 am Damn! Yeah forgot to change that! I'll have to go through everything and change it! Thanks, I'll give that a try. :thumbup:
... I just read up a bit and changed my response. Well, doesn't change the fact that syntax is incorrect.
from the Realm of Death
User avatar
sl23
Posts: 1140
Joined: February 17th, 2011, 7:45 pm
Location: a Galaxy S7 far far away

Re: String meter won't update

Post by sl23 »

Thanks dc, but that sort of fixed that which was already working and broke something else that was also working. While the same adjustment in the Variant skin did nothing. Any idea why that is?
- MuLab -
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5406
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: String meter won't update

Post by eclectic-tech »

sl23 wrote: October 19th, 2021, 8:43 am :rofl: I have no idea! :oops:

I imagine the order matters, but logic doesn't help me decide which is better.

If you are referring to the extra #'s then that doesn't seem to matter as the !WriteKey bangs work fine.

When I tried to use ##CURRENTSECTION# in the !SetVariable, it didn't work. It showed the command in the text meter instead of the text. Hence I removed two #'s and explains why it is different. I really haven't a clue how or why it works, it's a happy accident. But it isn't working in the second skin.

My problem probably lies in my lack of understanding what a nested variable is and how it works. I couldn't really get any further understanding about it from the manual. Are you using a variable within a variable? I just can't get my head around how that works! But either way, I also don't understand how one skin can work but the other doesn't, even though it uses the same code! :?
Death.Crafter's suggestion to use [#[#CURRENTSECTION]] syntax is the proper way to code that.

!WriteKeyValue and !SetVariable
When you use !WriteKeyValue you are saving the value but not updating it in the skin until you refresh. To save it AND update it in the running skin you need to use !SetVariable at the same time you write it.
Example:
LeftMouseUpAction=[!SetOptionGroup Button FillAlpha "Fill Color #Color5#"][!SetOption #CURRENTSECTION# FillAlpha "Fill Color #Color2#"][!WriteKeyValue Variables Act "[#[#CURRENTSECTION#]]"] [!WriteKeyValue Variables ActionText [#CURRENTSECTION]] [!SetVariable Act "[#[#CURRENTSECTION#]]"] [!SetVariable ActionText [#CURRENTSECTION]][!UpdateMeter *][!Redraw]
The 'red' bangs save the values then the 'green' bangs set them in the skin.

!SetOption
The reason your [Action] meter is not updating is because you are using !SetOption in the [BGTimer] section and setting the Text for that meter to the VALUE of the variable, rather than to the actual variable name.

Note: When using !SetOption to set something to a dynamic (changing) variable, you need to escape the variable in the bang.

You use this bang:
LeftMouseUpAction=[!SetOption #CURRENTSECTION# StrokeAlpha2 "Stroke Color #Color5#"] [!HideMeterGroup Controls][!SetOption Action Text "#ActionText#"] [PlayStop "#Alarm#"] [!Update][!UpdateMeter *][!Redraw]

That sets Text=Off or to the current value of #ActionText#, but you want it to be the actual variable (not what the current value is set as).

To do that, escape the variable in the !SetOption bang like this:
LeftMouseUpAction=[!SetOption #CURRENTSECTION# StrokeAlpha2 "Stroke Color #Color5#"] [!HideMeterGroup Controls][!SetOption Action Text "[#*ActionText*]"] [PlayStop "#Alarm#"] [!Update][!UpdateMeter *][!Redraw]

This will set Text=[#ActionText] which is what you want.

Now it will update when you change the value of #ActionText#.

I would recommend escaping all of your !SetOption bangs that set keywords to variable values that may change dynamically in the skin. !SetOption Guide

EDIT: Timer/Clock.ini

Code: Select all

[Rainmeter]
Update=1000
AccurateText=1
DynamicWindowSize=1
MouseActionCursor=0
OnRefreshAction=[!PauseMeasureGroup TimerGroup][!HideMeterGroup Controls][!HideMeter OK][!SetOption #ActionText# FillAlpha "Fill Color #Color2#"][!UpdateMeter *][!Redraw]

[Metadata]
Name=RoundClock
Author=sl23
Information=Clock including Timer, alarm and hourly chime.||Credits:||Timer code by Yincognito and death.crafter.||Adapted from "SimplyRound" Suite by Krzysztof "gronostaj" Smialek||AlarmClock code adapted from a skin by Youkai1977||Help via forum: balala, eclectic-tech, jsmorley
Version=2021.9.6
License=CC BY 3.0

[Variables]
; The time at which the timer / stopwatch is set or reset, in seconds (>0 for a timer, 0 for a stopwatch)
DefaultHours=2
DefaultMinutes=10
DefaultSeconds=0
; Seconds left to pass (for a timer), or seconds passed (for a stopwatch)
Seconds=([#DefaultSeconds]+[#DefaultMinutes]*60+[#DefaultHours]*3600)
; The amount of seconds by which the timer / stopwatch changes (<0 for a timer, >0 for a stopwatch)
Direction=-1
; Temporarily set to 1 when the timer / stopwatch is reset so the OnChangeAction below doesn't alter the Seconds above
Reset=0

Click=ms-settings:dateandtime
HourColour=255,100,100
MinuteColour=255,170,0
SecondsColour=128,255,0
TimerColor=100,100,200

Color1=255,255,255,200
Color2=128,255,0
Color3=255,255,0
Color4=0,255,255
Color5=255,255,255,60

ChimeSound=Calligraphy.wav
; ChimeSound disabled whilst these apps are running
Process1=VLC.exe
Process2=foobar2000.exe
Process3=MuLab.exe

; These apps will start the Timer when run and pause it when stopped. So that you can time the use of them. Also, when the Timer reaches zero, these apps will close if the Setting "CloseApps" is used.
APP1=Dolphin.exe
APP2=pcsx2.exe
APP3=rpcs3.exe
APP4=retroarch.exe
APP5=cemu.exe
APP6=Project64.exe

Alarm=Alarm.wav
AlarmHourSet=23
AlarmMinuteSet=0

Hibernate=rundll32.exe powrprof.dll,SetSuspendState
Shutdown=shutdown.exe -s -t 5 -f
Lock=rundll32.exe user32.dll, LockWorkStation
CloseApps=!CommandMeasure mClose Run
Off=
Act=[#[Hibernate]]

ActionText=Hibernate
Message1=10 mins until #ActionText#
Message2=#ActionText# Now

========================================
; Background
========================================
[Bg]
Meter=Shape
Shape=Rectangle 0,0,230,70,35 | Fill Color 0,0,0,150 | StrokeWidth 2 | Extend StrokeAlpha
StrokeAlpha=Stroke Color #Color5#
DynamicVariables=1
X=2
Y=2

[BgAlarm]
Meter=Shape
Shape=Rectangle 0,0,60,60,50 | Fill Color 0,0,0,50 | StrokeWidth 2 | Extend StrokeAlpha
Shape2=Rectangle 9,9,42,42,50 | Fill Color 0,0,0,1 | StrokeWidth 2 | Extend StrokeAlpha2
Shape3=Rectangle 5,5,50,50,50 | Fill Color 0,0,0,1 | StrokeWidth 10 | Stroke Color 255,255,255,20
StrokeAlpha=Stroke Color #Color5#
StrokeAlpha2=Stroke Color #Color5#

LeftMouseUpAction=[!EnableMeasure mChimeHour] [!ShowMeter ChimeIcon] [!SetOption #CURRENTSECTION# StrokeAlpha2 "Stroke Color #Color5#"] [!DisableMeasureGroup ALARM] [!HideMeterGroup AlarmSet][!SetOption Action Text "#ActionText#"] [PlayStop "#Alarm#"] [!Update][!UpdateMeter *][!Redraw]

RightMouseUpAction=[!DisableMeasure mChimeHour] [!HideMeter ChimeIcon] [!SetOption #CURRENTSECTION# StrokeAlpha2 "Stroke Color 128,255,0,200"] [!EnableMeasureGroup ALARM] [!ShowMeter HourAlarm] [!ShowMeter MinuteAlarm] [!Update][!UpdateMeter *][!Redraw]

MouseOverAction=[!SetOption #CURRENTSECTION# StrokeAlpha "Stroke Color #Color4#"][!UpdateMeter *][!Redraw]
MouseLeaveAction=[!SetOption #CURRENTSECTION# StrokeAlpha "Stroke Color #Color5#"][!UpdateMeter *][!Redraw]

DynamicVariables=1
ToolTipText="L - Alarm Off#CRLF#R - Alarm On"
X=7
Y=7

[BgLine]
Meter=Shape
Shape=Rectangle 67,42,100,1,0 | Fill Color #Color5# | StrokeWidth 0
DynamicVariables=1

[BgTimer]
Meter=Shape
Shape=Rectangle 0,0,60,60,50 | Fill Color 0,0,0,50 | StrokeWidth 2 | Extend StrokeAlpha
Shape2=Rectangle 9,9,42,42,50 | Fill Color 0,0,0,1 | StrokeWidth 2 | Extend StrokeAlpha2
Shape3=Rectangle 5,5,50,50,50 | Fill Color 0,0,0,1 | StrokeWidth 10 | Stroke Color 255,255,255,20
StrokeAlpha=Stroke Color #Color5#
StrokeAlpha2=Stroke Color #Color5#

LeftMouseUpAction=[!SetOption #CURRENTSECTION# StrokeAlpha2 "Stroke Color #Color5#"]  [!HideMeterGroup Controls][!SetOption Action Text "[#*ActionText*]"] [PlayStop "#Alarm#"] [!Update][!UpdateMeter *][!Redraw]

RightMouseUpAction=[!SetOption #CURRENTSECTION# StrokeAlpha2 "Stroke Color 128,255,0,200"] [!ShowMeterGroup Controls] [!Update][!UpdateMeter *][!Redraw]

MouseOverAction=[!SetOption #CURRENTSECTION# StrokeAlpha "Stroke Color #Color4#"][!UpdateMeter *][!Redraw]
MouseLeaveAction=[!SetOption #CURRENTSECTION# StrokeAlpha "Stroke Color #Color5#"][!UpdateMeter *][!Redraw]

DynamicVariables=1
ToolTipText="L - Timer Off#CRLF#R - Timer On"
X=167
Y=7

========================================
; STYLES
========================================
[sAllText]
FontFace=Trebuchet MS
StringStyle=Bold
StringAlign=Center
FontSize=16
FontColor=#Color1#
StringEffect=Shadow
FontEffectColor=0,0,0,150
AntiAlias=1
InlineSetting=Size | 8
InlinePattern=#CRLF#.+
DynamicVariables=1

[sRoundBar]
LineStart=22
LineLength=29
LineWidth=2
StartAngle=(Rad(270))
Antialias=1
Solid=0

[sHighlight]
MouseOverAction=[!SetOption #CURRENTSECTION# FontColor "#Color2#"] [!UpdateMeter #CURRENTSECTION#] [!Redraw]
MouseLeaveAction=[!SetOption #CURRENTSECTION# FontColor "#Color1#"] [!UpdateMeter #CURRENTSECTION#] [!Redraw]

========================================
; Time
========================================
[mHour]
Measure=Time
Format=%#I
MinValue=0
MaxValue=12

[mMinutes]
Measure=Time
Format=%M
MinValue=0
MaxValue=60

[mSecond]
Measure=Time
Format=%S
MinValue=0
MaxValue=60

[mDate]
Measure=Time
Format=%a  %#d  %b

[HoursBar]
Meter=Roundline
MeasureName=mHour
MeterStyle=sRoundBar
LineColor=#HourColour#
X=37
Y=37

[MinutesBar]
Meter=Roundline
MeasureName=mMinutes
MeterStyle=sRoundBar
LineColor=#MinuteColour#
X=r
Y=r

[SecondsBar]
Meter=Roundline
MeasureName=mSecond
MeterStyle=sRoundBar
LineColor=#SecondsColour#
X=r
Y=r

[Value]
Meter=String
MeasureName=mHour
MeasureName2=mMinutes
MeterStyle=sAllText | sHighlight
Text=%1:%2#CRLF#[mDate]
LeftMouseUpAction=#Click#
X=117
Y=19

========================================
; CHIME
========================================
[mChimeHour]
Measure=Time
Format=%M
IfEqualValue=0
IfEqualAction=[Play #ChimeSound#]

[ChimeIcon]
Meter=String
MeterStyle=sAllText
FontFace=Segoe Fluent Icons
FontSize=14
Text=[\xE8D6]
X=36
Y=27
W=16
H=16

============================================
; Enable/Disable Chime on Process Start/Stop
============================================
[mProcessDisableChime]
Measure=Calc
Formula=1
IfCondition=(mProcess1=1) || (mProcess2=1) || (mProcess3=1)
IfTrueAction=[!DisableMeasure mChimeHour][!SetOption ChimeIcon FontColor ""][!UpdateMeter *][!Redraw]
IfFalseAction=[!EnableMeasure mChimeHour][!SetOption ChimeIcon FontColor "#Color2#,200"][!UpdateMeter *][!Redraw]

[mProcess1]
Measure=Plugin
Plugin=Process
ProcessName=#Process1#

[mProcess2]
Measure=Plugin
Plugin=Process
ProcessName=#Process2#

[mProcess3]
Measure=Plugin
Plugin=Process
ProcessName=#Process3#

========================================
; Alarm
========================================
[mDigitPrefixerAlarm]
Measure=calc
Formula=00
Dynamicvariables=1
IfCondition=(#AlarmHourSet# >= 0) && (#AlarmHourSet# <= 9)
IfTrueAction=[!SetOption HourAlarm Prefix "0"]
IfFalseAction=[!SetOption HourAlarm Prefix ""]
IfCondition2=(#AlarmMinuteSet# >= 0) && (#AlarmMinuteSet# <= 9)
IfTrueAction2=[!SetOption MinuteAlarm Prefix "0"]
IfFalseAction2=[!SetOption MinuteAlarm Prefix ""]
Group=mALARM | ALARM

[mHourAlarm]
Measure=Time
Format=%H
Group=ALARM

[mMinuteAlarm]
Measure=Time
Format=%M
Group=ALARM

[Alarm]
Measure=calc
Formula=0
DynamicVariables=1
IfCondition=(mHourAlarm = #AlarmHourSet#) && (mMinuteAlarm = #AlarmMinuteSet#-10)
IfTrueAction=[!SetOption Action Text "#Message1#"][Play #Alarm#][!Redraw]
IfCondition2=(mHourAlarm = #AlarmHourSet#) && (mMinuteAlarm = #AlarmMinuteSet#)
IfTrueAction2=[!SetOption Action Text "#Message2#"][#Act#][!Redraw]

[HourAlarm]
Meter=String
MeasureName=mHour
MeterStyle=sAllText | sHighlight
FontSize=9
Text=#AlarmHourSet#:
DynamicVariables=1
MouseScrollUpAction=[!SetVariable AlarmHourSet (Clamp(#AlarmHourSet#+1,0,23))] [!UpdateMeasureGroup mALARM] [!UpdateMeter HourAlarm] [!Redraw]
MouseScrollDownAction=[!SetVariable AlarmHourSet (Clamp(#AlarmHourSet#-1,0,23))] [!UpdateMeasureGroup mALARM] [!UpdateMeter HourAlarm] [!Redraw]
Group=AlarmSet
Hidden=1
X=29
Y=30

[MinuteAlarm]
Meter=String
MeterStyle=sAllText | sHighlight
FontSize=9
Text=#AlarmMinuteSet#
DynamicVariables=1
MouseScrollUpAction=[!SetVariable AlarmMinuteSet (Clamp(#AlarmMinuteSet#+1,0,59))] [!UpdateMeasureGroup mALARM] [!UpdateMeter MinuteAlarm] [!Redraw]
MouseScrollDownAction=[!SetVariable AlarmMinuteSet (Clamp(#AlarmMinuteSet#-1,0,59))] [!UpdateMeasureGroup mALARM] [!UpdateMeter MinuteAlarm] [!Redraw]
Group=AlarmSet
Hidden=1
X=-4R
Y=r

========================================
; Countdown
========================================
[mTime]
Group=TimerGroup
Measure=Time
Format=%H:%M %S
OnChangeAction=[!SetVariable Seconds (#Seconds#+#Direction#*(1-#Reset#))]
DynamicVariables=1

[mUptime]
Group=TimerGroup
Measure=Uptime
SecondsValue=#Seconds#
Format="%3!02i!:%2!02i!#CRLF#%1!02i!"
MaxValue=([#DefaultSeconds]+[#DefaultMinutes]*60+[#DefaultHours]*3600)
IfCondition=(#CURRENTSECTION#<=0) && (Sgn(#Direction#)=-1)
IfTrueAction=[!PauseMeasureGroup TimerGroup][#Act#][!SetOption Action Text "#Message2#"][Play "#Alarm#"][!Redraw]
IfCondition2=(#CURRENTSECTION#=600)
IfTrueAction2=[!SetOption Action Text "#Message1#"][Play "#Alarm#"][!Redraw]
IfConditionMode=1
DynamicVariables=1
OnUpdateAction=[!Log "Seconds = #Seconds#, mUptime = [mUptime]"]

[mClose]
Measure=Plugin
Plugin=RunCommand
Program=PowerShell
Parameter=taskkill /IM #APP1#;taskkill /IM #APP2#;taskkill /IM #APP3#;taskkill /IM #APP4#;taskkill /IM #APP5#;taskkill /IM #APP6#

[UptimeText]
Meter=String
MeasureName=mUptime
MeterStyle=sAllText
FontSize=10
Text=%1
InlineSetting=Size | 8
InlinePattern=^.*(\s.*)$
InlineSetting2=Weight | 800
InlinePattern2=^.*(\s.*)$
InlinePattern3=^$
InlineSetting3=Color | #Color2#
Group=Start | Controls
Hidden=1
X=197
Y=27

[Hours]
Meter=Image
SolidColor=0,0,0,1
MouseOverAction=[!SetOption UptimeText InlinePattern3 "^(\d{2})"][!UpdateMeter UptimeText][!Redraw]
MouseLeaveAction=[!SetOption UptimeText InlinePattern3 "^$"][!UpdateMeter UptimeText][!Redraw]
MouseScrollUpAction=[!SetVariable Default[#CURRENTSECTION] "([#DefaultHours]=99 ? 0 : [#DefaultHours]+1)"][!SetVariable Seconds ([#DefaultSeconds]+[#DefaultMinutes]*60+[#DefaultHours]*3600)][!SetVariable Reset 1][!UnpauseMeasureGroup TimerGroup][!UpdateMeasureGroup TimerGroup][!PauseMeasureGroup TimerGroup][!SetVariable Reset 0][!UpdateMeter *][!Redraw]
MouseScrollDownAction=[!SetVariable Default[#CURRENTSECTION] "([#DefaultHours]=0 ? 99 : [#DefaultHours]-1)"][!SetVariable Seconds ([#DefaultSeconds]+[#DefaultMinutes]*60+[#DefaultHours]*3600)][!SetVariable Reset 1][!UnpauseMeasureGroup TimerGroup][!UpdateMeasureGroup TimerGroup][!PauseMeasureGroup TimerGroup][!SetVariable Reset 0][!UpdateMeter *][!Redraw]
DynamicVariables=1
Hidden=1
Group=Settings
H=15
W=20
X=-20r
Y=r

[Minutes]
Meter=Image
MeterStyle=Hours
MouseOverAction=[!SetOption UptimeText InlinePattern3 "^.*:(\d{2})"][!UpdateMeter UptimeText][!Redraw]
MouseLeaveAction=[!SetOption UptimeText InlinePattern3 "^$"][!UpdateMeter UptimeText][!Redraw]
MouseScrollUpAction=[!SetVariable Default[#CURRENTSECTION] "([#DefaultMinutes]=59 ? 0 : [#DefaultMinutes]+1)][!SetVariable Seconds ([#DefaultSeconds]+[#DefaultMinutes]*60+[#DefaultHours]*3600)][!SetVariable Reset 1][!UnpauseMeasureGroup TimerGroup][!UpdateMeasureGroup TimerGroup][!PauseMeasureGroup TimerGroup][!SetVariable Reset 0][!UpdateMeter *][!Redraw]
MouseScrollDownAction=[!SetVariable Default[#CURRENTSECTION] "([#DefaultMinutes]=0 ? 59 : [#DefaultMinutes]-1)"][!SetVariable Seconds ([#DefaultSeconds]+[#DefaultMinutes]*60+[#DefaultHours]*3600)][!SetVariable Reset 1][!UnpauseMeasureGroup TimerGroup][!UpdateMeasureGroup TimerGroup][!PauseMeasureGroup TimerGroup][!SetVariable Reset 0][!UpdateMeter *][!Redraw]
X=3R

[Seconds]
Meter=Image
MeterStyle=Hours
MouseOverAction=[!SetOption UptimeText InlinePattern3 "^.*\s(\d{2})"][!UpdateMeter UptimeText][!Redraw]
MouseLeaveAction=[!SetOption UptimeText InlinePattern3 "^$"][!UpdateMeter UptimeText][!Redraw]
MouseScrollUpAction=[!SetVariable Default[#CURRENTSECTION] "([#DefaultSeconds]=59 ? 0 : [#DefaultSeconds]+1)"][!SetVariable Seconds ([#DefaultSeconds]+[#DefaultMinutes]*60+[#DefaultHours]*3600)][!SetVariable Reset 1][!UnpauseMeasureGroup TimerGroup][!UpdateMeasureGroup TimerGroup][!PauseMeasureGroup TimerGroup][!SetVariable Reset 0][!UpdateMeter *][!Redraw]
MouseScrollDownAction=[!SetVariable Default[#CURRENTSECTION] "([#DefaultSeconds]=0 ? 59 : [#DefaultSeconds]-1)"][!SetVariable Seconds ([#DefaultSeconds]+[#DefaultMinutes]*60+[#DefaultHours]*3600)][!SetVariable Reset 1][!UnpauseMeasureGroup TimerGroup][!UpdateMeasureGroup TimerGroup][!PauseMeasureGroup TimerGroup][!SetVariable Reset 0][!UpdateMeter *][!Redraw]
H=13
X=-10r
Y=R

[TimerBar]
Meter=RoundLine
MeasureName=mUptime
MeterStyle=sRoundBar
LineColor=#Color2#
LineWidth=5
Group=Controls | Timer
Hidden=1
X=197
Y=37

========================================
; Process
========================================
[mProcessTimerStart]
Measure=Calc
Formula=1
IfCondition=(mAPP1=1) || (mAPP2=1) || (mAPP3=1) || (mAPP4=1) || (mAPP5=1) || (mAPP6=1)
IfTrueAction=[!ActivateConfig "RM\ScreenSaver" "ScreenSaver..ini"][!UnpauseMeasureGroup TimerGroup][!ToggleMeterGroup PlayPause][!ShowMeterGroup Controls][!SetOptionGroup Start FontColor "#Color3#"][!Redraw]
IfFalseAction=[!DeactivateConfig "RM\ScreenSaver" "ScreenSaver v2..ini"][!PauseMeasureGroup TimerGroup][!ToggleMeterGroup PlayPause][!SetOptionGroup Start FontColor "#Color1#"][PlayStop "#Alarm#"][!Redraw]

[mAPP1]
Measure=Plugin
Plugin=Process
ProcessName=#APP1#

[mAPP2]
Measure=Plugin
Plugin=Process
ProcessName=#APP2#

[mAPP3]
Measure=Plugin
Plugin=Process
ProcessName=#APP3#

[mAPP4]
Measure=Plugin
Plugin=Process
ProcessName=#APP4#

[mAPP5]
Measure=Plugin
Plugin=Process
ProcessName=#APP5#

[mAPP6]
Measure=Plugin
Plugin=Process
ProcessName=#APP6#

========================================
; Controls
========================================
[sControls]
FontFace=Segoe Fluent Icons
FontSize=10
StringAlign=CenterCenter
X=92
Y=63

[Play]
Meter=String
MeterStyle=sAllText | sControls | sHighlight
Text=[\xE768]
;Text=[\xE81C]
LeftMouseUpAction=[!UnpauseMeasureGroup TimerGroup][!ToggleMeterGroup PlayPause][!SetOptionGroup Start FontColor "#Color3#"][!Redraw]
Group=PlayPause | Start | Controls

[Pause]
Meter=String
MeterStyle=sAllText | sControls | sHighlight
Text=[\xE769]
LeftMouseUpAction=[!PauseMeasureGroup TimerGroup][!ToggleMeterGroup PlayPause][!SetOptionGroup Start FontColor "#Color1#"][PlayStop "#Alarm#"][!Redraw]
Group=PlayPause | Start

[Reset]
Meter=String
MeterStyle=sAllText | sControls | sHighlight
Text=[\xE72C]
FontSize=9
LeftMouseUpAction=[!Refresh]
ToolTipText=Reset/Alarm Stop
Group=Controls
X=25r

[Set]
Meter=String
MeterStyle=sAllText | sControls | sHighlight
Text=[\xE713]
FontSize=9
LeftMouseUpAction=[!ToggleMeterGroup Settings][!HideMeter Action][!SetOptionGroup Button Hidden "0"] [!UpdateMeter *][!Redraw]
Group=Controls | Settings
X=25r

[OK]
Meter=String
MeterStyle=sAllText | sControls | sHighlight
Text=[\xE930]
FontSize=9
LeftMouseUpAction=[!ToggleMeterGroup Settings][!ShowMeter Action][!SetOptionGroup Button Hidden "1"] [!UpdateMeter *][!WriteKeyValue Variables DefaultSeconds [#DefaultSeconds]][!WriteKeyValue Variables DefaultMinutes [#DefaultMinutes]][!WriteKeyValue Variables DefaultHours [#DefaultHours]][!SetVariable DefaultSeconds [#DefaultSeconds]][!SetVariable DefaultMinutes [#DefaultMinutes]][!SetVariable DefaultHours [#DefaultHours]][!UpdateMeter *][!Redraw]
Group=Settings
Hidden=1
X=r

========================================
; Buttons
========================================
[sButton]
Shape=Rectangle 0,0,10,10,50 | Extend FillAlpha | StrokeWidth 2 | Extend StrokeAlpha
FillAlpha=Fill Color #Color5#
StrokeAlpha=Stroke Color 128,255,0,0
MouseOverAction=[!SetOption #CURRENTSECTION# StrokeAlpha "Stroke Color 255,255,0,255"] [!UpdateMeter *][!Redraw]
MouseLeaveAction=[!SetOption #CURRENTSECTION# StrokeAlpha ""] [!UpdateMeter *] [!Redraw] 
LeftMouseUpAction=[!SetOptionGroup Button FillAlpha "Fill Color #Color5#"][!SetOption #CURRENTSECTION# FillAlpha "Fill Color #Color2#"][!WriteKeyValue Variables Act "[#[#CURRENTSECTION#]]"] [!WriteKeyValue Variables ActionText [#CURRENTSECTION]] [!SetVariable Act "[#[#CURRENTSECTION#]]"] [!SetVariable ActionText [#CURRENTSECTION]][!UpdateMeter *][!Redraw]
ToolTipText=[#CURRENTSECTION]
DynamicVariables=1
Group=Button
Hidden=1
MouseActionCursor=0
UpdateDivider=-1
X=20r
Y=r

[CloseApps]
Meter=Shape
MeterStyle=sButton
X=72
Y=8

[Hibernate]
Meter=Shape
MeterStyle=sButton

[Shutdown]
Meter=Shape
MeterStyle=sButton

[Lock]
Meter=Shape
MeterStyle=sButton

[Off]
Meter=Shape
MeterStyle=sButton

========================================
; Message
========================================
[Action]
Meter=String
MeterStyle=sAllText
FontSize=9
FontColor=255,228,110,255
Text=[#ActionText]
Group=Controls
Hidden=1
X=117
Y=6
DynamicVariables=1
User avatar
sl23
Posts: 1140
Joined: February 17th, 2011, 7:45 pm
Location: a Galaxy S7 far far away

Re: String meter won't update

Post by sl23 »

Wow! Thanks et for taking the time to explain :thumbup:

Sorry if i'm being a bit stupid, but, the terms you use are probably causing my confusion. :oops:
The reason your [Action] meter is not updating is because you are using !SetOption in the [BGTimer] section and setting the Text for that meter to the VALUE of the variable, rather than to the actual variable name.
What's the difference between Value and actual variable name in this sentence?
you need to escape the variable in the bang.
I read the page you linked to and the part about escaping a variable, but am none the wiser on when, what, why or how this worls. When to use it? What does it do exactly? Why the need to do it? How does it work?
I would recommend escaping all of your !SetOption bangs that set keywords to variable values that may change dynamically in the skin.
I just don't understand what this means, again, due to the lack of understanding of the basic terminology you use. How do I recognise what does and doesn't need escaping? Again sorry, I have no programming knowledge, so understanding these probably very simple concepts can sometimes be a task in itself! I mean, even using square brackets is alien to me! I still have no idea when to use them or why they are used, I just know that it's used in previous working code so I do what works. I have no clue as to their purpose, or indeed any of the syntax' purpose!

I did what you said and it solved the issues.
Now I don't understand why it hasn't solved the same issues in the variant skin? It really isn't much different.
- MuLab -
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5406
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: String meter won't update

Post by eclectic-tech »

sl23 wrote: October 19th, 2021, 3:33 pm Wow! Thanks et for taking the time to explain :thumbup:

Sorry if i'm being a bit stupid, but, the terms you use are probably causing my confusion. :oops:


What's the difference between Value and actual variable name in this sentence?


I read the page you linked to and the part about escaping a variable, but am none the wiser on when, what, why or how this worls. When to use it? What does it do exactly? Why the need to do it? How does it work?


I just don't understand what this means, again, due to the lack of understanding of the basic terminology you use. How do I recognise what does and doesn't need escaping? Again sorry, I have no programming knowledge, so understanding these probably very simple concepts can sometimes be a task in itself! I mean, even using square brackets is alien to me! I still have no idea when to use them or why they are used, I just know that it's used in previous working code so I do what works. I have no clue as to their purpose, or indeed any of the syntax' purpose!

I did what you said and it solved the issues.
Now I don't understand why it hasn't solved the same issues in the variant skin? It really isn't much different.
First, you are not stupid :uhuh: These concepts can be difficult to understand at first for everyone.

The reason there is an option to escape parameters (usually variables or measures) in bangs is to be able to set a value to the changing variable rather than to it's current value.

This is usually only applicable when using !WriteKeyValue and !SetOption bangs to change a value to a variable or measure, and that value may change while using the skin.

If you do not escape the parameter in the bang, then those actions will write the current value of the variable or measure and will no longer respond to changes in those values.

!WriteKeyValue makes a permanent change to the code when the skin is refreshed.

!SetOption makes a temporary change to the code (the section is dynamic for 1 update). But if you use !SetOption to change a variable or measure to the current value and DO NOT escaping the parameter, the section will no longer respond to changes in those values; it has been set to the current value and will not change when the variable or measure value changes.

Hope this helps your understanding of this a bit... :???:
User avatar
jsmorley
Developer
Posts: 22630
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: String meter won't update

Post by jsmorley »

Look at it this way.

If you have an action that uses !SetOption to change some option value, it might look like this:

TrueAction=[!SetOption SomeMeter Text "#SomeVariable#"]

Now what will happen there is that when the bang is read, it will first "resolve" the value of the variable #SomeVariable#. let's pretend that the value at that moment is "Red". So what will happen is that the value of the Text option on SomeMeter will be set to Text=Red.

Now that's fine, and generally speaking that is what you want.

However, if the intention is to set the value of the Text option to be the variable #SomeVariable# itself, if going forward the value of #SomeVariable# is going to change, and you want SomeMeter to react to that, you need to set the option to be #SomeVariable#, NOT "Red".

The only way to do that, since all variables are "resolved" to their current "value" when they are read, is to "escape" the variable in the bang. Like this:

TrueAction=[!SetOption SomeMeter Text "#*SomeVariable*#"]

Note the * asterisks in the variable. That will tell Rainmeter that you want to set the value of the Text option on SomeMeter to the LITERAL "#SomeVariable#". The value of the option will be set to literally Text=#SomeVariable#. Now it would still resolve to "Red" in the meter at that point. However, assuming you have DynamicVariables=1 on the meter, if the value of #SomeVariable# changes going forward, the value of the Text option will change with it.
User avatar
sl23
Posts: 1140
Joined: February 17th, 2011, 7:45 pm
Location: a Galaxy S7 far far away

Re: String meter won't update

Post by sl23 »

Thank you for further explanation on this. :D
It helps a little in terms of theory, but practical side is still very hazy! No problem though, i'll hopefully figure it out sooner or later how that works :thumbup:

I just saw jsmorley's post as I went to post this. I think I get it. So instead of setting to a variables value, you are "escaping" that value and using the actual name of that variable, is that right? :???: My head hurts! :rofl:

I'm confused about why the need to escape though, as I have had this happen without using any asterisks?
- MuLab -
User avatar
jsmorley
Developer
Posts: 22630
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: String meter won't update

Post by jsmorley »

sl23 wrote: October 19th, 2021, 4:28 pm Thank you for further explanation on this. :D
It helps a little in terms of theory, but practical side is still very hazy! No problem though, i'll hopefully figure it out sooner or later how that works :thumbup:

I just saw jsmorley's post as I went to post this. I think I get it. So instead of setting to a variables value, you are "escaping" that value and using the actual name of that variable, is that right? :???: My head hurts! :rofl:

I'm confused about why the need to escape though, as I have had this happen without using any asterisks?
That's exactly right...