It is currently April 16th, 2024, 9:08 pm

Help with IfCondition

Get help with creating, editing & fixing problems with skins
User avatar
CyberTheWorm
Posts: 860
Joined: August 22nd, 2016, 11:32 pm
Location: Surrey, B.C., Canada

Help with IfCondition

Post by CyberTheWorm »

I'm trying to do a meter that displays a line depending on the day.
Day.PNG
I'm having trouble getting the IfCondition to work, not sure what I'm doing wrong.

Code: Select all

[Rainmeter]
Update=1000
UpdateDivider=3600
BackgroundMode=2
SolidColor=0,0,0,0

[Metadata]
Name=Day Clock
Author=Graham Wedepohl
Information=If you only care about what day it is
License=Creative Commons Attribution-Non-Commercial-Share Alike 3.0
Version=1.0.0

[MeasureDay]
Measure=Time
Format=%u

[MeterClockFace]
Meter=Image
ImageName=#@#\Images\day.png
W=250
H=250

[MeterDay]
Meter=ROUNDLINE
MeasureName=MeasureDay
X=0
Y=0
W=250
H=250
LineLength=80
LineColor=255,0,0,255
LineWidth=8
AntiAlis=1
;MondayStartAngle=5.6
;TuesdayStartAngle=0.2
;WednesdayStartAngle=1.1
;TuesdayStartAngle=2
;FridayStartAngle=3
;SaturdayStartAngle=3.85
;SundayStartAngle=4.7
IfCondition=MeasureDay = 1
IfTrueAction=[!SetOption StartAngle=5.6][!Redraw]
IfCondition1=MeasureDay = 2
IfTrueAction1=[!SetOption StartAngle=0.2][!Redraw]
IfCondition2=MeasureDay = 3
IfTrueAction2=[!SetOption StartAngle=1.1][!Redraw]
IfCondition3=MeasureDay = 4
IfTrueAction3=[!SetOption StartAngle=2][!Redraw]
IfCondition4=MeasureDay = 5
IfTrueAction4=[!SetOption StartAngle=3][!Redraw]
IfCondition5=MeasureDay = 6
IfTrueAction5=[!SetOption StartAngle=3.8][!Redraw]
IfCondition6=MeasureDay = 7
IfTrueAction6=[!SetOption StartAngle=4.7][!Redraw]

[MeterDate]
Meter=String
MeasureName=MeasureDay
X=125r
Y=250r
StringAlign=Center
FontColor=255,255,255,255
FontFace=Segoe UI
FontSize=17
StringEffect=Shadow
FontEffectColor=0,0,0,255
AntiAlias=1
Text=%1
You do not have the required permissions to view the files attached to this post.
The only source of knowledge is experience. Albert Einstein
Deviant Art Page
User avatar
fonpaolo
Moderator
Posts: 1387
Joined: April 11th, 2013, 8:08 pm
Location: Italy

Re: Help with IfCondition

Post by fonpaolo »

You have to tell were it have to apply the changes...
Maybe:
- IfTrueAction=[!SetOption MeterDay StartAngle "5.6"]
or:
-IfTrueAction=[!SetOption "#CURRENTSECTION#" StartAngle "5.6"]
User avatar
balala
Rainmeter Sage
Posts: 16142
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Help with IfCondition

Post by balala »

Beside what fonpaolo wrote, keep in mind that you can't use the IfConditions on meters, just on measures. Fix the structure of them, as fonpaolo said and move them from the [MeterDay] meter to the [MeasureDay] measure.
User avatar
fonpaolo
Moderator
Posts: 1387
Joined: April 11th, 2013, 8:08 pm
Location: Italy

Re: Help with IfCondition

Post by fonpaolo »

balala wrote:Beside what fonpaolo wrote, keep in mind that you can't use the IfConditions on meters, just on measures. Fix the structure of them, as fonpaolo said and move them from the [MeterDay] meter to the [MeasureDay] measure.
This is the reason why balala is a Rainmeter sage and not me, I looked at the code, but not where it was placed... ;-)
User avatar
balala
Rainmeter Sage
Posts: 16142
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Help with IfCondition

Post by balala »

fonpaolo wrote:This is the reason why balala is a Rainmeter sage and not me, I looked at the code, but not where it was placed... ;-)
Yeah fonpaolo, but your observation about the structure of the !SetOption bangs is just as important. It is a same kind of problem, which also don't let the code to properly work.