It is currently March 29th, 2024, 11:23 am

It doesn't work !SetVariable.

Get help with installing and using Rainmeter.
Rbuha
Posts: 5
Joined: January 15th, 2021, 2:03 pm

It doesn't work !SetVariable.

Post by Rbuha »

Hello there! I apologize for my English. The dynamic variable does not work. [Ms_Dav_3] the formula calculates the difference, but if the difference is > 0 instead of+ the skin displays #Plus#. Help me find the error.

Code: Select all


 [Ms_Dav_ob]
 Measure = Plugin
 Plugin = WebParser
 URL = https://meteoinfo.ru/pogoda/russia/tomsk-area/tomsk
  RegExp =(?siU) valueSuffix: ' мм рт.ст.*y:(.*)\}.*y:(.*)\}.*y:(.*)\}.*y:(.*)\}.*y:(.*)\}.*y:(.*)\}.*y:(.*)\}.*y:(.*)\}.*y:(.*)\}
   StringIndex = 1

[Ms_Dav]
 Measure = Plugin
 Plugin = WebParser
 URL = [Ms_Dav_ob]
 StringIndex = 9
 Substitute=".":","
 
 [Ms_Dav_2]
  Measure = Plugin
 Plugin = WebParser
 URL = [Ms_Dav_ob]
 StringIndex = 8
 Substitute=".":","
 
 [Ms_Dav_3]
 Measure=Calc
Formula=Ms_Dav - Ms_Dav_2
IfAboveValue =0
IfAboveAction = [!SetVariable Plus "+"]

[Ms_Dav_4]
Measure =Calc
Formula=Ms_Dav - Ms_Dav_2

