It is currently March 28th, 2024, 10:47 am

'If Match' not working properly

Get help with creating, editing & fixing problems with skins
Post Reply
SparkShredder
Posts: 50
Joined: November 17th, 2017, 12:00 pm

'If Match' not working properly

Post by SparkShredder »

Okay, this is the code

Code: Select all

[DeviantParser]
Measure=Webparser
URL=https://www.deviantart.com/sparkshredder/art/Bumblebee-Rainmeter-Skin-775793592
RegExp=(?siU)Version Code: (.*)Last Updated(.*) ;----.*&#166;&#166; (V .*)-.* ;-(.*)<br /><br />
FinishAction=[!EnableMeasureGroup Updater][!UpdateMeter *][!Redraw]
;---To Prevent Update Notification on Connection Failure, UpdateChecker is disabled.

[UpdateChecker]
Measure=Webparser
Url=[DeviantParser]
StringIndex=1
Substitute=" ":""
IfMatch=#VersionCode#
IfMatchAction=[!SetOption Stinger ImageTint "#Color2#"][!HideMeterGroup Updater][!Redraw]
IfNotMatchAction=[!SetOption Stinger ImageTint "#Color3#"][!ShowMeterGroup Updater][!Redraw]
Group=Updater
Disabled=1

;----OtherMeter
;##########

;-----Update Meters
[UpdateHead]
Meter=Shape
Shape=Line 0,0,250,0 | Stroke Color #Color2#,255 | StrokeWidth 2
Group=Updater
Hidden=1
X=220
Y=0

