Ok, well it's been a while of me using Rainmeter, and I've written pretty much my own skins that I'm happy with/developing.
Recently I've been looking into the IF Measure, and have actually pretty much got it sorted out, however this is where I want to kind of get the set variable bang sorted and interlinked with this.
Now I've managed to look at the Versaille Skin and the manual so I've got the hang of most of it.
What I really want to try and do is get a measure to set a variable, and then a different measure to pick up on that variable and execute a bang depending on the scenario.
Now I've managed to do the second part of this, however could do with a hand on how to get a measure to set a variable, so for example, the measure returns the time, and sets the time as a value.
Thanks
kd
It is currently April 28th, 2024, 3:09 am
Set Variable Bang
-
- Posts: 9
- Joined: December 6th, 2010, 11:44 am
-
- Moderator
- Posts: 995
- Joined: June 10th, 2009, 12:44 pm
- Location: Sweden
Re: Set Variable Bang
!Execute [!RainmeterSetVariable YourVariable [MeasureTime]]http://rainmeter.net/cms/Bangs_beta wrote:!RainmeterSetVariable [Variable] [Value] (Config)
Sets a new value for a variable. The meter or measure where the variable is used must have dynamic variables enabled (DynamicVariables=1). Formulas may be used, enclosed in parentheses. As with all !Bangs, quotes must be used around the parameter if there are spaces: !RainmeterSetVariable VarName "(#SCREENAREAWIDTH# - 10)"
I don't think, therefore I'm not.
-
- Posts: 9
- Joined: December 6th, 2010, 11:44 am
Re: Set Variable Bang
Ok, well it's basically the code below
Should point out that the weather code has been heavily influenced by Enigma whilst I'm here.
Now on top of that I'll have a "Rise" Variable somewhere obviously. But yeah basically I want the StringIndex 3 to be set as a variable (RISE), then my [TEST] Measure to read the Rise Variable and play a sound (which it already does if I set the Rise Variable myself).
Basically the essence of this is that when the sun is rising the computer will play a sound to alert me to this fact. I'll then expand on this for other factors (probably sun setting as well, and various other things) but this is the start point really
kd
Code: Select all
[TEST]
Measure=Time
Timezone=0
Format="%H%M"
IfEqualValue=#Rise#
IfEqualAction=!Execute [Play XYZ.wav]
[MEASURETEST2]
Measure=Plugin
Plugin=Plugins\WebParser.dll
UpdateRate=21600
Url=http://weather.yahooapis.com/forecastrss?p=#WeatherLoc#&u=#WUnit#
RegExp=(?siU)<link.*>(.*)</link>.*city=\"(.*)\".*sunrise=\"(.*)\".*sunset=\"(.*)\".*<image>.*<url>(.*)</url>.*<title>.*:.*m .*(.*)</title>.*lat>(.*)<.*long>(.*)<.*yweather:condition.*text=\"(.*)\".*code=\"(.*)\".*temp=\"(.*)\".*yweather:forecast.*day=\"(.*)\".*high=\"(.*)\".*code=\"(.*)\".*yweather:forecast.*day=\"(.*)\".*high=\"(.*)\".*code=\"(.*)\".*
StringIndex=3
Substitute=" am":""," pm":""
OnRefreshAction !Rainmetersetvariable Rise MEASURETEST2
Now on top of that I'll have a "Rise" Variable somewhere obviously. But yeah basically I want the StringIndex 3 to be set as a variable (RISE), then my [TEST] Measure to read the Rise Variable and play a sound (which it already does if I set the Rise Variable myself).
Basically the essence of this is that when the sun is rising the computer will play a sound to alert me to this fact. I'll then expand on this for other factors (probably sun setting as well, and various other things) but this is the start point really
kd
-
- Moderator
- Posts: 995
- Joined: June 10th, 2009, 12:44 pm
- Location: Sweden
Re: Set Variable Bang
The easiest way I see without making it too big is just to have a counter with bangs that sets all the variables you want.
This will set your varibales as soon as the counter hits 5. It the restarts. You should set it higher though, unless you want to set a new variable that often.
Code: Select all
[SetVarCount]
Measure=Calc
Formula=Counter %6
IfEqualValue=5
IfEqualAction=!Execute [!RainmeterSetVariable Rise [MeasureTest2]][!RainmeterSetVariable SomeOtherVariable [SomeOtherMeasure]]
I don't think, therefore I'm not.