Hey guys,
I want to have the Update value in the Rainmeter section. And as far as I know there is no built-in variable and there is no way to get this value via Lua. So I think the only way to get this value is with the Webparser plugin, but I'm not sure if this is the best solution because I can remember that a Dev said that it's not good to parse things from skin.ini's or Rainmeter.ini.
My question is now: Is there another way and what would be the smartest solution?
It is currently September 29th, 2024, 9:27 pm
How do I get the Update value?
-
- Posts: 329
- Joined: June 9th, 2011, 6:46 pm
How do I get the Update value?
Rainmeter - You are only limited by your imagination and creativity.
-
- Developer
- Posts: 22793
- Joined: April 19th, 2009, 11:02 pm
- Location: Fort Hunt, Virginia, USA
Re: How do I get the Update value?
No real reason not to parse the actual running skin .ini file if you need something from it:
Code: Select all
[Rainmeter]
Update=1000
[MeasureUpdate]
Measure=Plugin
Plugin=WebParser
URL=file://#CURRENTPATH##CURRENTFILE#
RegExp=(?siU)Update=(.*)\s
StringIndex=1
UpdateRate=86400
-
- Developer
- Posts: 22793
- Joined: April 19th, 2009, 11:02 pm
- Location: Fort Hunt, Virginia, USA
Re: How do I get the Update value?
To be honest though, I would save the effort and small amount of processing and just use:
[Rainmeter]
Update=1000
[Variables]
SkinUpdate=1000
Then use the #SkinUpdate# variable wherever you need it.
[SomeMeasure]
Measure=Time
UpdateDivider=(#SkinUpdate# * 2)
[Rainmeter]
Update=1000
[Variables]
SkinUpdate=1000
Then use the #SkinUpdate# variable wherever you need it.
[SomeMeasure]
Measure=Time
UpdateDivider=(#SkinUpdate# * 2)
-
- Developer
- Posts: 22793
- Joined: April 19th, 2009, 11:02 pm
- Location: Fort Hunt, Virginia, USA
Re: How do I get the Update value?
You can even do:
Code: Select all
[Rainmeter]
Update=#SkinUpdate#
[Variables]
SkinUpdate=1000
-
- Posts: 329
- Joined: June 9th, 2011, 6:46 pm
Re: How do I get the Update value?
Yes, this is the way I'm doining it at the moment. But I want to have it automatic.jsmorley wrote:[Rainmeter]
Update=1000
[Variables]
SkinUpdate=1000
Then use the #SkinUpdate# variable wherever you need it.
[SomeMeasure]
Measure=Time
UpdateDivider=(#SkinUpdate# * 2)
What I want is that, if the user change the Update value the skin calculate automatic the suitable UpdateDivider Variable (in an animation skin). -> User friendly :)
Works perfectly, thank you very much!jsmorley wrote:[MeasureUpdate]
Measure=Plugin
Plugin=WebParser
URL=file://#CURRENTPATH##CURRENTFILE#
RegExp=(?siU)Update=(.*)\s
StringIndex=1
UpdateRate=86400
But with Updatedivider=-1 and UpdateRate=-1 on this simple measure there shouldn't be any problem.jsmorley wrote:I would save the effort and small amount of processing
Rainmeter - You are only limited by your imagination and creativity.
-
- Posts: 329
- Joined: June 9th, 2011, 6:46 pm
Re: How do I get the Update value?
jsmorley wrote:You can even do:
[Rainmeter]
Update=#SkinUpdate#
[Variables]
SkinUpdate=1000
Yeah this is the best solution I think
Thank you jsmorley
Rainmeter - You are only limited by your imagination and creativity.
-
- Posts: 1740
- Joined: November 13th, 2012, 9:53 pm
Re: How do I get the Update value?
may i ask why you are using a square of the main update value in meters/measures?
i can not really image what this could be used for.
i can not really image what this could be used for.
-
- Developer
- Posts: 22793
- Joined: April 19th, 2009, 11:02 pm
- Location: Fort Hunt, Virginia, USA
Re: How do I get the Update value?
He isn't. That was just a quick example by me of how you can use the variable. Not meant to be of any use in and of itself.moshi wrote:may i ask why you are using a square of the main update value in meters/measures?
i can not really image what this could be used for.
-
- Posts: 1740
- Joined: November 13th, 2012, 9:53 pm
Re: How do I get the Update value?
i think he does.
UpdateDivider=((#DefaultUpdate#)/(#SkinUpdate#))*(#DefaultDivider#)
maybe i just misinterpreted.
i can see a use in being able to change updates of only a limited number of elements (the animation for example) and have the other elements stay at the same update. that would require a formula like:AlC wrote:What I want is that, if the user change the Update value the skin calculate automatic the suitable UpdateDivider Variable (in an animation skin). -> User friendly
UpdateDivider=((#DefaultUpdate#)/(#SkinUpdate#))*(#DefaultDivider#)
maybe i just misinterpreted.
-
- Posts: 329
- Joined: June 9th, 2011, 6:46 pm
Re: How do I get the Update value?
Just to clear it, for what I need it.
I update my skin at the moment and it's depending on the Update value.
So if the user change now the #SkinUpdate# variable, the skin will automatic calculate the #UpdateDivider# variable with something like "round(1000/#SkinUpdate#)".
Edit:
At the flip animation I set the variable #UpdateDivider# to 1 and after the animation I set it back to "round(1000/#SkinUpdate#)".
And with this code ...
... the user now have to only change the #SkinUpdate# variable in the Variables.inc and doesn't have to change something in skin (and the skin calculate the suitable #UpdateDivider#).
I update my skin at the moment and it's depending on the Update value.
So if the user change now the #SkinUpdate# variable, the skin will automatic calculate the #UpdateDivider# variable with something like "round(1000/#SkinUpdate#)".
Edit:
At the flip animation I set the variable #UpdateDivider# to 1 and after the animation I set it back to "round(1000/#SkinUpdate#)".
And with this code ...
Code: Select all
[Rainmeter]
Update=#SkinUpdate#
[Variables]
SkinUpdate=1000
Last edited by AlC on May 4th, 2013, 12:43 pm, edited 1 time in total.
Rainmeter - You are only limited by your imagination and creativity.