It is currently April 27th, 2024, 3:46 pm

If statement to hide meter

Get help with creating, editing & fixing problems with skins
ariefcfa
Posts: 18
Joined: October 7th, 2012, 3:37 pm

If statement to hide meter

Post by ariefcfa »

Hi all Master

please help, it is not working on my skin

code:

Code: Select all

[MeasureWunder]
Measure=Plugin
Plugin=Plugins\WebParser.dll
UpdateRate=3600
Url=http://api.wunderground.com/auto/wui/geo/WXCurrentObXML/index
.xml?query=#Location#
RegExp="(?siU)<display_location>.*<city>(.*)
</city>.*</display_location>.*<observation_time>Last Updated on 
(.*), (.*) (.*)</observation_time>.*<weather>(.*)
</weather>.*<temp_c>(.*)</temp_c>.*<relative_humidity>(.*)
</relative_humidity>.*<wind_dir>(.*)</wind_dir>.*<wind_mph>(.*)
</wind_mph>.*<pressure_mb>(.*)</pressure_mb>.*<dewpoint_c>(.*)
</dewpoint_c>.*<icon>(.*)</icon>"

;-------------------------------------------------------------------------------

[MeasureCityName]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[MeasureWunder]
StringIndex=1
UpdateRate=3600
IfEqualValue=0
IfEqualaction=!Execute [!HideMeter MeterCityName]
IfAboveValue=0
IfAboveAction=!Execute [!ShowMeter MeterCityName]

;--------------------------------------------------------------------------------

[MeterCityName]
MeasureName=MeasureCityName
Meter=STRING
X=10
Y=10
w=220
h=20
meterstyle=stylelefttext3
Text="Current Weather of %1"
Antialias=1
LeftMouseUpAction=!Execute ["https://www.google.co.id/search?
q=current+weather+#location#"]
ToolTipText="prepare your umbrella ela ela :) "
on the line
Text="Current Weather of %1"

i cannot hide the text "current weather of" when i lost my internet connection

please help :)
User avatar
Brian
Developer
Posts: 2686
Joined: November 24th, 2011, 1:42 am
Location: Utah

Re: If statement to hide meter

Post by Brian »

ariefcfa wrote:Hi all Master

please help, it is not working on my skin

code:

Code: Select all

[MeasureWunder]
Measure=Plugin
Plugin=Plugins\WebParser.dll
UpdateRate=3600
Url=http://api.wunderground.com/auto/wui/geo/WXCurrentObXML/index
.xml?query=#Location#
RegExp="(?siU)<display_location>.*<city>(.*)
</city>.*</display_location>.*<observation_time>Last Updated on 
(.*), (.*) (.*)</observation_time>.*<weather>(.*)
</weather>.*<temp_c>(.*)</temp_c>.*<relative_humidity>(.*)
</relative_humidity>.*<wind_dir>(.*)</wind_dir>.*<wind_mph>(.*)
</wind_mph>.*<pressure_mb>(.*)</pressure_mb>.*<dewpoint_c>(.*)
</dewpoint_c>.*<icon>(.*)</icon>"

;-------------------------------------------------------------------------------

[MeasureCityName]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[MeasureWunder]
StringIndex=1
UpdateRate=3600
IfEqualValue=0
IfEqualaction=!Execute [!HideMeter MeterCityName]
IfAboveValue=0
IfAboveAction=!Execute [!ShowMeter MeterCityName]

;--------------------------------------------------------------------------------

[MeterCityName]
MeasureName=MeasureCityName
Meter=STRING
X=10
Y=10
w=220
h=20
meterstyle=stylelefttext3
Text="Current Weather of %1"
Antialias=1
LeftMouseUpAction=!Execute ["https://www.google.co.id/search?
q=current+weather+#location#"]
ToolTipText="prepare your umbrella ela ela :) "
on the line
Text="Current Weather of %1"

i cannot hide the text "current weather of" when i lost my internet connection

please help :)
Looks like you are almost there with your measure "MeasureCityName", however I would suggest a slightly different approach.

Code: Select all

[MeasureWunder]
Measure=Plugin
Plugin=WebParser
UpdateRate=3600
Url=http://api.wunderground.com/auto/wui/geo/WXCurrentObXML/index.xml?query=#Location#
RegExp="(?siU)<display_location>.*<city>(.*)</city>.*</display_location>.*<observation_time>Last Updated on (.*), (.*) (.*)</observation_time>.*<weather>(.*)</weather>.*<temp_c>(.*)</temp_c>.*<relative_humidity>(.*)</relative_humidity>.*<wind_dir>(.*)</wind_dir>.*<wind_mph>(.*)</wind_mph>.*<pressure_mb>(.*)</pressure_mb>.*<dewpoint_c>(.*)</dewpoint_c>.*<icon>(.*)</icon>"
ErrorString=-999
IfEqualValue=-999
IfEqualAction=!HideMeterGroup Weather
FinishAction=!ShowMeterGroup Weather

;-------------------------------------------------------------------------------

[MeasureCityName]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[MeasureWunder]
StringIndex=1

;--------------------------------------------------------------------------------

[MeterCityName]
Group=Weather
MeasureName=MeasureCityName
Meter=STRING
X=10
Y=10
w=220
h=20
MeterStyle=stylelefttext3
Text="Current Weather of %1"
AntiAlias=1
LeftMouseUpAction=["https://www.google.co.id/search?q=current+weather+#location#"]
ToolTipText="prepare your umbrella ela ela :) "
With this version, you can place Group=Weather in any of your meters to show/hide them depending on if you have an internet connection or not.