It is currently March 29th, 2024, 2:13 am

Simple countdown timer

Get help with creating, editing & fixing problems with skins
User avatar
death.crafter
Rainmeter Sage
Posts: 1399
Joined: April 24th, 2021, 8:13 pm

Re: Simple countdown timer

Post by death.crafter »

Yincognito wrote: July 26th, 2021, 5:20 pm I guess it's TimerNixie of jsmorley, with the last INI code posted by sl23. At least that's the one I'm looking at, before smoking a cigar... :???:
Then what the OP saying makes sense. And he has to change how the skin works completely to achieve what he wants. If I understood correctly that is.

Morley uses real time and not updates, so pausing or deactivating the measure would not change the time passed. That is, it will directly jump to the total time passed, regardless of other measures. Even if the skin is unloaded and loaded again.
Smoking is injurious to health.
I like the cigar cutters tho :Whistle
from the Realm of Death
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Simple countdown timer

Post by balala »

sl23 wrote: July 26th, 2021, 4:41 pm Thinking maybe I should just use balala's Countdown timer if he doesn't mind me editing it?
No, I don't mind at all. All my codes can be freely used by anyone.
User avatar
Yincognito
Rainmeter Sage
Posts: 7029
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Simple countdown timer

Post by Yincognito »

death.crafter wrote: July 26th, 2021, 6:04 pm Then what the OP saying makes sense. And he has to change how the skin works completely to achieve what he wants. If I understood correctly that is.

Morley uses real time and not updates, so pausing or deactivating the measure would not change the time passed. That is, it will directly jump to the total time passed, regardless of other measures. Even if the skin is unloaded and loaded again.
Smoking is injurious to health.
I like the cigar cutters tho :Whistle
Well, that would be fine from my part. I was never a fan of using Lua or other kind of scripts in cases where native Rainmeter can do the job. Also, I would gladly avoid the mess the code has become... :Whistle

Personally, I would just rewrite the whole thing in plain Rainmeter, but that's just me. If anyone has a better idea, I'm listening. :confused:
EDIT: Or, he could just edit balala's countdown timer and ask him what to do when he breaks it... :sly:
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Simple countdown timer

Post by balala »

sl23 wrote: July 26th, 2021, 4:21 pm Sorry to bump, but could someone please help?

I'm wondering if I'm expecting too much with my expected functions 1 + 2 above. Are they even possible with the inclusion of the Lua script? I've tried everything and don't understand where the problem lies. I think it's likely a formula, but I have no idea where to start with these! :oops:
Even if I read Yincognito's reply I still believe that death.crafter is right when he says that
death.crafter wrote: July 26th, 2021, 5:06 pm A full config including the lua would ave been helpful.
Additionally note that it's not clear when sl23's ask about:
sl23 wrote: July 26th, 2021, 4:21 pm I'm wondering if I'm expecting too much with my expected functions 1 + 2 above.
Which are your the "1 + 2 above" functions, because in your previous reply (not saying that it has been posted two days earlier) there are three points. Now I know that those three points has a 1 + 2 functions, however I still believe that when asking for help, any user could be a little bit more precise, helping us to help. Sorry, I don't want to seem rude, but that's it...
User avatar
death.crafter
Rainmeter Sage
Posts: 1399
Joined: April 24th, 2021, 8:13 pm

Re: Simple countdown timer

Post by death.crafter »

Yincognito wrote: July 26th, 2021, 6:16 pm Well, that would be fine from my part. I was never a fan of using Lua or other kind of scripts in cases where native Rainmeter can do the job. Also, I would gladly avoid the mess the code has become... :Whistle

Personally, I would just rewrite the whole thing in plain Rainmeter, but that's just me. If anyone has a better idea, I'm listening. :confused:
EDIT: Or, he could just edit balala's countdown timer and ask him what to do when he breaks it... :sly:
For the first time I agree on use of native Rainmeter. You can just set and write a starting timestamp and then using the current timestamp you can calculate how much time has passed and how much remains.

And if you have to pause, you can write a pause or close time stamp and on resume you can subtract that timestamp from current and add that to the total time. So your total time remains constant even after break. Like if you paused at 30:23 for 5 mins, it will start at 30:23 and not 25:23. But in Rainmeter this will take a lot of measures.

A note to sl23 on how I imagine it:

Code: Select all

[Variables]
Hours=02
Minutes=30
Seconds=50

;Not to be touched by user
StartingStamp=

PauseStamp=0
PauseDuration=0

[TimeRaw]
Measure=Time

[TotalTime]
Measure=Calc
Formula=#Hours#*3600 + #Minutes#*60 + #Seconds# + #PauseDuration#
UpdateDivider=-1

[Timer]
Measure=Calc
Formula=TimeRaw-#StartingStamp#
IfCondition=Timer>=TotalTime
IfTrueAction=[!blah][!blah][!blah][!DisableMeasure Timer]
Disabled=1
Group=Timer

[RemainingTime]
Measure=Calc
Formula=#StartingStamp#+TotalTime-TimeRaw
Group=Timer

[FormattedRemainingTime]
Measure=Uptime
...
Group=Timer

[Start]
Meter=Image
...
LeftMouseUpAction=[!SetVariable StartingStamp "[TimeRaw]"][!WriteKeyValue Variables StartingStamp "[#StartingStamp]"][!EnableMeasure Timer]

[Pause]
Meter=Image
...
LeftMouseUpAction=[!PauseMeasureGroup Timer][!SetVariable PauseStamp "[TimeRaw]"][!WriteKeyValue Variables PauseStamp "[#PauseStamp]"]

