It is currently April 23rd, 2024, 11:07 am

Help me create a "different" clock

Get help with creating, editing & fixing problems with skins
User avatar
jsmorley
Developer
Posts: 22629
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Help me create a "different" clock

Post by jsmorley »

eclectic-tech wrote:Yea, you are right! I was using the timestamp all the time and thought my formulas were doing something...

Thanks for setting me straight AGAIN! :D
Right. A Time measure with NO Format option will return HH:MM:SS as the string value, and a timestamp as the number value. However, be careful, as ANY Format option on the measure will cause the measure to return a number value that isn't the timestamp. The best way to use the timestamp value of a Time measure is to always use it as [MeasureName:timestamp]. That will force it to always use the timestamp value, no matter what the Format option is or isn't.
h3103
Posts: 12
Joined: January 20th, 2018, 10:00 am

Re: Help me create a "different" clock

Post by h3103 »

jsmorley wrote:

Code: Select all

[Rainmeter]
Update=1000
AccurateText=1
DynamicWindowSize=1

[Variables]
Target=1/20/2017 12:00:00

[MeasureTarget]
Measure=Time
TimeStamp=#Target#
TimeStampFormat=%#m/%#d/%Y %#H:%M:%S
UpdateDivider=-1

[MeasureNow]
Measure=Time

[MeasureDiff]
Measure=Calc
Formula=[MeasureNow:timestamp] - [MeasureTarget:timestamp]
DynamicVariables=1

[MeasureFormatSeconds]
Measure=Uptime
SecondsValue=[MeasureDiff]
Format="%4!i!d %3!i!h %2!i!m %1!i!s"
DynamicVariables=1

[MeterFormatDifference]
Meter=String
MeasureName=MeasureFormatSeconds
FontSize=11
FontWeight=400
FontColor=255,255,255,255
SolidColor=47,47,47,255
Padding=5,5,5,5
AntiAlias=1
1.png

https://docs.rainmeter.net/manual/measures/time/#TimeStamp
https://docs.rainmeter.net/manual/measures/time/#TimeStampFormat

https://docs.rainmeter.net/manual/measures/uptime/#SecondsValue

That will survive a reboot...
Is it possible to display this time difference on a round clock with the scale of 150 minutes?
User avatar
jsmorley
Developer
Posts: 22629
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Help me create a "different" clock

Post by jsmorley »

h3103 wrote:Is it possible to display this time difference on a round clock with the scale of 150 minutes?
I will leave that to balala and the others, I have not been following this whole "alternative clock" discussion, I just wanted to weigh in on doing "time math" properly.
User avatar
balala
Rainmeter Sage
Posts: 16162
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Help me create a "different" clock

Post by balala »

jsmorley wrote:I will leave that to balala and the others,
Thanks jsmorley.
h3103, what you mean by
h3103 wrote:with the scale of 150 minutes?
?
h3103
Posts: 12
Joined: January 20th, 2018, 10:00 am

Re: Help me create a "different" clock

Post by h3103 »

What i mean by that is that the arm(/hand/pointerthingy/whatever it is called) of the clock would need 150mins (or 2 1/2 h(or even the 5h i mentioned are okay to me)to turn once. If that time conneted to a fixpoint could be displayed in portions of 150mins it would be perfect to me.

Basicly (to explain why i am having such a weird request and make you understand better what i am asking for) im playing an online game with a day -nightcycle of 150mins (100 mins day and 50 night) and the nighttime is way more important to me. Since there is no actual display anywhere in the game or in the Internet, what the current imgame time is and it is shifting from day to day i hoped i be able to create myself a little skin that is able to show me what time it is there. But it was actually way more difficult than i anticipated and i Searched for help here.
User avatar
balala
Rainmeter Sage
Posts: 16162
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Help me create a "different" clock

Post by balala »

h3103 wrote:Basicly (to explain why i am having such a weird request and make you understand better what i am asking for) im playing an online game with a day -nightcycle of 150mins (100 mins day and 50 night) and the nighttime is way more important to me. Since there is no actual display anywhere in the game or in the Internet, what the current imgame time is and it is shifting from day to day i hoped i be able to create myself a little skin that is able to show me what time it is there. But it was actually way more difficult than i anticipated and i Searched for help here.
Ok, but in this case why once started, it never should stop?
h3103
Posts: 12
Joined: January 20th, 2018, 10:00 am

Re: Help me create a "different" clock

Post by h3103 »

balala wrote:Ok, but in this case why once started, it never should stop?
Because the pattern of the day-night cycle never changes and if i have to get in the game first and wait for day/night to End to Start my clock it would kind of ruin the purpose of this application.
User avatar
balala
Rainmeter Sage
Posts: 16162
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Help me create a "different" clock

Post by balala »

One more question: what you mean by
h3103 wrote:If that time conneted to a fixpoint could be displayed in portions of 150mins
?
Sorry, my English is not good enough...
h3103
Posts: 12
Joined: January 20th, 2018, 10:00 am

Re: Help me create a "different" clock

Post by h3103 »

balala wrote:One more question: what you mean by
?
Sorry, my English is not good enough...
and here i thought my english was the problem...
i asked if the time jsmorley created and displays as a string can be displayed as a clock of 150mins/300mins turntime.
So that you have a clock that properly displys the day/nightcycle without manually starting it
Image
You do not have the required permissions to view the files attached to this post.
User avatar
balala
Rainmeter Sage
Posts: 16162
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Help me create a "different" clock

Post by balala »

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.