It is currently March 28th, 2024, 5:07 pm

Refresh a skingroup roughly once an hour without using a time measure?

Get help with creating, editing & fixing problems with skins
Post Reply
User avatar
CodeCode
Posts: 1363
Joined: September 7th, 2020, 2:24 pm
Location: QLD, Australia

Refresh a skingroup roughly once an hour without using a time measure?

Post by CodeCode »

Hello, I looked for something that made sense for my idea, but it all comes up with is Update rate options.

So this simple layout is.. not working, but if the idea is clear, how can I do the !Refresh this way?

Code: Select all

[Rainmeter]
Update=500
Group=Wiz

[MeasureThing]
Measure=Calc
UpdateDivider=8
Formula=[!RefreshGroup "Wiz"]
User avatar
CodeCode
Posts: 1363
Joined: September 7th, 2020, 2:24 pm
Location: QLD, Australia

Re: Refresh a skingroup roughly once an hour without using a time measure?

Post by CodeCode »

Ok. SOrry.
I think I got it with this:

Code: Select all

[MeasureThing]
Measure=Calc
Formula=(MeasureThing+1)%(4000)
IfBelowValue=1
IfBelowAction=[!RefreshGroup NetWiz]
DynamicVariables=1
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5382
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA
Contact:

Re: Refresh a skingroup roughly once an hour without using a time measure?

Post by eclectic-tech »

CodeCode wrote: June 11th, 2022, 4:40 am Ok. SOrry.
I think I got it with this:

Code: Select all

[MeasureThing]
Measure=Calc
Formula=(MeasureThing+1)%(4000)
IfBelowValue=1
IfBelowAction=[!RefreshGroup NetWiz]
DynamicVariables=1
Just a couple of thoughts about your code... :???:

Your code is based on the update rate of your skin (default is 1000 milliseconds or once per second) and uses 4000 updates to approximate 1 hour (3600 seconds). This skin update timing will not always be 1 hour when Rainmeter takes longer than 1 second to complete an update or if you change the Update value in the [Rainmeter] section to a different value. That's why using 4000 instead of 3600, achieves you goal of refresh approximately once per hour.

Using a Modulo formula will work but is not as accurate as using a Time measure to control actions. Using a simple Time measure is a better solution, in my opinion, because it is not dependent on system activity and responds based on actual time measurements.

This code will refresh when the hour changes as long as the skin does not have updates disabled; Update=-1 in [Rainmeter].

Code: Select all

[MeasureThing]
Measure=Time
Format=%H
OnChangeAction=[!RefreshGroup NetWiz]
Both methods work but using a Time measure ensure accuracy if that is important to your design.
User avatar
CodeCode
Posts: 1363
Joined: September 7th, 2020, 2:24 pm
Location: QLD, Australia

Re: Refresh a skingroup roughly once an hour without using a time measure?

Post by CodeCode »

Yep. I put a lot of thought into that very point. My final decision was for the actual activity of the skin to meter the update rather than the clock.
The reason I decided that was simply due to the fact that the skin is basically an activity monitor, e.g. a netin skin. So in that view the activity seemed like the more logical way to handle the refresh rather than what time it is/was.

But your solution remains a great way of mitigating or handling a periodic refresh.

:great:
Post Reply