[Resume]
Meter=Image
...
LeftMouseUpAction=[!SetVariable PauseDuration "([TimeRaw]-[#PauseStamp])"][!WriteKeyValue Variables PauseDuration "[#PauseDuration]"][!UpdateMeasure TotalTime][!UnpauseMeasureGroup Timer]
You can do some work to make it work even on refresh.
Hope this makes sense lol.
from the Realm of Death
User avatar
sl23
Posts: 1140
Joined: February 17th, 2011, 7:45 pm
Location: a Galaxy S7 far far away

Re: Simple countdown timer

Post by sl23 »

Yincognito wrote: July 26th, 2021, 5:20 pm I guess it's TimerNixie of jsmorley, with the last INI code posted by sl23. At least that's the one I'm looking at, before smoking a cigar... :???:
That's the one :D
- MuLab -
User avatar
sl23
Posts: 1140
Joined: February 17th, 2011, 7:45 pm
Location: a Galaxy S7 far far away

Re: Simple countdown timer

Post by sl23 »

balala wrote: July 26th, 2021, 6:09 pm No, I don't mind at all. All my codes can be freely used by anyone.
Thanks, I may well take that route yet... :thumbup:
- MuLab -
User avatar
sl23
Posts: 1140
Joined: February 17th, 2011, 7:45 pm
Location: a Galaxy S7 far far away

Re: Simple countdown timer

Post by sl23 »

Yincognito wrote: July 26th, 2021, 6:16 pm Well, that would be fine from my part. I was never a fan of using Lua or other kind of scripts in cases where native Rainmeter can do the job. Also, I would gladly avoid the mess the code has become... :Whistle

Personally, I would just rewrite the whole thing in plain Rainmeter, but that's just me. If anyone has a better idea, I'm listening. :confused:
EDIT: Or, he could just edit balala's countdown timer and ask him what to do when he breaks it... :sly:
Yeah, I was kinda thinking along those lines :oops:
- MuLab -
User avatar
sl23
Posts: 1140
Joined: February 17th, 2011, 7:45 pm
Location: a Galaxy S7 far far away

Re: Simple countdown timer

Post by sl23 »

balala wrote: July 26th, 2021, 6:27 pm Even if I read Yincognito's reply I still believe that death.crafter is right when he says that

Additionally note that it's not clear when sl23's ask about:

Which are your the "1 + 2 above" functions, because in your previous reply (not saying that it has been posted two days earlier) there are three points. Now I know that those three points has a 1 + 2 functions, however I still believe that when asking for help, any user could be a little bit more precise, helping us to help. Sorry, I don't want to seem rude, but that's it...
Not rude at all, apologies if it wasn't clear. I posted 3 points. I needed help with the first and second which are mouse scrolling on the Hour, Minutes and Seconds meters to adjust each separately. And a Start Stop toggle button. Simple as that really.

I did post the code, is it better to post the .rmskin package then? I just didn't want to keep uploading it in case it got confusing which was which. Sorry.
- MuLab -
User avatar
sl23
Posts: 1140
Joined: February 17th, 2011, 7:45 pm
Location: a Galaxy S7 far far away

Re: Simple countdown timer

Post by sl23 »

death.crafter wrote: July 26th, 2021, 7:22 pm For the first time I agree on use of native Rainmeter. You can just set and write a starting timestamp and then using the current timestamp you can calculate how much time has passed and how much remains.

And if you have to pause, you can write a pause or close time stamp and on resume you can subtract that timestamp from current and add that to the total time. So your total time remains constant even after break. Like if you paused at 30:23 for 5 mins, it will start at 30:23 and not 25:23. But in Rainmeter this will take a lot of measures.

A note to sl23 on how I imagine it:

Code: Select all

[Variables]
Hours=02
Minutes=30
Seconds=50

;Not to be touched by user
StartingStamp=

PauseStamp=0
PauseDuration=0

[TimeRaw]
Measure=Time

[TotalTime]
Measure=Calc
Formula=#Hours#*3600 + #Minutes#*60 + #Seconds# + #PauseDuration#
UpdateDivider=-1

[Timer]
Measure=Calc
Formula=TimeRaw-#StartingStamp#
IfCondition=Timer>=TotalTime
IfTrueAction=[!blah][!blah][!blah][!DisableMeasure Timer]
Disabled=1
Group=Timer

[RemainingTime]
Measure=Calc
Formula=#StartingStamp#+TotalTime-TimeRaw
Group=Timer

[FormattedRemainingTime]
Measure=Uptime
...
Group=Timer

[Start]
Meter=Image
...
LeftMouseUpAction=[!SetVariable StartingStamp "[TimeRaw]"][!WriteKeyValue Variables StartingStamp "[#StartingStamp]"][!EnableMeasure Timer]

[Pause]
Meter=Image
...
LeftMouseUpAction=[!PauseMeasureGroup Timer][!SetVariable PauseStamp "[TimeRaw]"][!WriteKeyValue Variables PauseStamp "[#PauseStamp]"]

[Resume]
Meter=Image
...
LeftMouseUpAction=[!SetVariable PauseDuration "([TimeRaw]-[#PauseStamp])"][!WriteKeyValue Variables PauseDuration "[#PauseDuration]"][!UpdateMeasure TotalTime][!UnpauseMeasureGroup Timer]
You can do some work to make it work even on refresh.
Hope this makes sense lol.
Sort of lol I'll take a look when I get more time to inspect it. Thanks to everyone for all your assistance.
- MuLab -