I have a sleep log. It starts once a mouse click = then the end on a different mouse click area. The rest is basic math for totaal for a day and the average when 3 days have transpired (averaging less than 3 is kind of donk).
I have been trying set a start time and end time to a variable then writekeyvalue to the inc file.
The problem is after a refresh - to simulate the skin being loaded or unloaded - the time just sets itself to the current time again, ruining the intended variable state.
Code: Select all
[StaticDay0]
Meter=String
StringAlign=RightCenter
X=154
Y=106
AntiAlias=1
FontFace=#TallFont#
FontSize=27
FontColor=#ShortBars#
StringCase=Upper
LeftMouseUpAction=[!ToggleMeterGroup MON][!SetVariable MON "1"][!WriteKeyValue Variables MON "[#MON]" "#@#Utopia.inc"][!Update]
DynamicVariables=1
Text=MON
Hidden=#awake#
--------------------------------------- MONDAY START --------------------------
[MeasureTimeHour0]
Measure=Time
Format=%H
Paused=#sZeroPause#
DynamicVariables=1
[MeasureTimeMinute0]
Measure=Time
Format=%M
Paused=#sZeroPause#
DynamicVariables=1
[MeasureTimeSeconds0]
Measure=Time
Format=%S
Paused=#sZeroPause#
DynamicVariables=1
[Time0]
Meter=String
MeasureName=MeasureTimeHour0
MeasureName2=MeasureTimeMinute0
MeasureName3=MeasureTimeSeconds0
StringAlign=LeftCenter
X=164
Y=106
AntiAlias=1
FontFace=#TallFont#
FontSize=27
FontColor=#sZeroColor#
StringEffect=Border
FontEffectColor=0,0,0,255
StringCase=Upper
Text=%1:%2:%3
Group=mon
DynamicVariables=1
Hidden=1
[MeasureStart0]
Measure=Calc
IfCondition=(#sZero# = 1)
IfTrueAction=[!SetVariable sZeroColor #StartColor#][!WriteKeyValue Variables sZeroColor "[#sZeroColor]" "#@#Utopia.inc"][!Update]
IfFalseAction=[!SetVariable sZeroColor #CustomOpaque#][!WriteKeyValue Variables sZeroColor "[#sZeroColor]" "#@#Utopia.inc"][!Update]
DynamicVariables=1
[MeterClick0]
Meter=Image
SolidColor=0,0,0,1
X=164
Y=83
W=65
H=40
LeftMouseUpAction=[!SetVariable sZeroPause "((#sZeroPause#+1)%2)"][!WriteKeyValue Variables sZeroPause "[#sZeroPause]" "#@#Utopia.inc"][!SetVariable sZero "((#sZero#+1)%2)"][!WriteKeyValue Variables sZero "[#sZero]" "#@#Utopia.inc"][!Update]
Group=mon
DynamicVariables=1
Hidden=1
-------------------------------------- FINISH MONDAY --------------------------
[MeasureTimeHourF0]
Measure=Time
Format=%H
Paused=#fZeroPause#
DynamicVariables=1
[MeasureTimeMinuteF0]
Measure=Time
Format=%M
Paused=#fZeroPause#
DynamicVariables=1
[MeasureTimeSecondsF0]
Measure=Time
Format=%S
Paused=#fZeroPause#
DynamicVariables=1
[Time0f]
Meter=String
MeasureName=MeasureTimeHourF0
MeasureName2=MeasureTimeMinuteF0
MeasureName3=MeasureTimeSecondsF0
StringAlign=LeftCenter
X=274
Y=106
AntiAlias=1
FontFace=#TallFont#
FontSize=27
FontColor=#fZeroColor#
StringEffect=Border
FontEffectColor=0,0,0,255
StringCase=Upper
Text=%1:%2:%3
Group=mon
DynamicVariables=1
Hidden=1
[MeterClickw]
Meter=Image
SolidColor=0,0,0,1
X=275
Y=82
W=65
H=40
LeftMouseUpAction=[!SetVariable fZeroPause "((#fZeroPause#+1)%2)"][!WriteKeyValue Variables fZeroPause "[#fZeroPause]" "#@#Utopia.inc"][!SetVariable fZero "((#fZero#+1)%2)"][!WriteKeyValue Variables fZero "[#fZero]" "#@#Utopia.inc"][!Update]
Group=mon
DynamicVariables=1
Hidden=1
[MeasureFinishColorf1]
Measure=Calc
IfCondition=(#sZeroPause# = 0) && (#fZeroPause# = 1)
IfTrueAction=[!SetVariable fZeroColor #CustomOpaque#][!WriteKeyValue Variables fZeroColor "[#fZeroColor]" "#@#Utopia.inc"][!SetVariable fZero "0"][!WriteKeyValue Variables fZero "[#fZero]" "#@#Utopia.inc"][!SetVariable fZeroPause "0"][!WriteKeyValue Variables fZeroPause "[#fZeroPause]" "#@#Utopia.inc"][!Update]
IfCondition2=(#sZeroPause# = 1) && (#fZeroPause# = 1)
IfTrueAction2=[!SetVariable fZeroColor #FinishColor#][!WriteKeyValue Variables fZeroColor "[#fZeroColor]" "#@#Utopia.inc"][!SetVariable fZero "1"][!WriteKeyValue Variables fZero "[#fZero]" "#@#Utopia.inc"][!SetVariable fZeroPause "1"][!WriteKeyValue Variables fZeroPause "[#fZeroPause]" "#@#Utopia.inc"][!Update]
IfFalseAction2=[!SetVariable fZeroColor #CustomOpaque#][!WriteKeyValue Variables fZeroColor "[#fZeroColor]" "#@#Utopia.inc"][!Update]
DynamicVariables=1
Code: Select all
[Variables]
Mon=0
sZeroPause=0
fZeroPause=0
etc..
Thanks,
CC