It is currently May 3rd, 2024, 9:32 am

It's never easy... };]

Get help with creating, editing & fixing problems with skins
CybOrSpasm
Posts: 146
Joined: January 8th, 2011, 7:12 pm
Location: Tennessee

It's never easy... };]

Post by CybOrSpasm »

I thought I could recycle the code that Smurfier gave me at the end of this topic
here: http://rainmeter.net/forum/viewtopic.php?f=5&t=13990&start=10 But once again, things are just never as easy as you think they should be... I am attempting to make my "window" not only show me the weather (which works fine), but also the sunrise, day, sunset, and night images according to the time of day. Here's the snippet that's not cooperating:

Code: Select all

[MeasureTime1]
Measure=Time
Formula=%H
IfAboveValue=06
IfAboveAction=[!DisableMeasure #CURRENTSECTION#][!EnableMeasure MeasureTime2][!SetVariable BGImage "#CURRENTPATH#\Images\Sunrise.jpg"][!UpdateMeter MeterOutside]
UpdateDivider=30

[MeasureTime2]
Measure=Time
Formula=%H
IfAboveValue=07
IfAboveAction=[!DisableMeasure #CURRENTSECTION#][!EnableMeasure MeasureTime3][!SetVariable BGImage "#CURRENTPATH#\Images\Day.jpg"][!UpdateMeter MeterOutside]
UpdateDivider=30
Disabled=1

[MeasureTime3]
Measure=Time
Formula=%H
IfAboveValue=18
IfAboveAction=[!DisableMeasure #CURRENTSECTION#][!EnableMeasure MeasureTime4][!SetVariable BGImage "#CURRENTPATH#\Images\SunSet.jpg"][!UpdateMeter MeterOutside]
UpdateDivider=30
Disabled=1

[MeasureTime4]
Measure=Time
Formula=%H
IfAboveValue=19
IfAboveAction=[!DisableMeasure #CURRENTSECTION#][!EnableMeasure MeasureTime1][!SetVariable BGImage "#CURRENTPATH#\Images\Night.jpg"][!UpdateMeter MeterOutside]
UpdateDivider=30
Disabled=1

;o0°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°0o
;                    Meters              
;o0°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°0o

[MeterOutside]
Meter=Image
ImageName=#BGImage#
X=60
Y=42
W=283
H=361
DynamicVariables=1
I am probably, once again, going about things all wrong, but I figured that if Smurfiers code worked so well the first time, I would try it again. };] Let me know what I am doing wrong this time, and thanks for all the help gang!
User avatar
Kaelri
Developer
Posts: 1721
Joined: July 25th, 2009, 4:47 am

Re: It's never easy... };]

Post by Kaelri »

Time measures use the Format option, not Formula, which is specific to Calc measures. Your code works for me after using the correct option name.

By the way, here's a simpler version of that:

Code: Select all

[MeasureTime]
Measure=Time
Format=%H
UpdateDivider=30

[MeasureBGImage]
Measure=Calc
Formula=((MeasureTime < 7) || (MeasureTime > 19)) ? 1 : ((MeasureTime = 7) ? 2 : ((MeasureTime = 19) ? 3 : 4))
Substitute="1":"Night","2":"Sunrise","3":"Sunset","4":"Day"

[MeterOutside]
Meter=Image
MeasureName=MeasureBGImage
ImageName=#CURRENTPATH#Images\%1.png
X=60
Y=42
W=283
H=361
CybOrSpasm
Posts: 146
Joined: January 8th, 2011, 7:12 pm
Location: Tennessee

Re: It's never easy... };]

Post by CybOrSpasm »

Darn code monkeys make it look soooo easy! };] Darn pesky Syntaxes and Maths! Worse than termites in a wooden leg!

Looks like it's working so far! };] I thank you kindly Kaelri, and I will let you off the hook for trying to figure out how to get each image to slowly fade into the next over the course of an hour. I can live with this! :D }:]