It is currently April 27th, 2024, 10:08 pm

How can i edit a clock like this?

Get help with creating, editing & fixing problems with skins
adre
Posts: 3
Joined: January 20th, 2017, 4:11 pm

How can i edit a clock like this?

Post by adre »

Hello guys,
I am new here.
I downloaded many clock skins. Most of them have the option to change the time zone. But what i need is something different:

I want an analog clock which i can set the time of it manually and then let it show the time from that time on. Just like we can do in a real world clock. Like: For example, currently if there are 20 time zones and my locale is 07:00 , then it means i can set it to 8:00-9:00-10:00 etc. But i want to manually set it to ,for example, 10:28 now. And it will continue 10:29,10:30 .. just like in the real world.


This might be something easy, i dont know. But I dont have scripting/programming skills. So help is appreciated.

Thanks
User avatar
balala
Rainmeter Sage
Posts: 16182
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: How can i edit a clock like this?

Post by balala »

adre wrote:I want an analog clock which i can set the time of it manually and then let it show the time from that time on. Just like we can do in a real world clock. Like: For example, currently if there are 20 time zones and my locale is 07:00 , then it means i can set it to 8:00-9:00-10:00 etc. But i want to manually set it to ,for example, 10:28 now. And it will continue 10:29,10:30 .. just like in the real world.
Add the following measures to the code of the clock:

Code: Select all

[MeaureToday]
Measure=Time

[MeasureSetTime]
Measure=Time
TimeStamp=([MeaureToday:]+#Interval#)
DynamicVariables=1
Then add to the [Variables] section the Interval variable, which will be the difference between the current time and the shown time, in seconds. Note that this variable can be negative (if you want the clock to show a previous moment than the current one) or positive (I hope you found it out that in this case the clock will show a later moment).
The following step will be to modify the MeasureName option of the Rotator meters (the hands of the clock) to MeasureName=MeasureSetTime.
I took this idea from moshi: https://forum.rainmeter.net/viewtopic.php?p=112717#p112717
Many thanks to him.
If you can't handle all these, please post the code of the skin you'd like to modify.
adre
Posts: 3
Joined: January 20th, 2017, 4:11 pm

Re: How can i edit a clock like this?

Post by adre »

I tried a couple of times but then it just shows 12:00 , not the - or + number i put in it.
This is the script:

Code: Select all

[Rainmeter]
Author=Güntmeister
Update=1000

[MeasureTime]
Measure=Time

[Clock]
Meter=IMAGE
ImageName=face5.png
X=0
Y=0
W=130	
H=130

[Hours]
Meter=Rotator
MeterStyle=Seconds
X=0
Y=0
W=130
H=130
ImageName=hours.png
StartAngle=6.2831853
RotationAngle=6.2831853
ValueReminder=43200
OffsetX=64
OffsetY=65

[Minutes]
Meter=Rotator
MeterStyle=Seconds
X=0
Y=0
W=130
H=130
ImageName=minutes.png
StartAngle=6.2831853
RotationAngle=6.2831853
ValueReminder=3600
OffsetX=64
OffsetY=65

[Seconds]
Meter=Rotator
MeasureName=MeasureTime
X=0
Y=0
W=130
H=130
ImageName=seconds.png
StartAngle=6.2831853
RotationAngle=6.2831853
ValueReminder=60
OffsetX=65
OffsetY=65

[Center]
Meter=Image
ImageName=dot.png
X=1
Y=1
W=130
H=130
Last edited by Brian on January 20th, 2017, 7:50 pm, edited 1 time in total.
Reason: Changed [Snippet] bbcode to [code].
User avatar
balala
Rainmeter Sage
Posts: 16182
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: How can i edit a clock like this?

Post by balala »

adre wrote:I tried a couple of times but then it just shows 12:00 , not the - or + number i put in it.
Add the following sections to your code:

Code: Select all

[Variables]
Interval=1800

[MeaureToday]
Measure=Time

[MeasureSetTime]
Measure=Time
TimeStamp=([MeaureToday:]+#Interval#)
DynamicVariables=1
Here I set the value of the Interval variable to 1800, which means that the clock will be set half hour ahead. Obviously, you can use other values too. Just keep in mind that, as I said in my previous post, positive values will set the clock ahead, negative values will set the clock back and this values are expressed in seconds.
Replace the MeasureName option of the [Seconds] meter with MeasureName=MeasureSetTime.
User avatar
fonpaolo
Moderator
Posts: 1387
Joined: April 11th, 2013, 8:08 pm
Location: Italy

Re: How can i edit a clock like this?

Post by fonpaolo »

I really hope, adre, that the code you've posted is only a part of it...
I see some code is missing in Hours and Minutes meters, just to start.
User avatar
balala
Rainmeter Sage
Posts: 16182
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: How can i edit a clock like this?

Post by balala »

fonpaolo wrote:I really hope, adre, that the code you've posted is only a part of it...
I see some code is missing in Hours and Minutes meters, just to start.
No, it's not! First I also thought this, but finally I figured out that the [Hours] and [Minutes] meters are using the settings of the [Seconds] meter, through the MeterStyle=Seconds option. Yeah, it seems weird, but it's working!
User avatar
fonpaolo
Moderator
Posts: 1387
Joined: April 11th, 2013, 8:08 pm
Location: Italy

Re: How can i edit a clock like this?

Post by fonpaolo »

balala wrote:No, it's not! First I also thought this, but finally I figured out that the [Hours] and [Minutes] meters are using the settings of the [Seconds] meter, through the MeterStyle=Seconds option. Yeah, it seems weird, but it's working!
Well... I always used one measure for hours, one for minutes and one for seconds, if I disable/remove the measure in the meter , it remains as is.
I admit I never thought I can do it in this way, but I use a completely different approach in my Time skin... :???:

The only reason I could think it works, it's because Rainmeter reading the code, if there's a string missing it will find it nearby, so, the only one is in the seconds meter and it uses that.
Maybe I'm wrong (often, in fact...) but if you've more measures and meters, I doubt it will work in the right way or at all...
User avatar
balala
Rainmeter Sage
Posts: 16182
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: How can i edit a clock like this?

Post by balala »

fonpaolo wrote:Well... I always used one measure for hours, one for minutes and one for seconds, if I disable/remove the measure in the meter , it remains as is.
I admit I never thought I can do it in this way, but I use a completely different approach in my Time skin... :???:
Three different Time measures are not needed, I'm using just one single for all three meters. However I also think it's a bit weird approach, but seems it's working.
User avatar
fonpaolo
Moderator
Posts: 1387
Joined: April 11th, 2013, 8:08 pm
Location: Italy

Re: How can i edit a clock like this?

Post by fonpaolo »

Yes, as I said, I edited the post.

I'm using a very different approach in my skins and it will never work unless I rewrite the code.
adre
Posts: 3
Joined: January 20th, 2017, 4:11 pm

Re: How can i edit a clock like this?

Post by adre »

balala wrote:Add the following sections to your code:

Code: Select all

[Variables]
Interval=1800

[MeaureToday]
Measure=Time

[MeasureSetTime]
Measure=Time
TimeStamp=([MeaureToday:]+#Interval#)
DynamicVariables=1
Here I set the value of the Interval variable to 1800, which means that the clock will be set half hour ahead. Obviously, you can use other values too. Just keep in mind that, as I said in my previous post, positive values will set the clock ahead, negative values will set the clock back and this values are expressed in seconds.
Replace the MeasureName option of the [Seconds] meter with MeasureName=MeasureSetTime.
It works! Thank you!