It is currently March 28th, 2024, 9:43 am

Help me create a "different" clock

Get help with creating, editing & fixing problems with skins
h3103
Posts: 12
Joined: January 20th, 2018, 10:00 am

Re: Help me create a "different" clock

Post by h3103 »

balala wrote:Here is another example. It uses many elements of jsmorley's code:

Code: Select all

[Rainmeter]
Update=1000
LeftMouseUpAction=[!SetOption MeasureNow UpdateDivider "1"][!UpdateMeasure "MeasureNow"][!UpdateMeasure "MeasureThen"]
BackgroundMode=2
SolidColor=0,0,0,1

[Variables]
Per=9000

[MeasureThen]
Measure=Time
UpdateDivider=-1

[MeasureNow]
Measure=Time
UpdateDivider=-1

[MeasureDiff]
Measure=Calc
Formula=(( [MeasureNow:timestamp] - [MeasureThen:timestamp] ) % #Per# )
MinValue=0
MaxValue=#Per#
DynamicVariables=1

[MeterClockFace]
Meter=Image
ImageName=#@#Images\ClockFace.png
SolidColor=0,0,0,1
W=110
H=116

[MeterSecondsHand]
Meter=ROUNDLINE
MeasureName=MeasureDiff
X=0
Y=0
W=110
H=116
LineLength=52
LineColor=247,220,129,255
LineWidth=2
AntiAlias=1
StartAngle=4.7124
RotationAngle=6.2832
You can easily modify the value of the Per variable, to get the needed period. Just take care that it's expressed into seconds.
Obviously you can replace the image of the clock face, through the ImageName option of the [MeterClockFace] meter. Just use the correct image name and path.
With this code you have to click to the skin to make it to start it counting. If you want it to start automatically when the skin is loaded (refreshed), just remove the LeftMouseUpAction option from the [Rainmeter] section, along with the UpdateDivider option of the [MeasureNow] measure.
thanks a lot for this... It currently does ( as far as i can can see) what i want it to do... can you tell if the clock will reset or what happenes to it when i restart my pc? will it "still be running" restart from where it stopped or restart from 0?
User avatar
balala
Rainmeter Sage
Posts: 16109
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Help me create a "different" clock

Post by balala »

h3103 wrote:thanks a lot for this... It currently does ( as far as i can can see) what i want it to do... can you tell if the clock will reset or what happenes to it when i restart my pc? will it "still be running" restart from where it stopped or restart from 0?
If you leaved the code as I posted it above, you'll have to click again to start it. If you've modified it to make it to start automatically when the skin is loaded / refreshed, obviously it'll start counting. But from 0, it won't continue the previous "session".
How should it behave? Is this ok, or you'd like to modify it somehow?
h3103
Posts: 12
Joined: January 20th, 2018, 10:00 am

Re: Help me create a "different" clock

Post by h3103 »

balala wrote:If you leaved the code as I posted it above, you'll have to click again to start it. If you've modified it to make it to start automatically when the skin is loaded / refreshed, obviously it'll start counting. But from 0, it won't continue the previous "session".
How should it behave? Is this ok, or you'd like to modify it somehow?
i changed it up so it starts automaticly upon loading... it would have been really nice if the clock could have been to fit the time cycle upon starting my pc. If you no a wae to do this i would be really nice if you could try and change it up to that but otherwise this was also a lot of help i got and a lot of time i stole. So thanks for all of that.
User avatar
balala
Rainmeter Sage
Posts: 16109
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Help me create a "different" clock

Post by balala »

Again, I'm sorry, but I don't really understand what you mean by
h3103 wrote:it would have been really nice if the clock could have been to fit the time cycle upon starting my pc.
You mean you'd like it to continue where it was, when the computer was shut down?
Sorry again for my lack...
h3103
Posts: 12
Joined: January 20th, 2018, 10:00 am

Re: Help me create a "different" clock

Post by h3103 »

balala wrote:Again, I'm sorry, but I don't really understand what you mean by

You mean you'd like it to continue where it was, when the computer was shut down?
Sorry again for my lack...
i'd like it to be connected to the real time so that the result is as if it ran while my pc was shutdown. so if i turn off my pc for For example an hour and turn it back on the clock should have advanced by 40%
User avatar
balala
Rainmeter Sage
Posts: 16109
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Help me create a "different" clock

Post by balala »

h3103 wrote:i'd like it to be connected to the real time so that the result is as if it ran while my pc was shutdown. so if i turn off my pc for For example an hour and turn it back on the clock should have advanced by 40%
Here is a bit modified code. Try it please:

Code: Select all

[Rainmeter]
Update=1000
LeftMouseDoubleClickAction=[!UpdateMeasure "MeasureThen"]
BackgroundMode=2
SolidColor=0,0,0,1

[Variables]
Per=9000
Time=

[MeasureThen]
Measure=Time
UpdateDivider=-1
OnChangeAction=[!WriteKeyValue Variables Time "[MeasureThen:timestamp]"][!SetVariable Time "[MeasureThen:timestamp]"]
DynamicVariables=1

[MeasureNow]
Measure=Time

[MeasureDiff]
Measure=Calc
Formula=(( [MeasureNow:timestamp] - #Time# ) % #Per# )
MinValue=0
MaxValue=#Per#
DynamicVariables=1

[MeterClockFace]
Meter=Image
ImageName=#@#Images\ClockFace.png
SolidColor=0,0,0,1
W=110
H=116

[MeterSecondsHand]
Meter=ROUNDLINE
MeasureName=MeasureDiff
X=0
Y=0
W=110
H=116
LineLength=52
LineColor=247,220,129,255
LineWidth=2
AntiAlias=1
StartAngle=4.7124
RotationAngle=6.2832
When you first load the skin, it won't work. With a double click, it starts and continuously counts, even if you restart the computer / unload, then load the skin. You can restart it from 0 with another double click.
Obviously you can again modify the Per variable, as described before.
Does this fit your needs?
h3103
Posts: 12
Joined: January 20th, 2018, 10:00 am

Re: Help me create a "different" clock

Post by h3103 »

balala wrote:Here is a bit modified code. Try it please:

Code: Select all

[Rainmeter]
Update=1000
LeftMouseDoubleClickAction=[!UpdateMeasure "MeasureThen"]
BackgroundMode=2
SolidColor=0,0,0,1

[Variables]
Per=9000
Time=

[MeasureThen]
Measure=Time
UpdateDivider=-1
OnChangeAction=[!WriteKeyValue Variables Time "[MeasureThen:timestamp]"][!SetVariable Time "[MeasureThen:timestamp]"]
DynamicVariables=1

[MeasureNow]
Measure=Time

[MeasureDiff]
Measure=Calc
Formula=(( [MeasureNow:timestamp] - #Time# ) % #Per# )
MinValue=0
MaxValue=#Per#
DynamicVariables=1

[MeterClockFace]
Meter=Image
ImageName=#@#Images\ClockFace.png
SolidColor=0,0,0,1
W=110
H=116

[MeterSecondsHand]
Meter=ROUNDLINE
MeasureName=MeasureDiff
X=0
Y=0
W=110
H=116
LineLength=52
LineColor=247,220,129,255
LineWidth=2
AntiAlias=1
StartAngle=4.7124
RotationAngle=6.2832
When you first load the skin, it won't work. With a double click, it starts and continuously counts, even if you restart the computer / unload, then load the skin. You can restart it from 0 with another double click.
Obviously you can again modify the Per variable, as described before.
Does this fit your needs?
Even tho i dont quite understand what you did it works the intended way. I thank you a thousand times
User avatar
balala
Rainmeter Sage
Posts: 16109
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Help me create a "different" clock

Post by balala »

You're welcome. Test it a bit deeper and if you have any question, please let me know.
Post Reply