how do i get the "vTimeStarted" back to it's original state?
or does anyone have a better idea to stop the counter?
Here is my code. problem is (i think) in line 30
Code: Select all
[Rainmeter]
Update=100
DynamicWindowSize=1
AccurateText=1
[Variables]
DynamicVariables=1
;variable for "setting time when counting started"
vTimeStartedDebug=[TimeClockGet:Timestamp]
vTimeStarted=[TimeClockGet:Timestamp]
;variable for adjusting time
StopwatchTime=0
DebugNumber=0
;Get time
[TimeClockGet]
Measure=Time
Format=%#I:%M:%S %p
;Calculates the time since it started
[CalcTimeSinceStart]
Measure=Calc
Formula=#vTimeStarted#-[TimeClockGet:Timestamp]+#StopwatchTime#
DynamicVariables=1
IfCondition=CalcTimeSinceStart<=0
IfTrueAction=[!setVariable DebugNumber 1]
IfFalseAction=[!setVariable DebugNumber 0]
IfCondition2=CalcTimeSinceStart<=0
IfTrueAction2=[!SetVariable vTimeStarted [&*TimeClockGet:Timestamp*]
IfCondition3=CalcTimeSinceStart<=0
IfTrueAction3=[!setVariable StopwatchTime 0]
;extrastep for display later in HH:MM:SS
[CalcStopwatchSeconds]
Measure=Calc
Formula=(CalcTimeSinceStart%60)/100
Substitute="0.":""
[CalcStopwatchMinutes]
Measure=Calc
Formula=(Floor(CalcTimeSinceStart/60)%60/100)
Substitute="0.":""
[CalcStopwatchHours]
Measure=Calc
Formula=Floor(CalcTimeSinceStart/3600)/100
Substitute="0.":""
[MeterOne]
DynamicVariables=1
LeftMouseUpAction=[!SetVariable vTimeStarted [TimeClockGet:Timestamp]][!Update]
Meter=String
MeasureName=TimeClockGet
MeasureName2=CalcTimeSinceStart
Text=Started: #vTimeStarted##CRLF#Clock: %1#CRLF#SinceStart: %2
SolidColor=127,127,127,255
FontSize=30
NumOfDecimals=2
[MeterH]
SolidColor=127,127,127,255
FontSize=30
NumOfDecimals=2
DynamicVariables=1
Meter=String
X=r
Y=R
MeasureName=CalcStopwatchHours
Text=%1:
MouseScrollDownAction=[!setVariable StopwatchTime (#StopwatchTime#+3600)>359999?#StopwatchTime#:(#StopwatchTime#+3600)][!Update]
MouseScrollUpAction=[!setVariable StopwatchTime (#StopwatchTime#-3600)<0?#StopwatchTime#:(#StopwatchTime#-3600)][!Update]
[MeterM]
SolidColor=127,127,127,255
FontSize=30
NumOfDecimals=2
DynamicVariables=1
Meter=String
X=R
Y=r
MeasureName=CalcStopwatchMinutes
Text=%1
MouseScrollDownAction=[!setVariable StopwatchTime (#StopwatchTime#+60)>359999?#StopwatchTime#:(#StopwatchTime#+60)][!Update]
MouseScrollUpAction=[!setVariable StopwatchTime (#StopwatchTime#-60)<0?#StopwatchTime#:(#StopwatchTime#-60)][!Update]
[MeterS]
SolidColor=127,127,127,255
FontSize=30
NumOfDecimals=2
DynamicVariables=1
Meter=String
X=R
Y=r
MeasureName=CalcStopwatchSeconds
Text=:%1
MouseScrollDownAction=[!setVariable StopwatchTime (#StopwatchTime#+1)>359999?#StopwatchTime#:(#StopwatchTime#+1)][!Update]
MouseScrollUpAction=[!setVariable StopwatchTime (#StopwatchTime#-1)<0?#StopwatchTime#:(#StopwatchTime#-1)][!Update]
with the scrollwheel i can adjust time, then click on the "mainmeter" to start. on zero he should stop.