[UpdateBg]
Meter=Shape
Shape=Rectangle 0,4,250,120 | Extend UpdateBgFill | StrokeWidth 0
UpdateBgFill=Fill Color #BackGround#
MouseOverAction=[!SetOption UpdateBg UpdateBgFill "Fill Color #HoverGround#"][!UpdateMeter UpdateBg][!Redraw]
MouseLeaveAction=[!SetOption UpdateBg UpdateBgFill "Fill Color #BackGround#"][!UpdateMeter UpdateBg][!Redraw]
LeftMouseDoubleClickAction=[#SkinLink#]
Group=Updater
Hidden=1
X=r
Y=r

[UpdateInfo]
Meter=String
MeasureName=UpdateFeatures
MeasureName2=LastUpdated
MeasureName3=LatestVersion
MeterStyle=TextStyle1
InlineSetting=Color | #color3#
InlinePattern=^(.*): V
Text=%3 %2%1
ClipString=1
Group=Updater
Hidden=1
X=5r
Y=5r
W=240
H=110

The String Value Webparser gets is exactly "20181208" not a single space, Version code=20181210
But still it has no effect
Thanks,
Screenshot (66).png
Last edited by SparkShredder on December 15th, 2018, 9:50 am, edited 1 time in total.
User avatar
balala
Rainmeter Sage
Posts: 16109
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: 'If Match' not working properly

Post by balala »

You haven't posted the whole code. For example I don't see the [Variables] section, to see how is defined the VersionInfo variable. I know you said:
SparkShredder wrote: December 11th, 2018, 1:03 pm The String Value Webparser gets is exactly "20181208" not a single space, Version code=20181210
but in this case what is the defined value of the VersionCode variable, 20181208, or 20181210? Because it matters.
However with a properly set value, the IfMatch is executed well. Nor can it be different, the IfMatch is widely used and it always works.
SparkShredder
Posts: 50
Joined: November 17th, 2017, 12:00 pm

Re: 'If Match' not working properly

Post by SparkShredder »

balala wrote: December 11th, 2018, 1:23 pm You haven't posted the whole code. For example I don't see the [Variables] section, to see how is defined the VersionInfo variable. I know you said:

but in this case what is the defined value of the VersionCode variable, 20181208, or 20181210? Because it matters.
However with a properly set value, the IfMatch is executed well. Nor can it be different, the IfMatch is widely used and it always works.
Variables are in separate file
Here's all included in it

Code: Select all

[Variables]
Color1=255,255,255
Color2=218,165,28
Color3=225,0,0
Color4=0,0,0
;---
BackGround=20,20,20,1
HoverGround=20,20,20,100
;---Transparency level with max of 255 for clickable Images
StaticAlpha=255
HoverAlpha=200
;---
StaticBack=40,40,40,80
HoverBack=50,50,50,100
;---
Font1=Cyberverse Condensed
Font2=Autobus
;---
Version=1.0
LastUpdate=08-12-2018
VersionCode=20181210
;----------
SkinLink=https://www.deviantart.com/sparkshredder/art/Bumblebee-Rainmeter-Skin-775793592
;https://www.deviantart.com/sparkshredder/art/Cybertronians-Rainmeter-Skin-767683472
;----------
;Amount by which system volume changes per click
VolChange=5
;----------
Letters=Auto
;-Defne Leters=Auto to let the skin automatically detect Drive letters
;-Define Letters=Uset to show drives of your choice decribed below.
;-If there are less than 4 drives on your device, co-responding meters will be hidden
;-Same for variables left blank while using Letters=User, while Variables empty, start from Drive6 to above
;-If there are less than 4 drives while using Auto, removable disks will be shown in empty meters, whenever connected
; while User will show mentioned Letters only.
Drive1=C:
Drive2=D:
Drive3=E:
Drive4=F:
Drive5=
Drive6=
; Be sure to Put ':' after Drive Letter
;----------
RSToggle=10
;-Time in about secs for Ram-Swap info to toggle
;----------
;----------
LaunchName1= HTML Folder
LaunchPath1=F:\Docs\HTML

LaunchName2= SparkShredder HTML
LaunchPath2=F:\Docs\HTML\SparkShredder

LaunchName3=WallPapers
LaunchPath3=F:\A.O.M\Wallpapers

LaunchName4= My Downloads
LaunchPath4=E:\Downloads

LaunchName5= Sys Downloads
LaunchPath5=C:\Users\Rajnoor Brar\Downloads\MEmu Download

LaunchName6= Documents
LaunchPath6=C:\Users\Rajnoor Brar\Documents
;----------
PlayerName=CAD
PlayerPath=C:\Program Files (x86)\MusicBee\MusicBee.exe
;;Up for single player,, below for double
;Player 1 has higher priority, in case they run together, rest depends on their playing, paused, stopped condition.
Player1Name=CAD
Player1Path=C:\Program Files (x86)\MusicBee\MusicBee.exe

Player2Name=AIMP
Player2Path=C:\Program Files (x86)\AIMP\aimp.exe

;---
Here's complete Skin code

Code: Select all

[Rainmeter]
Update=100
DefaultUpdateDivider=-1
OnWakeAction=[!Refresh]
AccurateText=1

[Metadata]
Name=Bumblebee
Author=SparkShredder
Information=Bumblebee's Official Insignia | Click on the Insignia to Edit Variables | Turns Red to Notify if an Update is available to the Skin and Shows 'Update Available', Clicking it Opens the DeviantArt Page.
Version=1.0
License=Creative Commons Attribution-NonCommercial Share-Alike 4.0 International

;----------Variables

@include=#@#Variables.inc

[Variables]
FirstTime=0

;----------Meter-Styles

@include2=#@#Styles.inc

;----------Skin
[FirstTime]
Measure=Calc
Formula=#FirstTime#
IfEqualValue=1
IfEqualAction=[!SetWallpaper "#@#Bumblebee.jpg" Stretch][!WriteKeyValue Variables FirstTime 0]
Disabled=1

[DeviantParser]
Measure=Webparser
URL=#SkinLink#
RegExp=(?siU)Version Code: (.*)Last Updated(.*) ;----.*&#166;&#166; (V .*)-.* ;-(.*)<br /><br />
FinishAction=[!EnableMeasureGroup Updater][!UpdateMeter *][!Redraw]
;---To Prevent Update Notification on Connection Failure, UpdateChecker is disabled.

[UpdateChecker]
Measure=Webparser
Url=[DeviantParser]
StringIndex=1
Substitute=" ":""
IfMatch=#VersionCode#
IfMatchAction=[!SetOption Stinger ImageTint "#Color2#"][!HideMeterGroup Updater][!UpdateMeter *][!Redraw]
IfNotMatchAction=[!SetOption Stinger ImageTint "#Color3#"][!ShowMeterGroup Updater][!UpdateMeter *][!Redraw]
Group=Updater
Disabled=1
;---There were some issues with matching x.x.yyyymmdd Version format, so had use a Versioncode method.

[LastUpdated]
Measure=Webparser
Url=[DeviantParser]
StringIndex=2
Disabled=1
Group=Updater

[LatestVersion]
Measure=Webparser
Url=[DeviantParser]
StringIndex=3
Disabled=1
Group=Updater

[UpdateFeatures]
Measure=Webparser
Url=[DeviantParser]
StringIndex=4
Substitute="&nbsp; &nbsp; ":"","<br />":"#CRLF#"
Disabled=1
Group=Updater

[StingerHead]
Meter=Shape
Shape=Line 0,0,250,0 | Stroke Color #Color2#,255 | StrokeWidth 2
X=0
Y=0

[StingerBg]
Meter=Shape
Shape=Rectangle 0,4,220,120 | Extend StingerBgFill | StrokeWidth 0
StingerBgFill=Fill Color #BackGround#
MouseOverAction=[!SetOption StingerBg StingerBgFill "Fill Color #HoverGround#"][!UpdateMeter StingerBg][!Redraw]
MouseLeaveAction=[!SetOption StingerBg StingerBgFill "Fill Color #BackGround#"][!UpdateMeter StingerBg][!Redraw]
X=r
Y=r

[Stinger]
Meter=Button
ButtonImage=#@#Images/Sting.png
ImageTint=#color2#
ButtonCommand=["#@#Variables.inc"]
W=200
H=108
X=10r
Y=10r

[VersionCurrent]
Meter=String
MeterStyle=TextStyle1
Text=V #Version#
StringAlign=Right
X=80r
Y=90r

[UpdateAvailable]
Meter=String
MeterStyle=TextStyle2
Text=Update Available
LeftMouseUpAction=[#SkinLink#]
StringAlign=Left
X=40r
Y=-2r
Hidden=1
;-----
[UpdateHead]
Meter=Shape
Shape=Line 0,0,250,0 | Stroke Color #Color2#,255 | StrokeWidth 2
Group=Updater
Hidden=1
X=220
Y=0

[UpdateBg]
Meter=Shape
Shape=Rectangle 0,4,250,120 | Extend UpdateBgFill | StrokeWidth 0
UpdateBgFill=Fill Color #BackGround#
MouseOverAction=[!SetOption UpdateBg UpdateBgFill "Fill Color #HoverGround#"][!UpdateMeter UpdateBg][!Redraw]
MouseLeaveAction=[!SetOption UpdateBg UpdateBgFill "Fill Color #BackGround#"][!UpdateMeter UpdateBg][!Redraw]
LeftMouseDoubleClickAction=[#SkinLink#]
Group=Updater
Hidden=1
X=r
Y=r

[UpdateInfo]
Meter=String
MeasureName=UpdateFeatures
MeasureName2=LastUpdated
MeasureName3=LatestVersion
MeterStyle=TextStyle1
Text=%3 %2%1
ClipString=1
Group=Updater
Hidden=1
X=5r
Y=5r
W=240
H=110
Here are meter styles

Code: Select all

[TextStyle1]
FontColor=#Color1#,255
FontEffectColor=0,0,0,80
StringEffect=BORDER
StringStyle=NORMAL
FontFace=#Font2#
AntiAlias=1

[TextStyle2]
FontColor=#Color1#,255
FontEffectColor=255,0,0,30
StringEffect=BORDER
StringStyle=NORMAL
FontFace=#Font1#
AntiAlias=1

[TextStyle3]
FontColor=#Color3#,250
FontEffectColor=0,0,0,120
StringEffect=BORDER
StringStyle=NORMAL
FontFace=#Font1#
AntiAlias=1

[BarText]
FontColor=#Color4#,255
FontEffectColor=#Color1#,80
StringEffect=BORDER
StringStyle=NORMAL
FontFace=#Font2#
AntiAlias=1
User avatar
balala
Rainmeter Sage
Posts: 16109
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: 'If Match' not working properly

Post by balala »

The FinishAction option of the [DeviantParser] measure, beside enabling the child measures, should also update them. For this, just add a [!UpdateMeasureGroup Updater] bang in the FinishAction option: FinishAction=[!EnableMeasureGroup Updater][!UpdateMeasureGroup Updater][!UpdateMeter *][!Redraw].
SparkShredder
Posts: 50
Joined: November 17th, 2017, 12:00 pm

Re: 'If Match' not working properly

Post by SparkShredder »

balala wrote: December 11th, 2018, 1:51 pm The FinishAction option of the [DeviantParser] measure, beside enabling the child measures, should also update them. For this, just add a [!UpdateMeasureGroup Updater] bang in the FinishAction option: FinishAction=[!EnableMeasureGroup Updater][!UpdateMeasureGroup Updater][!UpdateMeter *][!Redraw].
It worked!
Thanks, but,
isn't it like, when measure are enabled, they are updated instantly as well, automatically, rather than by separate bangs?
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: 'If Match' not working properly

Post by jsmorley »

SparkShredder wrote: December 11th, 2018, 2:02 pm It worked!
Thanks, but,
isn't it like, when measure are enabled, they are updated instantly as well, automatically, rather than by separate bangs?
No, you wouldn't necessarily always want that. Enabling them simply "turns them on", so they are updated in the normal course of events.
Post Reply