It is currently September 21st, 2020, 12:23 pm

One Meter Updates !OnChangAction but another does not [solved]

Help with creating, editing & fixing problems with skins
User avatar
CodeCode
Posts: 18
Joined: September 7th, 2020, 2:24 pm

One Meter Updates !OnChangAction but another does not [solved]

Post by CodeCode »

So I have this basic skin that keeps track of my ip - I live in a rural area so my ip changes regularly.

I recently started to use a VPN.

This code is hat I am using with mixed results:

Code: Select all

[MeasureWANIP]
Measure=WebParser
Url=http://checkip.dyndns.org/%22
RegExp="(?siU)<body>(.+)Address: (.+)</body>"
StringIndex=2
OnChangeAction=[!SetOption MeterWANIP Text [MeasureWANIP]][!Redraw]
DynamicVariables=1

[MeterFrame]
Meter=Image
SolidColor=65,75,175,190
X=35
Y=35
W=260
H=260

[MeterWANIP]
Meter=String
MeasureName=MeasureWANIP
X=165
Y=132
StringAlign=Center
FontColor=200,200,200,255
StringEffect=Border
FontEffectColor=0,0,0,255
FontSize=18
FontFace=Calibri
AntiAlias=1
MouseOverAction=[!SetOption MeterWANIP FontColor 210,170,90,220][!UpdateMeterGroup IPN][!Redraw]
LeftMouseDownAction=["C:\Program Files\Private Internet Access\pia-client.exe"]
Text=%1
DynamicVariables=1
Group=IPN
This above part does not update instantl, and requires a manual refresh to reflect the new ip:


This part does:

Code: Select all

[MeasureAdapter]
Measure=Plugin
Plugin=SysInfo
SysInfoType=ADAPTER_DESCRIPTION
SysInfoData=Best
Substitute="Intel(R) Ethernet Connection (7) I218-IV":"STANDARD","Private Internet Access Network Adapter":"Private"
DynamicVariables=1

[MeterIfVPN]
Meter=String
MeasureName=MeasureAdapter
X=r
Y=+36r
Text=%1
StringAlign=Center
StringEffect=Border
FontEffectColor=0,0,0,255
FontColor=200,200,200,255
FontSize=19
FontFace=Calibri
AntiAlias=1
Is there a way to get this to update the ip text, and not just the adapter text?

The layout might seem messed up - I cut out some image meters from this text as they are not relevant - just ignore that part.
Last edited by CodeCode on September 13th, 2020, 6:23 am, edited 1 time in total.
Can't fix it if it ain't broke - unless it is in code.
dvo
Posts: 970
Joined: February 7th, 2016, 6:08 am

Re: One Meter Updates !OnChangAction but another does not

Post by dvo »

to sleepy going back to bed.. :D but i don't see the update any where ...
User avatar
brax64
Posts: 147
Joined: July 8th, 2018, 8:05 pm

Re: One Meter Updates !OnChangAction but another does not

Post by brax64 »

CodeCode wrote: September 13th, 2020, 3:58 am So I have this basic skin that keeps track of my ip - I live in a rural area so my ip changes regularly.
...
Hi CodeCode
Try to replace OnChangeAction=[!SetOption MeterWANIP Text [MeasureWANIP]][!Redraw]
with OnChangeAction=[!SetOption MeterWANIP Text [MeasureWANIP]][!UpdateMeter WANIP][!Redraw]
also I think the DynamicVariables=1 on the [MeasureWANIP] measure is not needed
User avatar
CodeCode
Posts: 18
Joined: September 7th, 2020, 2:24 pm

Re: One Meter Updates !OnChangAction but another does not

Post by CodeCode »

brax64 wrote: September 13th, 2020, 4:35 am Hi CodeCode
Try to replace OnChangeAction=[!SetOption MeterWANIP Text [MeasureWANIP]][!Redraw]
with OnChangeAction=[!SetOption MeterWANIP Text [MeasureWANIP]][!UpdateMeter WANIP][!Redraw]
also I think the DynamicVariables=1 on the [MeasureWANIP] measure is not needed
Hi brax64,
That did not make a difference.
Thanks for chiming in though. 8-)
Can't fix it if it ain't broke - unless it is in code.
User avatar
brax64
Posts: 147
Joined: July 8th, 2018, 8:05 pm

Re: One Meter Updates !OnChangAction but another does not

Post by brax64 »

CodeCode wrote: September 13th, 2020, 4:46 am Hi brax64,
That did not make a difference.
Thanks for chiming in though. 8-)
Try to replace OnChangeAction with OnUpdateAction
User avatar
CodeCode
Posts: 18
Joined: September 7th, 2020, 2:24 pm

Re: One Meter Updates !OnChangAction but another does not

Post by CodeCode »

dvo wrote: September 13th, 2020, 4:10 am to sleepy going back to bed.. :D but i don't see the update any where ...
Hi dvo.
The skin has an update of the standard 1000 milliseconds.
Can't fix it if it ain't broke - unless it is in code.
dvo
Posts: 970
Joined: February 7th, 2016, 6:08 am

Re: One Meter Updates !OnChangAction but another does not

Post by dvo »

dvo
Posts: 970
Joined: February 7th, 2016, 6:08 am

Re: One Meter Updates !OnChangAction but another does not

Post by dvo »

User avatar
CodeCode
Posts: 18
Joined: September 7th, 2020, 2:24 pm

Re: One Meter Updates !OnChangAction but another does not

Post by CodeCode »

dvo wrote: September 13th, 2020, 5:13 am https://forum.rainmeter.net/viewtopic.php?t=22186 this should be a pia version...
Hi dvo,

Both of those threads aim toward what I already have working = ADAPTER+TYPE updating correctly.

I am trying to have the IP_ADDRESS but the string is not updating the string that represents the IP number.
Can't fix it if it ain't broke - unless it is in code.
User avatar
CodeCode
Posts: 18
Joined: September 7th, 2020, 2:24 pm

Re: One Meter Updates !OnChangAction but another does not

Post by CodeCode »

I got it working by adding another measure where the !Refresh works correctly.

Code: Select all

;New Measure
[MeasureIP]
Measure=Plugin
Plugin=SysInfo
SysInfoType=IP_ADDRESS
SysInfoData=Best
OnChangeAction=[!Refresh]
DynamicVariables=1

;Same Text Meter
[MeterWANIP]
Meter=String
MeasureName=MeasureWANIP
X=165
Y=132
StringAlign=Center
FontColor=#ColorZ#
StringEffect=Border
FontEffectColor=0,0,0,255
FontSize=18
FontFace=#Font#
AntiAlias=1
MouseOverAction=[!SetOption MeterWANIP FontColor 210,170,90,220][!Redraw]
LeftMouseDownAction=["C:\Program Files\Private Internet Access\pia-client.exe"]
Text=%1
DynamicVariables=1
Group=IPN
Can't fix it if it ain't broke - unless it is in code.