I'm going gray soon...
I have made a small piece that calculates the time between a start time and the present time.
This works (it's probably not the best solution, but it works).
My problem occurs when the skin restarts. Then I lose correct value in "mStartingTime1".
I want to be able to save the value in "mStartingTime1" to a file that is loaded on startup to a variable. This variable replaces Measure.
Am I thinking crazy?
How should I attack this problem for me?
Grateful for any help.
\HLM
(Translated with Google translate from Swedish)
Code: Select all
[Rainmeter]
DynamicWindowSize=1
Update=1000
AccurateText=1
[Metadata]
Name=Resist the urge to smoke
Author=HLMGBG
Version=1.0
[Variables]
hImg1=#@#Cig.png
[MeterMainBOXborder]
Meter=Image
SolidColor=222,222,222
X=0
Y=0
W=260
H=200
[MeterVer]
Meter=String
Y=2
X=2
Text=1.0
[MeterTitel]
Meter=STRING
StringAlign=CENTER
FontColor=140,140,150
FontFace=Courier New
FontSize=13
FontWeight=700
AntiAlias=1
Y=5
X=130
W=115
H=18
Text="Elapsed time since:"
;///////////////////// MEASURES //////////////////
[mSkinStarted]
Measure=Time
Format=%F %X
UpdateDivider=-1
[mTimeNow]
Measure=Time
[mFullTimeNow]
Measure=Time
Format=%F %X
[mStartingTime1]
Measure=Time
UpdateDivider=-1
[mStartingTime1b]
Measure=Time
Format=%F %X
UpdateDivider=-1
[mDiff1]
Measure=Time
TimeStamp=([mTimeNow:]-[mStartingTime1:])
DynamicVariables=1
UpdateDivider=1
[mDiffHours1]
Measure=Time
TimeStamp=([mTimeNow:]-[mStartingTime1:])
DynamicVariables=1
Format=%H
UpdateDivider=1
[mDiffMinutes1]
Measure=Time
TimeStamp=([mTimeNow:]-[mStartingTime1:])
DynamicVariables=1
Format=%M
UpdateDivider=1
[mDays1]
Measure=Uptime
Format=%4!i! d
SecondsValue=([mTimeNow:TimeStamp]-[mStartingTime1:TimeStamp])
DynamicVariables=1
;////////////////////// METERS ////////////////
[MeterImg1]
Meter=Image
ImageName=#hImg1#
ToolTipType=0
ToolTipText=Press here when you take a smoke
Y=30
X=5
W=50
H=50
LeftMouseUpAction=[!UpdateMeasure mStartingTime1] [!UpdateMeasure mStartingTime1b]
;------ temp -------
[MeterDiff]
Meter=String
MeasureName=mDiff1
SolidColor=255,255,255
FontFace=Courier New
StringAlign=Right
Y=90
X=255
W=250
Text=Elapsed: %1
;---------- \temp ----------
[MeterDiffFull1]
Meter=String
MeasureName=mDays1
MeasureName2=mDiffHours1
MeasureName3=mDiffMinutes1
SolidColor=255,255,255
FontFace=Courier New
StringAlign=Right
Y=50
X=255
W=180
Text=%1ays %2 hours %3 min
[MeterLastChange1]
Meter=String
MeasureName=mStartingTime1b
SolidColor=255,255,255
FontFace=Courier New
StringAlign=Right
Y=110
X=255
W=250
Text=LastChange: %1
[MeterTime Now1]
Meter=String
MeasureName=mFullTimeNow
SolidColor=255,255,255
FontFace=Courier New
StringAlign=Right
Y=130
X=255
W=250
Text=Time Now: %1
[MeterSkinStart]
Meter=String
MeasureName=mSkinStarted
SolidColor=255,255,255
FontFace=Courier New
StringAlign=Right
Y=150
X=255
W=250
Text=Skin Start: %1