Hi all.
I want to make a meter that counts the hours from a given time period. (I.e. I set the time and it keeps counting. But it should continue after a restart. So not just like an uptime counter, but one that continues from a certain timeperiod).
Anyone know of a meter, or how to make one?
Cheers.
It is currently May 2nd, 2024, 8:56 pm
How to make a simple hour tracker?
-
- Posts: 3
- Joined: May 13th, 2018, 10:30 pm
-
- Posts: 3
- Joined: May 13th, 2018, 10:30 pm
Re: How to make a simple hour tracker?
Any suggestions?
Cheers
Cheers
-
- Rainmeter Sage
- Posts: 5407
- Joined: April 12th, 2012, 9:40 pm
- Location: Cedar Point, Ohio, USA
Re: How to make a simple hour tracker?
The "gotcha" is keeping time even when the skin is unloaded or the computer is turned off...Evil_Hamster wrote:Hi all.
I want to make a meter that counts the hours from a given time period. (I.e. I set the time and it keeps counting. But it should continue after a restart. So not just like an uptime counter, but one that continues from a certain timeperiod).
Anyone know of a meter, or how to make one?
Cheers.
killall-q created a timer that uses a script to achieve this behavior. It may give you an idea on how to go about starting your project: T-Minus Skin
Perhaps one of the lua programmers can supply you with a simpler script that tracks os.time(); not something I want to tackle.
:: My DA Gallery :: Rainmeter DA Gallery :: Rainmeter Workshops :: Rainmeter Documentation :: BBCode Guide ::
-
- Posts: 3
- Joined: May 13th, 2018, 10:30 pm
Re: How to make a simple hour tracker?
Thank you for your help. It is much appreciated.
I will have a look at the "T-Minus".
If anyone per chance has a finished script, I would appreciate it:)
I will have a look at the "T-Minus".
If anyone per chance has a finished script, I would appreciate it:)
-
- Posts: 919
- Joined: January 30th, 2017, 2:01 am
- Location: Greece
Re: How to make a simple hour tracker?
If I understood correctly, this might help:Evil_Hamster wrote:Thank you for your help. It is much appreciated.
I will have a look at the "T-Minus".
If anyone per chance has a finished script, I would appreciate it:)
Code: Select all
[Rainmeter]
Update=1000
OnUpdateAction=[!SetVariable Time [MeasurePace]][!UpdateMeter Meter][!Redraw][!WriteKeyValue Variables StoppedAt [MeasurePace]]
OnRefreshAction=[!SetVariable Time #StoppedAt#][!Update]
MouseScrollDownAction=[!Refresh]
[Variables]
Time=0
StoppedAt=0
[MeasurePace]
Measure=Calc
Formula=(#Time#+1)
DynamicVariables=1
[Meter]
Meter=String
Text=#Time#
FontSize=30
FontColor=255,255,255
DynamicVariables=1
-
- Rainmeter Sage
- Posts: 5407
- Joined: April 12th, 2012, 9:40 pm
- Location: Cedar Point, Ohio, USA
Re: How to make a simple hour tracker?
Using the UPDATE rate of the skin to track time is going to be very inaccurate! If any skin causes a delay, the actual "time" between updates is NOT 1 SECOND; over time, this is going to give erroneous results.kyriakos876 wrote:If I understood correctly, this might help:
This is a counter for 1 second, if you want to display hours, you can simply add another meter and one more measure for the hours or whatever you want. I would write the code but I think it's obvious how to do it from here.Code: Select all
[Rainmeter] Update=1000 OnUpdateAction=[!SetVariable Time [MeasurePace]][!UpdateMeter Meter][!Redraw][!WriteKeyValue Variables StoppedAt [MeasurePace]] OnRefreshAction=[!SetVariable Time #StoppedAt#][!Update] MouseScrollDownAction=[!Refresh] [Variables] Time=0 StoppedAt=0 [MeasurePace] Measure=Calc Formula=(#Time#+1) DynamicVariables=1 [Meter] Meter=String Text=#Time# FontSize=30 FontColor=255,255,255 DynamicVariables=1
It would be much better to use a Time Measure that will give you the actual number of seconds, no matter what Rainmeter is doing.
However, the OP wanted something that would continue to count even with a restart. The T-Minus skin will start counting (of course in milliseconds) and continue to count time until it is told to stop. It will do this if the skin is refreshed, even if the skin is unloaded, and even if the computer is shut down...
I think using T-Minus code is his best option. He can use that skin to keep count and display the hours any way he wants.
:: My DA Gallery :: Rainmeter DA Gallery :: Rainmeter Workshops :: Rainmeter Documentation :: BBCode Guide ::
-
- Posts: 919
- Joined: January 30th, 2017, 2:01 am
- Location: Greece
Re: How to make a simple hour tracker?
I know this is going to inaccurate. You could make it easily accurate by using the system's time instead of the measure I used but I was lazy enough to share this way. I was going to add that it will only count as long as the skin is loaded and will delay as Rainmeter takes more time to load than windows do. Honestly, I thought this was obvious enough. Also, it always depends on the use OP wants to do. If he wants for example to count how much time is Rainmeter running, this would work.eclectic-tech wrote:Using the UPDATE rate of the skin to track time is going to be very inaccurate! If any skin causes a delay, the actual "time" between updates is NOT 1 SECOND; over time, this is going to give erroneous results.
It would be much better to use a Time Measure that will give you the actual number of seconds, no matter what Rainmeter is doing.
However, the OP wanted something that would continue to count even with a restart. The T-Minus skin will start counting (of course in milliseconds) and continue to count time until it is told to stop. It will do this if the skin is refreshed, even if the skin is unloaded, and even if the computer is shut down...
I think using T-Minus code is his best option. He can use that skin to keep count and display the hours any way he wants.