Forget Google, the Rainmeter manual has all you need: !Delay bang. Or, you can execute / update subsequent measures from the FinishAction of the WebParser measure, if that is the first in your sequence.LooseAllTheMonies wrote: ↑August 3rd, 2021, 8:27 pmI tried to find a way to delay the update by using the following (with rainmeter Update=500 this should be 2.5 seconds after the initial change detection) but it doesn't seem to work, is there a better alternative? Googling around has shown me that RainMeter doesn't natively support any type of delays so I tried to hack one together but it doesnt seem to be working, it will update the DelayCounter up to 1 but then stop.
It is currently April 26th, 2024, 6:10 am
Can anyone help me figure out why variables arent displaying
-
- Rainmeter Sage
- Posts: 7164
- Joined: February 27th, 2015, 2:38 pm
- Location: Terra Yincognita
Re: Can anyone help me figure out why variables arent displaying
Last edited by Yincognito on August 3rd, 2021, 9:06 pm, edited 1 time in total.
-
- Rainmeter Sage
- Posts: 16172
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
Re: Can anyone help me figure out why variables arent displaying
Apart from Yncognito's reply about the !Delay bang, note that the posted [MeasureDelayThenUpdate] measure can't "execute" a dely, because:LooseAllTheMonies wrote: ↑August 3rd, 2021, 8:27 pmOriginally I had IfTrueAction=[!SetVariable DelayCounter "(#DelayCounter#+1)"] but then I added [!EnableMeasure MeasureDelayThenUpdate] as that measure is set as disabled and wasn't updating and I thought that might be part of the reason although it's not.Code: Select all
[Variables] DelayCounter=0 [MeasureLocalIP] Measure=Plugin Plugin=SysInfo SysInfoType=IP_ADDRESS SysInfoData=Best DynamicVariables=1 OnChangeAction=[!EnableMeasure MeasureDelayThenUpdate] ;Group=WANMeasures ;following delay is needed as it takes some time between noticing an IP change and actually connecting to VPN server if we request a website during that time it will fail [MeasureDelayThenUpdate] Measure=Calc Formula=#DelayCounter# IfCondition=#DelayCounter# < 6 IfTrueAction=[!SetVariable DelayCounter "(#DelayCounter#+1)"][!EnableMeasure MeasureDelayThenUpdate] IfFalseAction=[!SetVariable DelayCounter 0][!CommandMeasure MeasureIP Update][!UpdateMeasureGroup WANMeasures][!UpdateMeterGroup WANMeters][!DisableMeasure MeasureDelayThenUpdate] DynamicVariables=1 Disabled=1
- It is disabled (due to the Disabled=1 option). A disabled measure doesn't check / execute the IfCondition and the relative IfTrueAction / IfFalseAction option, first being needed to be enabled. It can't be enabled by a bang into its own IfTrueAction option, because this option is never executed.
- Even if enabled, the posted measure still will delay infinitally the execution, because you can't get increasing the #DelayCounter# variable more times (to reach 6). Once the condition becoming / being true, the IfTrueAction option is executed once, then never again, unless the condition becomes first false, then true again. However to can use it for a delay, you should add an IfConditionMode=1 option to the meter, which makes the condition to be evaluated and the appropriate IfTrueAction / IfFalseAction executed once on each update cycle. This way after six seconds the DelayCounter variable becomes equal to 6 and IfFalseAction is executed, leading to a dely.
-
- Rainmeter Sage
- Posts: 7164
- Joined: February 27th, 2015, 2:38 pm
- Location: Terra Yincognita
Re: Can anyone help me figure out why variables arent displaying
Yep, I mentioned this mainly because it was the easy choice, he incorrectly said that Rainmeter can't delay things natively, and I didn't look into the problem in detail, but now that I think of it, detecting internet connectivity through a measure like this (courtesy of jsmorley) might achieve what he wants as well, if that VPN switch also involves temporarily losing internet connectivity like he alluded to:
Code: Select all
[InternetStatus]
Measure=Plugin
Plugin=SysInfo
SysInfoType=INTERNET_CONNECTIVITY
UpdateDivider=SomeUpdateDivider
IfCondition=(InternetStatus=1)
IfTrueAction=...[!CommandMeasure SomeWebParserMeasure "Update"]...
-
- Rainmeter Sage
- Posts: 16172
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
Re: Can anyone help me figure out why variables arent displaying
Me neither and my reply was related only to how the delay can be done, assumed that !Delay should work, however didn't check. Instead insisted on why the posted [MeasureDelayThenUpdate] measure doesn't and can't work.Yincognito wrote: ↑August 3rd, 2021, 9:36 pm Yep, I mentioned this mainly because it was the easy choice, he incorrectly said that Rainmeter can't delay things natively, and I didn't look into the problem in detail,
-
- Rainmeter Sage
- Posts: 7164
- Joined: February 27th, 2015, 2:38 pm
- Location: Terra Yincognita
Re: Can anyone help me figure out why variables arent displaying
For sure. You can't simulate a delay by attempting to do a "measure update loop", like I suspect he was trying to...
-
- Rainmeter Sage
- Posts: 16172
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
Re: Can anyone help me figure out why variables arent displaying
The procedure should work, only the measure had a few mistake, preventing it to delay. Fixed them in my reply.Yincognito wrote: ↑August 4th, 2021, 11:26 am For sure. You can't simulate a delay by attempting to do a "measure update loop", like I suspect he was trying to...
-
- Rainmeter Sage
- Posts: 7164
- Joined: February 27th, 2015, 2:38 pm
- Location: Terra Yincognita
Re: Can anyone help me figure out why variables arent displaying
Ah, you're right, now I see. I was under the impression that the measure was successively updating without any "delay", but I realize now that the update rate of 1s was the actual "delay", applied 6 times. My bad.