[M_Dav]
Meter=String
MeasureName=Ms_Dav
MeasureName2=Ms_Dav_3
x=#XF#
y=R
StringAlign=left
FontColor=#CT#
FontSize=10
StringStyle=#Style#
Text=Давление: %1 (#Plus#%2)
;NumOfDecimals=1
DynamicVaribles=1
AntiAlias=1

Code: Select all

[Rainmeter]
Author=Buha
AppVersion=1.1
Update=1000
[Variables]
URL = https://www.foreca.ru/Russia/Kargasok
Sec = 60
Style=Normal
CT1=255,255,255
CT2=255,219,76
XF=3
YW=140
X1 = 190
X2 = 300
X3 =400
X4 =510
[Background]
Meter=IMAGE
W=600
H=220
SolidColor=0,0,0
Padding=5,10,5,10

[MeasureQuote]
Measure=Plugin
Plugin=QuotePlugin
PathName=#CURRENTPATH#WeatherIcons\
Subfolders=1
FileFilter=*.png

[Ms_F]
Measure = Plugin
 Plugin = WebParser
 URL= #URL#
 RegExp=(?siU)<img class="symb" src="/img/symb-70x70/(.*).png.* title="(.*)" width=".*<strong>(.*)</strong>.*От. влажность:   <strong>(.*)</strong.*Долгота дня: <strong>(.*)</strong><br />
 StringIndex = 1
 
[Ms_Ob]
 Measure = Plugin
 Plugin = WebParser
 URL = #URL#?tenday
  RegExp =(?siU)"h5">(.*)</.*50x50/(.*).png.*Макс:\s<strong>(.*)</strong>.*Мин:\s<strong>(.*)</strong>.*"h5">(.*)</.*50x50/(.*).png.*Макс:\s<strong>(.*)</strong>.*Мин:\s<strong>(.*)</strong>.*"h5">(.*)</.*50x50/(.*).png.*Макс:\s<strong>(.*)</strong>.*Мин:\s<strong>(.*)</strong>.*"h5">(.*)</.*50x50/(.*).png.*Макс:\s<strong>(.*)</strong>.*Мин:\s<strong>(.*)</strong>.*"h5">(.*)</.*50x50/(.*).png.*Макс:\s<strong>(.*)</strong>.*Мин:\s<strong>(.*)</strong>.*"h5">(.*)</.*50x50/(.*).png.*Макс:\s<strong>(.*)</strong>.*Мин:\s<strong>(.*)</strong>.*"h5">(.*)</.*50x50/(.*).png.*Макс:\s<strong>(.*)</strong>.*Мин:\s<strong>(.*)</strong>.*
  StringIndex = 1
  
  [Ms_Dav_ob]
 Measure = Plugin
 Plugin = WebParser
 URL = https://meteoinfo.ru/pogoda/russia/tomsk-area/kargasok
  RegExp =(?siU) valueSuffix: ' мм рт.ст.*y:(.*)\}.*y:(.*)\}.*y:(.*)\}.*y:(.*)\}.*y:(.*)\}.*y:(.*)\}.*y:(.*)\}.*y:(.*)\}.*y:(.*)\}
   StringIndex = 1
  
[Ms_Vl]
 Measure= Plugin
 Plugin= WebParser
 URL=[Ms_F]
 UpdateRate= #Sec#
 StringIndex=4
 
[Ms_Dav]
 Measure = Plugin
 Plugin = WebParser
 URL = [Ms_Dav_ob]
 StringIndex = 9
 Substitute=".":","
 
 [Ms_Dav_2]
  Measure = Plugin
 Plugin = WebParser
 URL = [Ms_Dav_ob]
 StringIndex = 8
 Substitute=".":","
 [Ms_Dav_3]
 Measure      =Calc
Formula       =Ms_Dav - Ms_Dav_2
IfAboveValue  =0
IfAboveAction =[!SetVariable Plus +]
DynamicVariables =1
[Ms_Icon_F]
 Measure= Plugin
 Plugin= WebParser
 URL=[Ms_F]
 UpdateRate= #Sec#
 StringIndex=1
 
[Ms_T_F]
 Measure= Plugin
 Plugin= WebParser
 URL=[Ms_F]
 UpdateRate= #Sec#
 StringIndex=3
 Substitute="+":""
[Ms_O_F]
 Measure= Plugin
 Plugin= WebParser
 URL=[Ms_F]
 UpdateRate= #Sec#
 StringIndex=2
 
[Ms_W1]
 Measure= Plugin
 Plugin= WebParser
 URL= https://meteoinfo.ru/pogoda/russia/tomsk-area/kargasok
 RegExp= (?siU)Направление ветра.*center">(.*)</td>
 StringIndex=1
 Substitute="северный":"С","северо-":"С","южный":"Ю","юго-":"Ю","западный":"З","восточный":"В"," порывы до":""
 ErrorString =
 
[Ms_W2]
 Measure= Plugin
 Plugin= WebParser
 URL=https://meteoinfo.ru/pogoda/russia/tomsk-area/kargasok
 RegExp = (?siU)Средняя скорость ветра,.*center">(.*)</td>
 StringIndex=1
 ErrorString =0
  
  [Ms_W3]
 Measure= Plugin
 Plugin= WebParser
 URL= https://meteoinfo.ru/pogoda/russia/tomsk-area/kargasok
 RegExp = (?siU)Порывы, м/с.*center"(.*)</td>
 StringIndex=1
  Substitute=">":"-"
 ErrorString =
[Ms_Den]
 Measure= Plugin
 Plugin= WebParser
 URL=[Ms_F]
 UpdateRate= #Sec#
 StringIndex=5
 
[Ms_Wat]
Measure= Plugin
Plugin= WebParser
URL= http://www.sokik.ru/
RegExp=(?siU)<td class="tx">(.*)</td>
StringIndex=1
 
[Ms_WatT]
Measure=Plugin
Plugin=WebParser
URL=http://www.sokik.ru/
RegExp=(?siU)<td class="tx"> (.*) С<
StringIndex=1

[Ms_Icon1]
Measure = Plugin
 Plugin = WebParser
 URL=[Ms_Ob]
 UpdateRate= #Sec#
 StringIndex=6
 
 
[Ms_Icon2]
Measure = Plugin
 Plugin = WebParser
 URL=[Ms_Ob]
 UpdateRate= #Sec#
 StringIndex=10
 
[Ms_Icon3]
Measure = Plugin
 Plugin = WebParser
 URL=[Ms_Ob]
 UpdateRate= #Sec#
 StringIndex=14
 
[Ms_Icon4]
Measure = Plugin
 Plugin = WebParser
 URL=[Ms_Ob]
 UpdateRate= #Sec#
 StringIndex=18
 
[Ms_Icon5]
Measure = Plugin
 Plugin = WebParser
 URL=[Ms_Ob]
 UpdateRate= #Sec#
 StringIndex=22
 
[Ms_Icon6]
Measure = Plugin
 Plugin = WebParser
 URL=[Ms_Ob]
 UpdateRate= #Sec#
 StringIndex=26
 
[Ms_D1]
Measure = Plugin
 Plugin = WebParser
 URL=[Ms_Ob]
 UpdateRate= #Sec#
 StringIndex=5
 
[Ms_D2]
Measure = Plugin
 Plugin = WebParser
 URL=[Ms_Ob]
 UpdateRate= #Sec#
 StringIndex=9
 
[Ms_D3]
Measure = Plugin
 Plugin = WebParser
 URL=[Ms_Ob]
 UpdateRate= #Sec#
 StringIndex=13
 
[Ms_D4]
Measure = Plugin
 Plugin = WebParser
 URL=[Ms_Ob]
 UpdateRate= #Sec#
 StringIndex=17
 
[Ms_D5]
Measure = Plugin
 Plugin = WebParser
 URL=[Ms_Ob]
 UpdateRate= #Sec#
 StringIndex=21
[Ms_D6]
Measure = Plugin
 Plugin = WebParser
 URL=[Ms_Ob]
 UpdateRate= #Sec#
 StringIndex=25
[Ms_Tmin1]
Measure= Plugin
 Plugin= WebParser
 URL=[Ms_Ob]
 UpdateRate= #Sec#
 StringIndex=7
 Substitute="&deg;":"","+":""
 
[Ms_Tmax1]
Measure= Plugin
 Plugin= WebParser
 URL=[Ms_Ob]
 UpdateRate= #Sec#
 StringIndex=8
 Substitute="&deg;":"","+":""
 
[Ms_Tmin2]
Measure= Plugin
 Plugin= WebParser
 URL=[Ms_Ob]
 UpdateRate= #Sec#
 StringIndex=11
 Substitute="&deg;":"","+":""
 
[Ms_Tmax2]
Measure= Plugin
 Plugin= WebParser
 URL=[Ms_Ob]
 UpdateRate= #Sec#
 StringIndex=12
 Substitute="&deg;":"","+":""
 
[Ms_Tmin3]
Measure= Plugin
 Plugin= WebParser
 URL=[Ms_Ob]
 UpdateRate= #Sec#
 StringIndex=15
 Substitute="&deg;":"","+":""
 
[Ms_Tmax3]
Measure= Plugin
 Plugin= WebParser
 URL=[Ms_Ob]
 UpdateRate= #Sec#
 StringIndex=16
 Substitute="&deg;":"","+":""
 
[Ms_Tmin4]
Measure= Plugin
 Plugin= WebParser
 URL=[Ms_Ob]
 UpdateRate= #Sec#
 StringIndex=19
 Substitute="&deg;":"","+":""
 
[Ms_Tmax4]
Measure= Plugin
 Plugin= WebParser
 URL=[Ms_Ob]
 UpdateRate= #Sec#
 StringIndex=20
 Substitute="&deg;":"","+":""
 
[Ms_Tmin5]
Measure= Plugin
 Plugin= WebParser
 URL=[Ms_Ob]
 UpdateRate= #Sec#
 StringIndex=23
 Substitute="&deg;":"","+":""
 
[Ms_Tmax5]
Measure= Plugin
 Plugin= WebParser
 URL=[Ms_Ob]
 UpdateRate= #Sec#
 StringIndex=24
 Substitute="&deg;":"","+":""
 
[Ms_Tmin6]
Measure= Plugin
 Plugin= WebParser
 URL=[Ms_Ob]
 UpdateRate= #Sec#
 StringIndex=27
 Substitute="&deg;":"","+":""
 
[Ms_Tmax6]
Measure= Plugin
 Plugin= WebParser
 URL=[Ms_Ob]
 UpdateRate= #Sec#
 StringIndex=28
 Substitute="&deg;":"","+":""
 
 
 
 
 ;---;---;---;---;---;---;---;---;---;---;---;---;---;---;---;---;---;---;---;---;---;---;---;---;---;---;---;---;---;---;---;---;---;---;---
[M_IconF]
Path="#CURRENTPATH#WeatherIcons"
MeasureName = Ms_Icon_F
Meter=Image
x=0
y=0
H=150
Hidden =  
DynamicVariables=1
[MeterQuote]
Meter=Image
MeasureName=MeasureQuote
X= 0
Y= 0

Hidden = 1


[M_T_F]
Meter=String
MeasureName=Ms_T_F
x=110
y=0
StringAlign=left
FontColor=#CT#
FontSize=30
StringStyle=#Style#
Postfix="°C"
AntiAlias=1
Substitute="+":""

[M_O_F]
Meter=String
MeasureName=Ms_O_F
x=#XF#
y=140
StringAlign=left
FontColor=#CT#
FontSize=10
StringStyle=#Style#
AntiAlias=1

[M_W]
Meter=String
MeasureName=Ms_W1
MeasureName2=Ms_W2
MeasureName3=Ms_W3
x=#XF#
y=R
StringAlign=left
FontColor=#CT#
FontSize=10
StringStyle=#Style#
Text=Ветер: %1  %2%3 м/с
AntiAlias=1

[M_Vl]
Meter=String
MeasureName=Ms_Vl
x=#XF#
y=R
StringAlign=left
FontColor=#CT#
FontSize=10
StringStyle=#Style#
Text=Влажность:  %1
AntiAlias=1

[M_Dav]
Meter=String
MeasureName=Ms_Dav
MeasureName2=Ms_Dav_3
x=#XF#
y=R
StringAlign=left
FontColor=#CT#
FontSize=10
StringStyle=#Style#
Text=Давление: %1 (#Plus#%2)
NumOfDecimals=1
DynamicVaribles=1
AntiAlias=1

[M_Den]
Meter=String
MeasureName=Ms_Den
x=#XF#
y=R
StringAlign=left
FontColor=#CT#
FontSize=10
StringStyle=#Style#
Text=День:  %1
[M_Wat]
Meter=STRING
MeasureName=Ms_Wat
MeasureName2=Ms_WatT
x=#XF#
y=R
FontColor=#CT1#
FontSize=10
FontFace=#Style#
Text=Вода: %1, %2 °C

[M_Icon1]
Meter=Image
MeasureName=Ms_Icon1
Path="#CURRENTPATH#WeatherIconsSmall"
x = #X1#
y = 0

[M_Icon2]
Meter=Image
MeasureName=Ms_Icon2
Path="#CURRENTPATH#WeatherIconsSmall"
x = #X1#
y = 70

[M_Icon3]
Meter=Image
MeasureName=Ms_Icon3
Path="#CURRENTPATH#WeatherIconsSmall"
x = #X1#
y = 140

[M_Icon4]
Meter=Image
MeasureName=Ms_Icon4
Path="#CURRENTPATH#WeatherIconsSmall"
x = #X3#
y = 0

[M_Icon5]
Meter=Image
MeasureName=Ms_Icon5
Path="#CURRENTPATH#WeatherIconsSmall"
x = #X3#
y = 70
[M_Icon6]
Meter=Image
MeasureName=Ms_Icon6
Path="#CURRENTPATH#WeatherIconsSmall"
x = #X3#
y = 140

[M_D1]
Meter=STRING
FontColor=#CT2#
FontSize=12
FontFace=#Style#
x=#X2#
y=30
text = Завтра
AntiAlias=1

[M_D2]
Meter=STRING
MeasureName=Ms_D2
FontColor=#CT2#
FontSize=12
FontFace=#Style#
x=#X2#
y=100
AntiAlias=1

[M_D3]
Meter=STRING
MeasureName=Ms_D3
FontColor=#CT2#
FontSize=12
FontFace=#Style#
x=#X2#
y=170
AntiAlias=1

[M_D4]
Meter=STRING
MeasureName=Ms_D4
FontColor=#CT2#
FontSize=12
FontFace=#Style#
x=#X4#
y=30
AntiAlias=1

[M_D5]
Meter=STRING
MeasureName=Ms_D5
FontColor=#CT2#
FontSize=12
FontFace=#Style#
x=#X4#
y=100
AntiAlias=1

[M_D6]
Meter=STRING
MeasureName=Ms_D6
FontColor=#CT2#
FontSize=12
FontFace=#Style#
x=#X4#
y=170
AntiAlias=1


[M_T1]
MeasureName =Ms_Tmin1
MeasureName2 =Ms_Tmax1
text = %1/%2
Meter=STRING
FontColor=#CT1#
FontSize=12
FontFace=#Style#
x=#X2#
y=50
AntiAlias=1

[M_T2]
MeasureName =Ms_Tmin2
MeasureName2 =Ms_Tmax2
text = %1/%2
Meter=STRING
FontColor=#CT1#
FontSize=12
FontFace=#Style#
x=#X2#
y=120
AntiAlias=1

[M_T3]
MeasureName =Ms_Tmin3
MeasureName2 =Ms_Tmax3
text = %1/%2
Meter=STRING
FontColor=#CT1#
FontSize=12
FontFace=#Style#
x=#X2#
y=190
AntiAlias=1

[M_T4]
MeasureName =Ms_Tmin4
MeasureName2 =Ms_Tmax4
text = %1/%2
Meter=STRING
FontColor=#CT1#
FontSize=12
FontFace=#Style#
x=#X4#
y=50
AntiAlias=1

[M_T5]
MeasureName =Ms_Tmin5
MeasureName2 =Ms_Tmax5
text = %1/%2
Meter=STRING
FontColor=#CT1#
FontSize=12
FontFace=#Style#
x=#X4#
y=120
AntiAlias=1

[M_T6]
MeasureName =Ms_Tmin6
MeasureName2 =Ms_Tmax6
text = %1/%2
Meter=STRING
FontColor=#CT1#
FontSize=12
FontFace=#Style#
x=#X4#
y=190
AntiAlias=1

[M-up]
Meter = Image 
ImageName = 2.png
LeftMouseDownAction = !Refresh "Roman\foreca2" "foreca.ini"
x = 570
y = 0

User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: It doesn't work !SetVariable.

Post by balala »

Rbuha wrote: January 15th, 2021, 2:31 pm Hello there! I apologize for my English. The dynamic variable does not work. [Ms_Dav_3] the formula calculates the difference, but if the difference is > 0 instead of+ the skin displays #Plus#. Help me find the error.
The DynamicVariables=1 option of the [M_Dav] meter is misswritten as DynamicVaribles=1 (the third a is missing). Replace the option.
Rbuha
Posts: 5
Joined: January 15th, 2021, 2:03 pm

Re: It doesn't work !SetVariable.

Post by Rbuha »

balala, thank you so much for your help!
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: It doesn't work !SetVariable.

Post by balala »

Rbuha wrote: January 16th, 2021, 2:39 am balala, thank you so much for your help!
Did it help? I suppose (hope) it did, but am I right?
However even if I am, I still have one more detail to add: I'd replace the IfAboveValue / IfAboveAction option pair of the [Ms_Dav_2] measure with the following IfCondition:

Code: Select all

[Ms_Dav_2]
...
IfCondition=(#CURRENTSECTION#>0)
IfTrueAction=[!SetVariable Plus "+"][!UpdateMeter "M_Dav"][!Redraw]
IfFalseAction=[!SetVariable Plus ""][!UpdateMeter "M_Dav"][!Redraw]
I'd do this because with the initial IfAction, if the value returned by the measure is positive, the Plus variable gets the + value, but if the value of the measure is negative, the Plus variable doesn't get a value and on the appropriate [M_Dav] meter you get a literal #Plus# variable (for instance something like Давление: 758,8 (#Plus#-1.0), which is not alright. Using the proposed IfCondition, such in a case you get Давление: 758,8 (-1.0), which seems much better.
Rbuha
Posts: 5
Joined: January 15th, 2021, 2:03 pm

Re: It doesn't work !SetVariable.

Post by Rbuha »

Yes, it helped.
I have already seen that this is not enough, I added:

Code: Select all

IfBelowValue=0
IfBelowAction =[!SetVariable Plus ""]
IfEqualValue =0
IfEqualAction =[!SetVariable Plus ""]
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: It doesn't work !SetVariable.

Post by balala »

Rbuha wrote: January 16th, 2021, 1:58 pm Yes, it helped.
I'm glad.
Rbuha wrote: January 16th, 2021, 1:58 pm I have already seen that this is not enough, I added:
Good this as well, however the IfCondition has an advantage in front of IfActions, namely that it's much shorter, being a much newer option. However your solution is good as well.