I got an idea from another topic thread, but without further reference, a bit of really nifty code took my interest:
I noticed that from that the IPs identified from SysInfoType=some number (1 to 20) for each adapter don't match the IPs identified from SysInfoType=Best.Code: Select all
[Variables] NICID=0 [Rainmeter] Update=1000 DynamicWindowSize=1 AccurateText=1 ---Measures--- [measureAdapterName] Measure=Plugin Plugin=SysInfo SysInfoType=ADAPTER_DESCRIPTION SysInfoData=#NICID# RegExpSubstitute=1 Substitute="(^$|^0$)":"Unavailable" IfMatch=^.{2,}$ IfMatchAction=[!SetOption measureIP SysInfoData "[measureAdapterName]"] IfNotMatchAction=[!SetOption measureIP SysInfoData 999] IfMatchMode=1 DynamicVariables=1 [measureIP] Measure=Plugin Plugin=SysInfo Group=SysInfo SysInfoType=IP_ADDRESS SysInfoData= RegExpSubstitute=1 Substitute="(^$|^0$)":"Unavailable" DynamicVariables=1 ---Meters--- [meterNICInfo] Meter=String StringEffect=Shadow FontEffectColor=0,0,0,50 SolidColor=47,47,47,255 FontColor=255,255,255,255 FontFace=Consolas FontSize=16 AntiAlias=1 MeasureName=measureAdapterName MeasureName2=measureIP Text=Number : #NICID##CRLF#Adapter: %1#CRLF#IP : %2 MouseScrollUpAction=[!SetVariable NICID (Clamp(#NICID#-1,0,20))][!UpdateMeasure *][!UpdateMeter *][!Redraw] MouseScrollDownAction=[!SetVariable NICID (Clamp(#NICID#+1,0,20))][!UpdateMeasure *][!UpdateMeter *][!Redraw] DynamicVariables=1
I have a rather long bit of code of my own that allows the user to toggle between an abbreviated Adapter type eg "Realtek Gaming GbE Family Controller" or "Standard" for short, and the actual numerical IP address - in the interest of keeping things tidy depending on the users preferences.
Here is the whole thing (a long as it is):
Code: Select all
[Rainmeter]
Update=1000
AccurateText=1
[Variables]
@include=#@#RoundVariables.inc
m=>
n=>
Largest=10000000
MinValDn=#Largest#
MinValUp=#Largest#
Gothd=#Gothicd#
NICID=0
;==================================Styles=========================
[TextStyle]
FontFace=VertigoFLF
FontSize=31
FontColor=#GlobalFontAltColor#
AntiAlias=1
[TextStyle1]
FontFace=Segoe UI
FontSize=14
FontColor=#GlobalFontAltColor#
AntiAlias=1
StringStyle=Bold
[AllStyle]
FontSize=14
FontWeight=100
FontColor=#GlobalFontAltColor#
AntiAlias=1
DynamicVariables=1
[RightStyle]
StringAlign=Right
;==================================Measures=========================
[MeasureNetIn]
Measure=NetIn
updatedivider=2
[MeasureNetOut]
Measure=NetOut
updatedivider=2
[MeasureNetInC]
Measure=NetIn
Cumulative=1
[MeasureNetOutC]
Measure=NetOut
Cumulative=1
;===================================Calculations====================
[ValK]
updatedivider=-1
Measure=Calc
Formula=2048
[ValIn]
Measure=Calc
DynamicVariables=1
Formula=MeasureNetIn/1.05
[MeasureIN]
Measure=Calc
Formula=ValK > [ValIn] ? 0 : ValIn
DynamicVariables=1
[ValOut]
Measure=Calc
DynamicVariables=1
AverageSize=#avg#
Formula=MeasureNetOut/1.05
[MeasureNetInCumulative]
Measure=Calc
Formula=MeasureNetInC/6
[MeasureNetOutCumulative]
Measure=Calc
Formula=MeasureNetOutC/6
[MeasureOUT]
Measure=Calc
Formula=ValK > [ValOut] ? 0 : ValOut
DynamicVariables=1
[MeasureIN2]
Measure=Calc
Formula=(MeasureIN*2)/8.2
DynamicVariables=1
[MeasureOUT2]
Measure=Calc
Formula=(MeasureOUT*2)/16.8
DynamicVariables=1
[MeasureUpMax]
Measure=Calc
Formula=( Max ( MeasureUpMax, MeasureOUT2 ))
[MeasureUpMin]
Measure=Calc
Formula=(( #MinValUp# > 0 ) ? (( #MinValUp# > MeasureOUT2 ) ? MeasureOUT2 : #MinValUp# ) : #Largest# )
IfCondition=(#CURRENTSECTION#>0)
IfTrueAction=[!SetVariable MinValUp "[MeasureUpMin]"]
IfFalseAction=[!SetVariable MinValUp "#Largest#"]
IfConditionMode=1
DynamicVariables=1
[MeasureDnMax]
Measure=Calc
Formula=( Max ( MeasureDnMax, MeasureIN2 ))
[MeasureDnMin]
Measure=Calc
Formula=(( #MinValDn# > 0 ) ? (( #MinValDn# > MeasureIN2 ) ? MeasureIN2 : #MinValDn# ) : #Largest# )
IfCondition=(#CURRENTSECTION#>0)
IfTrueAction=[!SetVariable MinValDn "[MeasureDnMin]"]
IfFalseAction=[!SetVariable MinValDn "#Largest#"]
IfConditionMode=1
DynamicVariables=1
[SwitchUp]
Measure=Calc
Formula=0 < MeasureOUT2 ? 1 : 0
IfAboveValue=0
IfAboveAction=[!SetVariable m <]
[SwitchDn]
Measure=Calc
Formula=0 < MeasureIN2 ? 1 : 0
IfAboveValue=0
IfAboveAction=[!SetVariable n "<"][!UpdateMeasure "MeasureDnMin"]
[Val5]
updatedivider=-1
Measure=Calc
Formula=0
[Val6]
updatedivider=-1
Measure=Calc
Formula=1
;=====================================Shape=========================
[GraphBack]
Meter=Shape
Shape=Rectangle 43,45,913,202 | Fill Color 0,0,0,255 | StrokeWidth 1 | Stroke Color 0,0,0,255
AntiAlias=1
;=======================================Text Meters=================
[MeterTextSpeed]
UpdateDivider=-1
Meter=String
X=694
Y=42
MeterStyle=TextStyle1
StringAlign=right
Text="Speed"
[MeterTextMax]
UpdateDivider=-1
Meter=String
X=734
Y=r
MeterStyle=TextStyle1
StringAlign=left
Text="Maximum"
[MeterTextMin]
UpdateDivider=-1
Meter=String
X=845
Y=r
MeterStyle=TextStyle1
StringAlign=left
Text="Minimum"
[MeterTextUP]
Meter=String
X=505
Y=80
StringAlign=left
Text="UPLOAD"
DynamicVariables=1
FontFace=VertigoFLF
FontSize=31
StringCase=Upper
StringAlign=Left
StringEffect=Border
InlineSetting=Case | Upper
InlineSetting2=CharacterSpacing | .3 | .3
FontEffectColor=#VolMain#
FontColor=#NetFontColor1#
AntiAlias=1
StringStyle=Bold
[UpSpeed]
Meter=String
updatedivider=1
MeasureName=MeasureOUT2
X=219r
Y=-3r
StringAlign=right
MeterStyle=TextStyle
NumOfDecimals=2
AutoScale=1
Text="%1Bps"
[TextUpMin]
Meter=String
updatedivider=1
MeasureName=MeasureUpMin
X=220r
Y=r
MeterStyle=TextStyle
StringAlign=right
NumOfDecimals=2
AutoScale=1
Text=%1B
[TextUpMax]
updatedivider=1
Meter=String
MeasureName=MeasureUpMax
X=-110r
Y=r
MeterStyle=TextStyle
StringAlign=right
NumOfDecimals=2
AutoScale=1
Text=%1B
DynamicVariables=1
[MeterTextDN]
Meter=String
X=505
Y=147
StringAlign=left
Text="DOWNLOAD"
DynamicVariables=1
FontFace=VertigoFLF
FontSize=31
StringCase=Upper
StringAlign=Left
StringEffect=Border
InlineSetting=Case | Upper
InlineSetting2=CharacterSpacing | .3 | .3
FontEffectColor=#VolMain#
FontColor=#NetFontColor2#
AntiAlias=1
StringStyle=Bold
[DnSpeed]
Meter=String
updatedivider=1
MeasureName=MeasureIN2
X=219r
Y=-1r
StringAlign=right
MeterStyle=TextStyle
NumOfDecimals=2
AutoScale=1
Text="%1Bps"
[DnData]
Meter=String
updatedivider=1
MeasureName=MeasureDnMin
X=220r
Y=r
MeterStyle=TextStyle
StringAlign=right
NumOfDecimals=2
AutoScale=1
Text=%1B
[DnSession]
updatedivider=1
Meter=String
MeasureName=MeasureDnMax
X=-110r
Y=r
MeterStyle=TextStyle
StringAlign=right
NumOfDecimals=2
AutoScale=1
Text=%1B
;======================================Connectivity=================
[MeasureAdapter]
Measure=Plugin
Plugin=SysInfo
SysInfoType=ADAPTER_DESCRIPTION
SysInfoData=Best
Substitute="#IPSkinVPNFullName#":"Private Internet Adapter","#IPSkinAdapterFullName#":"Standard Internet Adapter"
DynamicVariables=1
[MeasureWANIP]
Measure=WebParser
Url=http://checkip.dyndns.org/%22
RegExp="(?siU)<body>(.+)Address: (.+)</body>"
StringIndex=2
UpdateDivider=1
OnChangeAction=[!SetOption MeterWANIP Text "Current IP: %1"][!UpdateMeasure "MeasureAdapter"][!UpdateMeter MeterWANIP][!Redraw]
DynamicVariables=1
[MeterTextAdapter]
Meter=String
MeasureName=MeasureAdapter
Fontsize=31
FontFace=VertigoFLF
AntiAlias=1
X=503
Y=202
StringAlign=Left
FontColor=#GlobalFontAltColor#
InlineSetting=CharacterSpacing | .7 | .7
Hidden=0
Group=ADAP
[MeterWANIP]
Meter=String
MeasureName=MeasureWANIP
X=503
Y=202
StringAlign=Left
FontColor=#GlobalFontAltColor#
Fontsize=31
FontFace=VertigoFLF
AntiAlias=1
InlineSetting=CharacterSpacing | .7 | .7
Text=
DynamicVariables=1
Hidden=1
Group=VPN
[TextOpenVPN]
Meter=String
updatedivider=1
SolidColor=0,0,0,1
X=945
Y=r
FontColor=#GlobalFontAltColor#
Fontsize=31
FontFace=VertigoFLF
AntiAlias=1
StringAlign=right
Text=@VPN
InlineSetting=CharacterSpacing | .7 | .7
LeftMouseUpAction=#VPNFullPath#
Hidden=0
Group=
[FPSClickBig]
Meter=Image
X=490
Y=203
W=240
H=45
LeftMouseUpAction=[!ToggleMeterGroup ADAP][!ToggleMeterGroup VPN][!Update]
SolidColor=0,0,0,1
;=====================================Lines=========================
[MeterGraph0]
Meter=Line
MeasureName=MeasureOUT2
MeasureName2=MeasureIN2
X=0
Y=44
H=200
W=28
LineCount=2
LineWidth=3
LineColor=#NetLineColorOut#
LineColor2=#NetLineColorIn1#
Autoscale=1
AntiAlias=1
UpdateDivider=1
TransformationMatrix=16.52; 0; 0; 1; 44; 0
TransformStroke=Fixed
[MeterGraph2]
Meter=Line
MeasureName=MeasureOUT2
MeasureName2=MeasureIN2
X=0
Y=45
H=199
W=28
LineCount=2
LineWidth=1
LineColor=#NetLineColorIn2#
Autoscale=1
AntiAlias=1
UpdateDivider=1
TransformationMatrix=16.52; 0; 0; 1; 44; 0
TransformStroke=Fixed
;=========================================Boxes=====================
[MeterUpLeft]
Meter=Image
ImageName=#@#Border.png
ImageTint=#VolMain#
X=0
Y=0
W=130
H=130
AntiAlias=1
Group=Stat Border
[ScrollR]
Meter=Image
ImageName=#@#Edge.png
ImageFlip=Vertical
ImageTint=#VolMain#
X=([CentreText:X]-[ScrollL:W] -4)
Y=14
W=133
H=26
DynamicVariables=1
Group=ExtHUD | Scroll
Hidden=0
[CentreText]
Meter=String
MeasureName=MeasureUPTIME
X=490
Y=-10r
StringAlign=Center
Text=" Computer Uptime: %1 "
InlineSetting=Case | Upper
InlineSetting2=CharacterSpacing | .5 | .5
InlineSetting3=CharacterSpacing | -3.5 | 2.0
InlinePattern3=a|A
FontColor=#GlobalFontAltColor#
FontFace=VertigoFLF
FontSize=24
[ScrollL]
Meter=Image
ImageName=#@#Edge.png
ImageFlip=Both
ImageTint=#VolMain#
X=([CentreText:X]+[CentreText:W] +11)
Y=8r
W=133
H=26
DynamicVariables=1
Group=ExtHUD | Scroll
Hidden=0
[MeterUpRight]
Meter=Image
ImageFlip=Horizontal
ImageName=#@#Border.png
ImageTint=#VolMain#
X=869
Y=0
W=130
H=130
AntiAlias=1
Group=Stat Border
[MeterLowLeft]
Meter=Image
ImageFlip=Vertical
ImageName=#@#Border.png
ImageTint=#VolMain#
X=0
Y=163
W=130
H=130
AntiAlias=1
Group=Stat Border
[VictorianB]
Meter=Image
ImageName=#@#Victorian.png
ImageTint=#VolMain#
X=285
Y=254
W=420
H=30
AntiAlias=1
Group=Stat Border
[MeterLowRight]
Meter=Image
ImageFlip=Both
ImageName=#@#Border.png
ImageTint=#VolMain#
X=869
Y=163
W=130
H=130
AntiAlias=1
Group=Stat Border
[MeterUpInLeft]
Meter=Image
ImageName=#@#Corner.png
ImageTint=#VolMain#
X=47
Y=48
W=45
H=45
AntiAlias=1
Group=Stat Border
[MeterUpInRight]
Meter=Image
ImageName=#@#Corner.png
ImageFlip=Horizontal
ImageTint=#VolMain#
X=442
Y=48
W=45
H=45
AntiAlias=1
Group=Stat Border
[MeterDnInLeft]
Meter=Image
ImageName=#@#Corner.png
ImageFlip=Vertical
ImageTint=#VolMain#
X=47
Y=202
W=45
H=45
AntiAlias=1
Group=Stat Border
[MeterDnInRight]
Meter=Image
ImageName=#@#Corner.png
ImageFlip=Both
ImageTint=#VolMain#
X=442
Y=202
W=45
H=45
AntiAlias=1
Group=Stat Border
[LowerHoriz]
UpdateDivider=-1
Meter=Line
MeasureName=Val5
X=(0+43)
Y=(205+43)
H=2
W=912
LineWidth=2
LineColor=#NetBorder#
[TopLine]
UpdateDivider=-1
Meter=Line
MeasureName=Val5
X=(0+43)
Y=(0+43)
H=2
W=912
LineWidth=2
LineColor=#NetBorder#
[Line1]
UpdateDivider=-1
Meter=Line
MeasureName=Val5
X=(447+43)
Y=(-177+43)
H=200
W=466
LineWidth=2
LineColor=#NetBorder#
[Line2]
UpdateDivider=-1
Meter=Line
MeasureName=Val5
X=(447+43)
Y=(-107+43)
H=200
W=466
LineColor=#Main#
[Line3]
UpdateDivider=-1
Meter=Line
MeasureName=Val5
X=(447+43)
Y=(-39+43)
H=200
W=466
LineWidth=2
LineColor=#Main#
[Bar0]
UpdateDivider=-1
Meter=bar
MeasureName=Val6
BarOrientation=Vertical
BarColor=#NetBorder#
H=205
W=2
X=(0+43)
Y=(0+43)
[Bar01]
UpdateDivider=-1
Meter=bar
MeasureName=Val6
BarOrientation=Vertical
BarColor=0,0,0,255
H=200
W=3
X=(2+43)
Y=(2+43)
[Bar1]
UpdateDivider=-1
Meter=bar
MeasureName=Val6
BarOrientation=Vertical
BarColor=#Main#
H=160
W=1
X=(561+43)
Y=(1+43)
[Bar2]
UpdateDivider=-1
Meter=bar
MeasureName=Val6
BarOrientation=Vertical
BarColor=#Main#
H=160
W=1
X=(686+43)
Y=(1+43)
[Bar3]
UpdateDivider=-1
Meter=bar
MeasureName=Val6
BarOrientation=Vertical
BarColor=#Main#
H=160
W=1
X=(796+43)
Y=(1+43)
[Bar04]
UpdateDivider=-1
Meter=bar
MeasureName=Val6
BarOrientation=Vertical
BarColor=0,0,0,255
H=200
W=2
X=(445+43)
Y=(2+43)
[Bar4]
UpdateDivider=-1
Meter=bar
MeasureName=Val6
BarOrientation=Vertical
BarColor=#NetBorder#
H=205
W=2
X=(447+43)
Y=(1+43)
[Bar6]
UpdateDivider=-1
Meter=bar
MeasureName=Val6
BarOrientation=Vertical
BarColor=#NetBorder#
H=207
W=2
X=954
Y=43
[MeterImageClick]
Meter=Image
W=105
H=80
X=(457+43)
Y=(20+43)
DynamicVariables=1
LeftMouseUpAction=[!Refresh]
SolidColor=0,0,0,1
Apologies for the large chunks here.
So the first question is how can I somehow have both the LAN and the WAN be available within the function of the skin? (there are several questions, all in their own time though). The click action go between the adapter type with the option of entering the physical name found with the much simpler and pragmantical code provided by Yincognito (the first bit of code),and the numerical IPs.
The scroll action would cycle through the available IPs both WAN and LAN, as well as the physical names in the default 'unclicked' options added on the Variables.inc.
Again apologies if this seems very long, but my design is meant to be both 'pretty' and functional - but not without some preparations by editing the Variables.inc. (see attached).
The skin that is relevant to these questions is named "Mega Net.ini".