Here's the original code:
Code: Select all
[Rainmeter]
Update=1000
[Metadata]
Name=Alarm-Clock
Author=Youkai1977
Version=V1.0 <> 31.10.2018
Information=This Meter is a Part of Terminal-Skin Package
License=Creative Commons BY-NC-SA 3.0
;--------------------------------------------------
;--- VARIABLES & STYLES ---------------------------
;--------------------------------------------------
[Variables]
Images=#@#images\
ImgAlpha=230
SoundPath1=#@#sounds\chimehour.wav
SoundPath2=#@#sounds\alarmclock.wav
DigitColor=0,167,0,230
ValueHourSet=23
ValueMinuteSet=0
FS1=40
FS2=14
FS3=8
FS4=12
[Style1]
FontColor=#DigitColor#
FontFace=Corbel
StringAlign=LEFT
StringStyle=Bold
AntiAlias=1
[Style2]
FontColor=#DigitColor#
FontFace=CONSOLAS
StringAlign=LEFT
StringStyle=Bold
AntiAlias=1
;--------------------------------------------------
;--- MEASURES -------------------------------------
;--------------------------------------------------
;--- MEASURES CLOCK, CHIMESOUND & ALARM -----------
[MeasureTime]
Measure=Time
Format=%#I:%M
[MeasureSec]
Measure=Time
Format=%S
[MeasureChimeHour]
Measure=Time
Format=%M
IfEqualValue=0
IfEqualAction=[Play "#SoundPath1#"]
[MeasureMinMaxHourAlarm]
measure=calc
formula=#ValueHourSet#
DynamicVariables=1
ifconditionmode=1
IfCondition=(#ValueHourSet# < 0)
IfTrueAction=[!SetVariable ValueHourSet "23"]
IfCondition2=(#ValueHourSet# >= 24)
IfTrueAction2=[!SetVariable ValueHourSet "0"]
RegExpSubstitute=1
Substitute="^(\d$)":"0\1"
Disabled=1
Group=mALARM | ALARM
[MeasureMinMaxMinuteAlarm]
measure=calc
formula=#ValueMinuteSet#
DynamicVariables=1
ifconditionmode=1
IfCondition=(#ValueMinuteSet# < 0)
IfTrueAction=[!SetVariable ValueMinuteSet "55"]
IfCondition2=(#ValueMinuteSet# >= 60)
IfTrueAction2=[!SetVariable ValueMinuteSet "0"]
RegExpSubstitute=1
Substitute="^(\d$)":"0\1"
Disabled=1
Group=mALARM | ALARM
[MeasureDigitPrefixerAlarm]
Measure=calc
Formula=00
Dynamicvariables=1
IfCondition=(#ValueHourSet# >= 0) && (#ValueHourSet# <= 9)
IfTrueAction=[!SetOption HourAlarm Prefix "0"]
IfFalseAction=[!SetOption HourAlarm Prefix ""]
IfCondition2=(#ValueMinuteSet# >= 0) && (#ValueMinuteSet# <= 9)
IfTrueAction2=[!SetOption MinuteAlarm Prefix "0"]
IfFalseAction2=[!SetOption MinuteAlarm Prefix ""]
Disabled=1
Group=mALARM | ALARM
[MeasureHourAlarm]
Measure=Time
Format=%H
Disabled=1
Group=ALARM
[MeasureMinuteAlarm]
Measure=Time
Format=%M
Disabled=1
Group=ALARM
[Alarm]
Measure=calc
Formula=0
DynamicVariables=1
IfCondition=(MeasureHourAlarm = #ValueHourSet#) && (MeasureMinuteAlarm = #ValueMinuteSet#)
IfTrueAction=[PlayLoop #SoundPath2#][!Redraw]
Disabled=0
Group=ALARM
;--- MEASURE DATE ---------------------------------
[MeasureDate]
Measure=Time
Format=%d.%m.%Y
;--------------------------------------------------
;--- BACKGROUND -----------------------------------
;--------------------------------------------------
[Background]
Meter=Image
ImageName=#Images#bg_clock.png
AntiAlias=1
X=0
Y=0
W=220
H=82
[SetClockBG]
Meter=Image
SolidColor=0,0,0,1
X=0
Y=-5
W=250
H=72
LeftMouseUpAction=[!ToggleMeasure MeasureChimeHour][!ToggleMeter ChimeSoundOFF][!Redraw]
MiddleMouseUpAction=[%windir%\system32\control.exe timedate.cpl]
RightMouseUpAction=[!EnableMeasureGroup ALARM][!DisableMeasure MeasureChimeHour][!ShowMeterGroup ALARMSET][!HideMeterGroup CLOCK][!HideMeter ChimeSoundOFF][!ShowMeter ChimeSoundALARM][!HideMeter SetClockBG][!Update]
;--------------------------------------------------
;--- CLOCK, DATE, ALARM ---------------------------
;--------------------------------------------------
;--- Clock ----------------------------------------
[Time]
Meter=String
MeasureName=MeasureTime
MeterStyle=Style1
FontSize=#FS1#
X=0
Y=-2
Group=CLOCK
[Seconds]
Meter=String
MeasureName=MeasureSec
FontSize=#FS2#
MeterStyle=Style1
X=180r
Y=35r
Group=CLOCK
;--- Alarm-SET ------------------------------------
[AlarmBG]
Meter=Image
solidcolor=0,0,0,1
X=0
Y=0
W=220
H=82
Hidden=1
Group=ALARMSET
MouseLeaveAction=[!HideMeterGroup ALARMSET][!ShowMeterGroup CLOCK][!ShowMeter AlarmIconON][!ShowMeterGroup ALARMON][!HideMeter AlarmSetIcon][!Redraw]
[HourAlarm]
Meter=String
MeterStyle=Style1
FontSize=#FS1#
Text="#ValueHourSet#"
X=0
Y=-2
DynamicVariables=1
Hidden=1
Group=ALARMSET
MouseScrollUpAction=[!SetVariable ValueHourSet (#ValueHourSet#+1)][!UpdateMeasureGroup mALARM][!UpdateMeter HourAlarm][!Redraw]
MouseScrollDownAction=[!SetVariable ValueHourSet (#ValueHourSet#-1)][!UpdateMeasureGroup mALARM][!UpdateMeter HourAlarm][!Redraw]
[ColonAlarm]
Meter=string
MeterStyle=Style1
FontSize=#FS1#
Text=":"
X=76r
Y=r
Hidden=1
Group=ALARMSET
[MinuteAlarm]
Meter=String
MeterStyle=Style1
FontSize=#FS1#
Text="#ValueMinuteSet#"
X=20r
Y=r
DynamicVariables=1
Hidden=1
Group=ALARMSET
MouseScrollUpAction=[!SetVariable ValueMinuteSet (#ValueMinuteSet#+1)][!UpdateMeasureGroup mALARM][!UpdateMeter MinuteAlarm][!Redraw]
MouseScrollDownAction=[!SetVariable ValueMinuteSet (#ValueMinuteSet#-1)][!UpdateMeasureGroup mALARM][!UpdateMeter MinuteAlarm][!Redraw]
;--- DATE & ALARM-TIME ----------------------------
[Date]
Meter=String
MeasureName=MeasureDate
MeterStyle=Style1
FontSize=#FS4#
X=8
Y=59
[AlarmIconON]
Meter=Image
ImageName=#Images#alarm_on.png
ImageAlpha=#ImgAlpha#
AntiAlias=1
X=127r
Y=2r
W=16
H=16
ToolTipText="Set/Stop Alarm"
Hidden=1
Group=ALARMON
LeftMouseUpAction=[!ShowMeterGroup ALARMSET][!HideMeterGroup CLOCK][!HideMeter AlarmIconON][!HideMeterGroup ALARMON][!ShowMeter AlarmSetIcon][!Redraw]
RightMouseUpAction=[!DisableMeasureGroup ALARM][!EnableMeasure MeasureChimeHour][!HideMeter AlarmIconON][!HideMeter AlarmTimeON][!HideMeter ChimeSoundALARM][PlayStop "#SoundPath2#"][!ShowMeter SetClockBG][!Redraw]
[AlarmTimeON]
Meter=String
MeasureName=MeasureMinMaxHourAlarm
MeasureName2=MeasureMinMaxMinuteAlarm
MeterStyle=Style1
FontSize=#FS4#
Text=%1:%2
X=20r
Y=-2r
Hidden=1
Group=ALARMON
LeftMouseUpAction=[!ShowMeterGroup ALARMSET][!HideMeterGroup CLOCK][!HideMeter AlarmIconON][!HideMeterGroup ALARMON][!ShowMeter AlarmSetIcon][!Redraw]
RightMouseUpAction=[!DisableMeasureGroup ALARM][!EnableMeasure MeasureChimeHour][!HideMeter AlarmIconON][!HideMeter AlarmTimeON][!HideMeter ChimeSoundALARM][PlayStop "#SoundPath2#"][!ShowMeter SetClockBG][!Redraw]
;--------------------------------------------------
;--- BUTTONS CLOCK/ALARM-SET ----------------------
;--------------------------------------------------
[ChimeSoundOFF]
Meter=Image
ImageName=#Images#Chime_off.png
ImageAlpha=#ImgAlpha#
AntiAlias=1
X=188
Y=10
W=16
H=16
ToolTipText="ChimeSound is OFF"
Hidden=1
[ChimeSoundALARM]
Meter=Image
ImageName=#Images#Chime_off.png
ImageAlpha=#ImgAlpha#
AntiAlias=1
X=r
Y=r
W=16
H=16
ToolTipText="Disabled in Alarm-Mode"
Hidden=1
[AlarmSetIcon]
Meter=Image
ImageName=#Images#setalarm.png
ImageAlpha=#ImgAlpha#
AntiAlias=1
X=135
Y=61
W=16
H=16
Hidden=1
Group=ALARMSET
[AlarmSetText]
Meter=STRING
MeterStyle=Style2
FontSize=#FS3#
Text=SET ALARM
X=18r
Y=3r
Hidden=1
Group=ALARMSET
If I turn the alarm On then Off the MouseScrollActions don't work as they should. So scrolling over the Hour or Minutes doesn't cycle from 23 to 1 or from 59 to 1.
Scrolling the Hour makes it keep counting up past 23 or below 0 to minus numbers instead of 22, 23, 0 or 2, 1, 0, 23. Minutes does the same, it keeps counting up past 60 or below 0 to -1, -2, etc.
Can someone please point out what I've removed or changed that is causing the issue as I just don't see it.
Here's the New version:
Code: Select all
[Rainmeter]
Update=1000
[Metadata]
Name=Alarm Clock
;--------------------------------------------------
;--- VARIABLES & STYLES ---------------------------
;--------------------------------------------------
[Variables]
;SoundPath1=#@#sounds\chimehour.wav
;SoundPath2=#@#sounds\alarmclock.wav
AlarmHourSet=23
AlarmMinuteSet=0
[sAllText]
FontColor=128,255,0,100
FontFace=Corbel
FontSize=14
StringAlign=LEFT
StringStyle=Bold
AntiAlias=1
;--------------------------------------------------
;--- MEASURES -------------------------------------
;--------------------------------------------------
;--- MEASURES CLOCK, CHIMESOUND & ALARM -----------
[mTime]
Measure=Time
Format=%#I:%M %S
[mMinMaxHourAlarm]
measure=calc
formula=#AlarmHourSet#
DynamicVariables=1
ifconditionmode=1
IfCondition=(#AlarmHourSet# < 0)
IfTrueAction=[!SetVariable AlarmHourSet "23"]
IfCondition2=(#AlarmHourSet# >= 24)
IfTrueAction2=[!SetVariable AlarmHourSet "0"]
RegExpSubstitute=1
Substitute="^(\d$)":"0\1"
Group=mALARM | ALARM
[mMinMaxMinuteAlarm]
measure=calc
formula=#AlarmMinuteSet#
DynamicVariables=1
ifconditionmode=1
IfCondition=(#AlarmMinuteSet# < 0)
IfTrueAction=[!SetVariable AlarmMinuteSet "59"]
IfCondition2=(#AlarmMinuteSet# >= 60)
IfTrueAction2=[!SetVariable AlarmMinuteSet "0"]
RegExpSubstitute=1
Substitute="^(\d$)":"0\1"
Group=mALARM | 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#)
IfTrueAction=[PlayLoop #@#sounds\alarmclock.wav][!Redraw]
Group=ALARM
;--------------------------------------------------
;--- BACKGROUND -----------------------------------
;--------------------------------------------------
[Bg]
Meter=Shape
MouseOverAction=[!SetOption #CURRENTSECTION# StrokeAlpha "Stroke Color 128,255,0,255"][!UpdateMeter *][!Redraw]
MouseLeaveAction=[!SetOption #CURRENTSECTION# StrokeAlpha "Stroke Color 128,255,0,100"][!UpdateMeter *][!Redraw]
Shape=Rectangle 1,1,200,70,5 | Fill Color 20,150,20,50 | StrokeWidth 2 | Extend StrokeAlpha
StrokeAlpha=Stroke Color 128,255,0,100
DynamicVariables=1
;--------------------------------------------------
;--- CLOCK, ALARM ---------------------------
;--------------------------------------------------
[Time]
Meter=String
MeasureName=mTime
MeterStyle=sAllText
FontSize=36
SolidColor=0,0,0,1
;MiddleMouseUpAction=[%windir%\system32\control.exe timedate.cpl]
InlineSetting=Size | 14
InlinePattern=.+:.+( .+)
; The InlinePattern is saying:
; . Any character, + one or more times, then ":" then . any character, + one or more times, then ( start capturing a space, then any . character, + one or more times, then ) stop capturing. Capturing the space with the seconds, also sets it to size 20 and not 50, which I think looks better.
X=5
Y=10
[sChime]
ImageAlpha=230
AntiAlias=1
ImageName=#@#images\Chime_off.png
Hidden=1
W=16
H=16
[mChimeHour]
Measure=Time
Format=%M
IfEqualValue=0
IfEqualAction=[Play "#@#sounds\chimehour.wav"]
[ChimeOFF]
Meter=Image
MeterStyle=sChime
X=175
Y=-34R
ToolTipText="ChimeSound is OFF"
[ChimeALARM]
Meter=Image
MeterStyle=sChime
X=r
Y=r
ToolTipText="Disabled in Alarm Mode"
======================================================
[AlarmSet]
Meter=Shape
Shape=Rectangle 0,0,70,25,5 | Fill Color 20,150,20,30 | StrokeWidth 2 | Extend StrokeAlpha
StrokeAlpha=Stroke Color 128,255,0,0
DynamicVariables=1
ToolTipText="L - Alarm Off#CRLF#M - Toggle Chime#CRLF#R - Alarm On"
LeftMouseUpAction=[!SetOption AlarmSet StrokeAlpha "Stroke Color 128,255,0,0"][!DisableMeasureGroup ALARM][!EnableMeasure mChimeHour][!HideMeter ChimeALARM][PlayStop "#SoundPath2#"][!Update]
MiddleMouseUpAction=[!ToggleMeasure mChimeHour][!ToggleMeter ChimeOFF][!Redraw]
RightMouseUpAction=[!SetOption AlarmSet StrokeAlpha "Stroke Color 128,255,0,100"][!EnableMeasureGroup ALARM][!DisableMeasure mChimeHour][!ShowMeterGroup ALARMSET][!HideMeter ChimeOFF][!ShowMeter ChimeALARM][!Update]
X=125
Y=8
[HourAlarm]
Meter=String
MeterStyle=sAllText | AlarmSet
Text="#AlarmHourSet#:"
DynamicVariables=1
X=8r
Y=-2r
MouseScrollUpAction=[!SetVariable AlarmHourSet (#AlarmHourSet#+1)][!UpdateMeasureGroup mALARM][!UpdateMeter HourAlarm][!Redraw]
MouseScrollDownAction=[!SetVariable AlarmHourSet (#AlarmHourSet#-1)][!UpdateMeasureGroup mALARM][!UpdateMeter HourAlarm][!Redraw]
[MinuteAlarm]
Meter=String
MeterStyle=sAllText | AlarmSet
Text="#AlarmMinuteSet#"
DynamicVariables=1
X=-4R
Y=r
MouseScrollUpAction=[!SetVariable AlarmMinuteSet (#AlarmMinuteSet#+1)][!UpdateMeasureGroup mALARM][!UpdateMeter MinuteAlarm][!Redraw]
MouseScrollDownAction=[!SetVariable AlarmMinuteSet (#AlarmMinuteSet#-1)][!UpdateMeasureGroup mALARM][!UpdateMeter MinuteAlarm][!Redraw]