the1ulike wrote: ↑June 25th, 2020, 4:37 pm
Could you please make it clear what are the variables we need for your offline approach?
- I suppose you know what Latitude and Longitude are.
- TimeZone is the desired time zone. Use TimeZone=local to use the local time zone.
- 12H, LeadingZeros and AMPM are some generic variables which are used by the Sun.lua script file. They have no importance from the point of view of the skin, but are needed into the script file, so leave them there unchanged.
- DuskTime is the amount of time which the orange faces are visible when the gradual changes are going on.
- AlphaN and AlphaD are two variables used by the operation of gradual change of the faces. These are needed into the code and are dynamically changing when the transitions are going on.
Note that I just figured out that the TimeZone variable, in this form is not working properly, so I had to rename this variable to TimeZ. Please replace the code with the following one:
Code: Select all
[Rainmeter]
SkinWidth=600
[Variables]
Latitude=51.5074
Longitude=0.1278
TimeZ=local
12H=0
DuskTime=60
LeadingZeros=0
AMPM=1
AlphaN=0
AlphaD=0
[ClockFaceStyle]
X=0
Y=0
W=220
H=250
PreserveAspectRatio=1
DynamicVariables=1
[StringStyle]
X=111
Hidden=1
StringStyle=Bold
StringEffect=Border
AntiAlias=1
[RoundlineStyle]
X=0
Y=20
W=220
H=220
AntiAlias=1
StartAngle=4.7124
RotationAngle=6.2832
Hidden=1
[MeasureLuaScriptSun]
Measure=SCRIPT
ScriptFile=#@#Sun.lua
;[MeasureName]
;Measure=Plugin
;Plugin=Plugins\WebParser.dll
;UpdateRate=600
;Url="http://time.yandex.com/sync.json?lang=en&geo=#Location#"
;Debug=1
;RegExp="(?siU).*"name":"(.*)".*"offset":(.*),"offsetString":"(.*)".*,"isNight":(.*),"
;StringIndex=1
;DecodeCharacterReference=1
;DynamicVariables=1
; This returns an offset number for the defined city that tells you the current time UTC+14400000
;[MeasureOffset]
;Measure=Plugin
;Plugin=Plugins\WebParser.dll
;Url=[MeasureName]
;StringIndex=2
;Substitute="":"0"
;[MeasureTimeZone]
;Measure=Plugin
;Plugin=Plugins\WebParser.dll
;Url=[MeasureName]
;StringIndex=3
;Substitute="UTC":""
;[MeasureIsNight]
;Measure=Plugin
;Plugin=Plugins\WebParser.dll
;Url=[MeasureName]
;StringIndex=4
;Substitute="true":"Night","false":"Day"
;IfMatch=(?i)Night
;IfMatchAction=[!ShowMeterGroup Night][!HideMeterGroup Day][!ShowMeter MeterSecondsHand][!UpdateMeter *][!Redraw]
;IfNotMatchAction=[!HideMeterGroup Night][!ShowMeterGroup Day][!ShowMeter MeterSecondsHand][!UpdateMeter *][!Redraw]
;IfConditionMode=1
;DynamicVariables=1
; Converts the offset value returned by the webparser to a timezone to determine the time at the defined location
; This is used as the source for the other time related values; year, month, day, etc.
[MeasureHour]
Measure=Time
Format=%#H
TimeZone=#TimeZ#
[MeasureMin]
Measure=Time
Format=%#M
TimeZone=#TimeZ#
[MeasureSec]
Measure=Time
Format=%#S
TimeZone=#TimeZ#
[MeasureDaySecs]
Measure=Calc
Formula=( 3600 * MeasureHour + 60 * MeasureMin + MeasureSec )
IfCondition=(#CURRENTSECTION#<#TimeSR#-#DuskTime#)
IfTrueAction=[!SetVariable AlphaN "255"][!SetVariable AlphaD "0"][!SetOption #CURRENTSECTION# IfConditionMode "0"][!HideMeterGroup "ClockFaceD"][!ShowMeterGroup "ClockFaceN"][!UpdateMeterGroup "ClockFaceN"][!ShowMeterGroup "Night"][!HideMeterGroup "Day"][!ShowMeter MeterSecondsHand][!UpdateMeasure "#CURRENTSECTION#"][!Redraw]
IfCondition2=((#CURRENTSECTION#>#TimeSR#-#DuskTime#)&&(#CURRENTSECTION#<#TimeSR#)&&(#CURRENTSECTION#<#TimeSS#))
IfTrueAction2=[!SetVariable AlphaN "(Clamp((255*((#TimeSR#-[#CURRENTSECTION#])/#DuskTime#)),0,255))"][!SetVariable AlphaD "0"][!SetOption #CURRENTSECTION# IfConditionMode "1"][!HideMeterGroup "ClockFaceD"][!ShowMeterGroup "ClockFaceN"][!UpdateMeterGroup "ClockFaceN"][!ShowMeterGroup "Night"][!HideMeterGroup "Day"][!ShowMeter MeterSecondsHand][!Redraw]
IfCondition3=((#CURRENTSECTION#>#TimeSR#)&&(#CURRENTSECTION#<(#TimeSR#+#DuskTime#)&&(#CURRENTSECTION#<#TimeSS#)))
IfTrueAction3=[!SetVariable AlphaD "(Clamp((255*(([#CURRENTSECTION#]-#TimeSR#)/#DuskTime#)),0,255))"][!SetVariable AlphaN "0"][!SetOption #CURRENTSECTION# IfConditionMode "1"][!HideMeterGroup "ClockFaceN"][!ShowMeterGroup "ClockFaceD"][!UpdateMeterGroup "ClockFaceD"][!HideMeterGroup "Night"][!ShowMeterGroup "Day"][!ShowMeter MeterSecondsHand][!Redraw]
IfCondition4=((#CURRENTSECTION#>#TimeSR#+#DuskTime#)&&(#CURRENTSECTION#<#TimeSS#-#DuskTime#))
IfTrueAction4=[!SetVariable AlphaD "255"][!SetVariable AlphaN "0"][!SetOption #CURRENTSECTION# IfConditionMode "0"][!HideMeterGroup "ClockFaceN"][!ShowMeterGroup "ClockFaceD"][!UpdateMeterGroup "ClockFaceD"][!HideMeterGroup "Night"][!ShowMeterGroup "Day"][!UpdateMeasure "#CURRENTSECTION#"][!ShowMeter MeterSecondsHand][!Redraw]
IfCondition5=((#CURRENTSECTION#>#TimeSS#-#DuskTime#)&&(#CURRENTSECTION#<#TimeSS#)&&(#CURRENTSECTION#>#TimeSR#))
IfTrueAction5=[!SetVariable AlphaD "(Clamp((255*((#TimeSS#-[#CURRENTSECTION#])/#DuskTime#)),0,255))"][!SetVariable AlphaN "0"][!SetOption #CURRENTSECTION# IfConditionMode "1"][!HideMeterGroup "ClockFaceN"][!ShowMeterGroup "ClockFaceD"][!UpdateMeterGroup "ClockFaceD"][!HideMeterGroup "Night"][!ShowMeterGroup "Day"][!ShowMeter MeterSecondsHand][!Redraw]
IfCondition6=((#CURRENTSECTION#>#TimeSS#)&&(#CURRENTSECTION#<#TimeSS#+#DuskTime#)&&(#CURRENTSECTION#>#TimeSR#))
IfTrueAction6=[!SetVariable AlphaN "(Clamp((255*(([#CURRENTSECTION#]-#TimeSS#)/#DuskTime#)),0,255))"][!SetVariable AlphaD "0"][!SetOption #CURRENTSECTION# IfConditionMode "1"][!HideMeterGroup "ClockFaceD"][!ShowMeterGroup "ClockFaceN"][!UpdateMeterGroup "ClockFaceN"][!ShowMeterGroup "Night"][!HideMeterGroup "Day"][!ShowMeter MeterSecondsHand][!Redraw]
IfCondition7=(#CURRENTSECTION#>#TimeSS#+#DuskTime#)
IfTrueAction7=[!SetVariable AlphaN "255"][!SetVariable AlphaD "0"][!SetOption #CURRENTSECTION# IfConditionMode "0"][!HideMeterGroup "ClockFaceD"][!ShowMeterGroup "ClockFaceN"][!UpdateMeterGroup "ClockFaceN"][!ShowMeterGroup "Night"][!HideMeterGroup "Day"][!ShowMeter MeterSecondsHand][!Redraw]
DynamicVariables=1
[MeasureTime]
Measure=Time
TimeZone=#TimeZ#
DynamicVariables=1
[MeasureTime2]
Measure=Time
TimeZone=#TimeZ#
DynamicVariables=1
Format=%p
[MeasureYear]
Measure=Time
TimeStamp=[MeasureTime:]
Format=%Y
DynamicVariables=1
[MeasureSeconds]
Measure=Time
TimeStamp=[MeasureTime:]
Format=%S
DynamicVariables=1
[MeasureMonth]
Measure=Time
TimeStamp=[MeasureTime:]
Format=%d %b
DynamicVariables=1
[MeasureDay]
Measure=Time
Format=%A
TimeStamp=[MeasureTime:]
DynamicVariables=1
;**********************************************************************************
; METERS
;**********************************************************************************
[MeterClockFaceN]
Meter=Image
MeterStyle=ClockFaceStyle
ImageName=#@#Clock\N.png
ImageAlpha=#AlphaN#
Group=ClockFaceN
[MeterClockFaceN1]
Meter=Image
MeterStyle=ClockFaceStyle
ImageName=#@#Clock\N1.png
ImageAlpha=(255-#AlphaN#)
Group=ClockFaceN
[MeterClockFaceD]
Meter=Image
MeterStyle=ClockFaceStyle
ImageName=#@#Clock\D.png
ImageAlpha=#AlphaD#
Group=ClockFaceD
[MeterClockFaceD1]
Meter=Image
MeterStyle=ClockFaceStyle
ImageName=#@#Clock\D1.png
ImageAlpha=(255-#AlphaD#)
Group=ClockFaceD
;**********************************************************************************
[MeterDigitalTimeN]
Group=Night
Meter=String
MeterStyle=StringStyle
FontColor=250,250,250
FontEffectColor=10,10,10
MeasureName=MeasureTime2
StringAlign=CenterCenter
Y=218
FontSize=11
Text=%1
[MeterDigitalTime]
Group=Day
Meter=String
MeterStyle=StringStyle
FontColor=10,10,10
FontEffectColor=250,250,250
MeasureName=MeasureTime2
StringAlign=CenterCenter
Y=218
FontSize=11
Text=%1
;**********************************************************************************
[MeterDigitalDayOfWeekN]
Group=Night
Meter=String
MeterStyle=StringStyle
StringCase=Upper
FontFace=Arial
MeasureName=MeasureDay
StringAlign=CenterCenter
Y=150
FontSize=10
FontColor=255,255,255
FontEffectColor=10,10,10
Text=%1
[MeterDigitalDayOfWeek]
Group=Day
Meter=String
MeterStyle=StringStyle
StringCase=Upper
FontFace=Arial
MeasureName=MeasureDay
StringAlign=CenterCenter
Y=150
FontSize=10
FontColor=0,0,0
FontEffectColor=250,250,250
Text=%1
;**********************************************************************************
[MeterDigitalDateN]
Group=Night
Meter=String
MeterStyle=StringStyle
StringCase=Upper
FontColor=255,255,255
FontEffectColor=10,10,10
FontFace=Arial
MeasureName=MeasureMonth
MeasureName2=MeasureYear
StringAlign=CenterCenter
Y=165
FontSize=10
Text=%1 %2
[MeterDigitalDate]
Group=Day
Meter=String
MeterStyle=StringStyle
StringCase=Upper
FontColor=0,0,0
FontEffectColor=250,250,250
FontFace=Arial
MeasureName=MeasureMonth
MeasureName2=MeasureYear
StringAlign=CenterCenter
Y=165
FontSize=10
Text=%1 %2
;**********************************************************************************
[MeterTZDisplayN]
Group=Night
Meter=String
MeterStyle=StringStyle
StringCase=Upper
FontColor=255,255,255
FontEffectColor=10,10,10
MeasureName=MeasureName
StringAlign=CenterCenter
Y=95
FontSize=11
[MeterTZDisplay]
Group=Day
Meter=String
MeterStyle=StringStyle
StringCase=Upper
FontColor=0,0,0
FontEffectColor=250,250,250
MeasureName=MeasureName
StringAlign=CenterCenter
Y=95
FontSize=11
;**********************************************************************************
;************************************Clock Hands *******************************
[MeterHrHandN]
Group=Night
Meter=ROUNDLINE
MeterStyle=RoundlineStyle
MeasureName=MeasureTime
LineLength=40
LineColor=240,240,240
LineWidth=11
ValueRemainder=43200
[MeterHrHand]
Group=Day
Meter=ROUNDLINE
MeterStyle=RoundlineStyle
MeasureName=MeasureTime
LineLength=40
LineColor=0,0,0
LineWidth=11
ValueRemainder=43200
;**********************************************************************************
[MeterHrHand2N]
Group=Night
Meter=ROUNDLINE
MeterStyle=RoundlineStyle
MeasureName=MeasureTime
LineStart=43
LineLength=46
LineColor=240,240,240
LineWidth=9
ValueRemainder=43200
[MeterHrHand2]
Group=Day
Meter=ROUNDLINE
MeterStyle=RoundlineStyle
MeasureName=MeasureTime
LineStart=43
LineLength=46
LineColor=0,0,0
LineWidth=9
ValueRemainder=43200
;**********************************************************************************
[MeterHrHand3N]
Group=Night
Meter=ROUNDLINE
MeterStyle=RoundlineStyle
MeasureName=MeasureTime
LineStart= 49
LineLength=51
lineColor=240,240,240
LineWidth=7
ValueRemainder=43200
[MeterHrHand3]
Group=Day
Meter=ROUNDLINE
MeterStyle=RoundlineStyle
MeasureName=MeasureTime
LineStart= 49
LineLength=51
lineColor=0,0,0
LineWidth=7
ValueRemainder=43200
;**********************************************************************************
[MeterMinHandN]
Group=Night
Meter=ROUNDLINE
MeterStyle=RoundlineStyle
MeasureName=MeasureTime
LineStart=0
LineLength=60
LineColor=240,240,240
LineWidth=9
ValueRemainder=3600
[MeterMinHand]
Group=Day
Meter=ROUNDLINE
MeterStyle=RoundlineStyle
MeasureName=MeasureTime
LineStart=0
LineLength=60
LineColor=0,0,0
LineWidth=9
ValueRemainder=3600
;**********************************************************************************
[MeterMinHand2N]
Group=Night
Meter=ROUNDLINE
MeterStyle=RoundlineStyle
MeasureName=MeasureTime
LineStart=62
LineLength=65
LineColor=240,240,240
LineWidth=7
ValueRemainder=3600
[MeterMinHand2]
Group=Day
Meter=ROUNDLINE
MeterStyle=RoundlineStyle
MeasureName=MeasureTime
LineStart=62
LineLength=65
LineColor=0,0,0
LineWidth=7
ValueRemainder=3600
;**********************************************************************************
[MeterMinHand3N]
Group=Night
Meter=ROUNDLINE
MeterStyle=RoundlineStyle
MeasureName=MeasureTime
LineStart=67
LineLength=69
LineColor=240,240,240
LineWidth=5
ValueRemainder=3600
[MeterMinHand3]
Group=Day
Meter=ROUNDLINE
MeterStyle=RoundlineStyle
MeasureName=MeasureTime
LineStart=67
LineLength=69
LineColor=0,0,0
LineWidth=5
ValueRemainder=3600
;**********************************************************************************
[MeterSecondsHand]
Meter=ROUNDLINE
MeterStyle=RoundlineStyle
MeasureName=MeasureTime
LineLength=95
LineColor=255,0,0,150
LineWidth=2
ValueRemainder=60
;**********************************************************************************
[CenterN]
Group=Night
Hidden=1
Meter=Image
ImageName=#@#Clock\gen_dotN.png
X=0
Y=20
W=220
H=220
[Center]
Group=Day
Hidden=1
Meter=Image
ImageName=#@#Clock\gen_dot.png
X=0
Y=20
W=220
H=220
the1ulike wrote: ↑June 25th, 2020, 4:37 pm
I think the time zone will not be able to get from the city coordinates.
Definitely. In the offline approach, this is not possible. You have to set the time zone manually, but I renamed the appropriate variable to TimeZ (see above).
the1ulike wrote: ↑June 25th, 2020, 4:37 pm
So far, it does not work for me at all.
What do you mean by "not work at all"? What time does the clock show (supposing it does show something)?
the1ulike wrote: ↑June 25th, 2020, 4:37 pm
What is #Valami#
It's a control variable, I had to add to the code while I was working with it. From your point it has no practical purpose. I should had to remove it when I uploaded the skin, but as usually, I forgot. I removed from the above code.