Note that with the measures posted by you, when the value returned by the [MeasureAdapter] measure is GOOSEVPN, the VPNOn variable is set to 1 and the values returned by the [MeasureCurrentLatitude] and [MeasureCurrentLongitude] measures are #Latitude# and #Longitude# accordingly. If the [MeasureAdapter] measure doesn't match GOOSEVPN, the VPNOn variable is set to 0 and this time the values returned by the [MeasureCurrentLatitude] and [MeasureCurrentLongitude] measures are [MeasureLatitude] and [MeasureLongitude] accordingly. I think this way, this is not exactly ok. Is it?
This is exactly what I need.
VPN OFF; MeasureCurrentLatitude and MeasureCurrentLongitude to be the locations lat and long base on IP address. [MeasureLatitude] and [MeasureLongitude] accordingly.
VPN ON; MeasureCurrentLatitude and MeasureCurrentLongitude to be my standard Locations coordinates. #Latitude# and #Longitude# accordingly.
So this is what I've got so far:
Code: Select all
[Variables]
Language=en-GB
UpdateRate=600
VPNOn=0
;--- Lat & Long for Landgraaf NL ---
Latitude=50.8871
Longitude=6.0116
[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1
[MeasureLocationIP]
Measure=WebParser
URL=https://ipapi.co/json
RegExp="(?siU)"city": "(.*)".*"region": "(.*)".*"country_name": "(.*)",.*"latitude": (.*),.*"longitude": (.*),.*"
UpdateRate=#UpdateRate#
FinishAction=[!UpdateMeasureGroup GeocodeGroup]
DynamicVariables=1
[MeasureLatitude]
Group=GeocodeGroup
Measure=WebParser
URL=[MeasureLocationIP]
StringIndex=4
RegExpSubstitute=1
Substitute="^$":"#Latitude#"
[MeasureLongitude]
Group=GeocodeGroup
Measure=WebParser
URL=[MeasureLocationIP]
StringIndex=5
RegExpSubstitute=1
Substitute="^$":"#Latitude#"
[MeasureAdapter]
Measure=Plugin
Plugin=SysInfo
SysInfoType=ADAPTER_DESCRIPTION
SysInfoData=Best
DynamicVariables=1
IfMatch=GOOSEVPN
IfMatchAction=[!SetVariable VPNOn "1"][!UpDateMeasure "MeasureCurrentLatitude"][!UpDateMeasure "MeasureCurrentLongitude"][!SetVariable URLCurrent "https://weather.com/#Language#/weather/today/l/[MeasureCurrentLatitude],[MeasureCurrentLongitude]"][!EnableMeasure "@CurrentAll"][!SetVariable URLForecast "https://weather.com/#Language#/weather/tenday/l/[MeasureCurrentLatitude],[MeasureCurrentLongitude]"][!EnableMeasure "@ForecastAll"]
IfNotMatchAction=[!SetVariable VPNOn "0"][!UpDateMeasure "MeasureCurrentLatitude"][!UpDateMeasure "MeasureCurrentLongitude"][!SetVariable URLCurrent "https://weather.com/#Language#/weather/today/l/[MeasureCurrentLatitude],[MeasureCurrentLongitude]"][!EnableMeasure "@CurrentAll"][!SetVariable URLForecast "https://weather.com/#Language#/weather/tenday/l/[MeasureCurrentLatitude],[MeasureCurrentLongitude]"][!EnableMeasure "@ForecastAll"]
[MeasureCurrentLatitude]
Measure=Calc
Formula=(1 - #VPNOn#) * [MeasureLatitude] + (#VPNOn# * #Latitude# )
DynamicVariables=1
[MeasureCurrentLongitude]
Measure=Calc
Formula=(1 - #VPNOn#) * [MeasureLongitude] + (#VPNOn# * #Longitude# )
DynamicVariables=1
When VPNon = 1 I get.
MeasureLatitude = 52.3109 (VPN location latitude)
MeasureLongitude = 4.9453 (VPN location longitude)
MeasureAdapter=GOOSEVPN
MeasureCurrentLatitude=50.8871
MeasureCurrentLongitude=6.0116
So this is OK
Capture1.JPG
The URLCurrent and URLForecast are correct
https://weather.com/en-GB/weather/today/l/50.8871,6.0116
Capture2.JPG
When VPNon = 0 the returned Lat and Long are OK
MeasureLatitude = 50.8871 (My IP location latitude)
MeasureLongitude = 6.0116 (My IP location longitude)
MeasureAdapter=Realtek PCIe .....
MeasureCurrentLatitude=50.8871
MeasureCurrentLongitude=6.0116
This is also OK
Capture3.JPG
But the URLCurrent and URLForecast are NOT OK
Capture4.JPG
https://weather.com/en-GB/weather/today/l/50.8871,50.8871
The longitude value is NOT OK (Latitude value is used)
Both VPNon situations use the same
[!SetVariable URLCurrent "https://weather.com/#Language#/weather/today/l/[MeasureCurrentLatitude],[MeasureCurrentLongitude]"] code so why do I get when VPNon=0 correct MeasureCurrentLongitude but wrong Longitude assignment in the URL???
You do not have the required permissions to view the files attached to this post.