It is currently April 25th, 2024, 12:05 pm

What is my local IP Address(es)

Get help with installing and using Rainmeter.
User avatar
balala
Rainmeter Sage
Posts: 16168
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: What is my local IP Address(es)

Post by balala »

jsmorley wrote: May 6th, 2020, 3:56 pm Yes, if you use UpdateRate=-1 that doesn't do what UpdateDivider=-1 does. What it does is cause a weird "wrap around" of the number being used as the "counter" for threaded measures like WebParser and Ping, and what you actually get is UpdateRate=SomeGiganticNumber, I'm don't remember what it is, something like the largest integer size of a 16-bit integer in C. Big... In any case, for all practical purposes the behavior is sorta what you expect, as the measure will update once, then not again for 1,000 years or something, but I don't recommend it. I think it makes more sense, in all cases, to leave UpdateDivider alone on those measures. Leave it as the default "1". Then set UpdateRate to something sensible for the behavior you want, or UpdateRate=86400 or some other large number (that is the number of seconds in a day) if you want it to execute once and then stop.
Thanks for the details. Are good to be known. :great:
User avatar
balala
Rainmeter Sage
Posts: 16168
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: What is my local IP Address(es)

Post by balala »

Yincognito wrote: May 6th, 2020, 4:06 pm Oops, didn't know that. I just used the value I saw in the already posted code, I figured there was a good reason for it to be set this way. Guess I was wrong then... :confused:
Yes, it happens to all of us sometimes. I knew about this just because a while ago (in October last year, more precisely), I had that conversation with jsmorley, which I linked above.
o0oHAVOKo0o
Posts: 2
Joined: May 5th, 2020, 6:56 am

Re: What is my local IP Address(es)

Post by o0oHAVOKo0o »

balala wrote: May 5th, 2020, 8:41 am I'd use a SysInfo plugin measure. This plugin has two values for the SysInfoType option used to check if the computer is connected to LAN, respectively to internet.
For instance the following measure returns 1 if the computer is connected to LAN and -1 if it's not:

Code: Select all

[MeasureLAN]
Measure=Plugin
Plugin=SysInfo
SysInfoType=LAN_CONNECTIVITY
(if you'd like to check internet connectivity, replace the SysInfoType=LAN_CONNECTIVITY option with SysInfoType=INTERNET_CONNECTIVITY)
Accordingly to the returned value you should show up the IP address if the computer is connected or the Disconnected string otherwise. An IfCondition can be used to decide:

Code: Select all

[MeasureLAN]
Measure=Plugin
Plugin=SysInfo
SysInfoType=LAN_CONNECTIVITY
IfCondition=(#CURRENTSECTION#>0)
IfTrueAction=[!EnableMeasure "MeasureIPwifi"][!CommandMeasure "MeasureIPwifi" "Update"][!SetOption MeterText Text "%1"][!UpdateMeter "MeterText"][!Redraw]
IfFalseAction=[!DisableMeasure "MeasureIPwifi"][!SetOption MeterText Text "Disconnected"][!UpdateMeter "MeterText"][!Redraw]
Note that the above IfFalseAction disables the [MeasureIPwifi] measure if the computer isn't connected and enables it otherwise.
And the [MeterText] String meter, which shows up the IP address or Disconnected:

Code: Select all

[MeterText]
Meter=String
MeasureName=MeasureIPwifi
X=0
Y=0
Padding=15,5,15,5
FontColor=220,220,220
SolidColor=0,0,0,150
FontSize=8
FontFace=Segoe UI
StringStyle=BOLD
StringAlign=LEFT
AntiAlias=1
Thanks!! This one worked what I wanted.... Thank you for your help balala ^_^
User avatar
balala
Rainmeter Sage
Posts: 16168
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: What is my local IP Address(es)

Post by balala »

o0oHAVOKo0o wrote: May 11th, 2020, 5:31 am Thanks!! This one worked what I wanted.... Thank you for your help balala ^_^
I'm glad and you're welcome. :thumbup: