It is currently April 25th, 2024, 3:01 pm

IfConditions Cross Referencing 2 Measures

Get help with creating, editing & fixing problems with skins
justsomeguyhere
Posts: 20
Joined: July 12th, 2019, 7:29 pm

IfConditions Cross Referencing 2 Measures

Post by justsomeguyhere »

Hey, I was just wondering if I could get some help with some IfConditions. What I want to do is be able to have two (technically three but not all at once) Measures (in my case current local time and time of sunrise and sunset) reference each other and at certain times change an image in a separate meter. Let me explain better.

Someone made a dope skin that recreates the Clock Town clock from the Legend of Zelda Majora's Mask. The clock rotates the second hand, the minute markers rotate, and the interior rotates too. If you know what the clock looks like, there is the center piece and within that there is a disc rotating on the z axis that displays either a sun or a moon. What I want to do is, say it's 5 hours to sunset, I want to take the image that exists and (externally) edit it and then have it displayed when it's 5 hours until sunset or 5 hours to sunrise.

How would I do this? Is this even possible?

Code: Select all

[Rainmeter]
Update=75

[MeasureParent]
Measure=Plugin
Plugin=WebParser
UpdateRate=1800
URL="https://query.yahooapis.com/v1/public/yql?q=select%20astronomy.sunrise%2C%20astronomy.sunset%20from%20weather.forecast%20where%20woeid%20in%20(select%20woeid%20from%20geo.places(1)%20where%20text%3D%22new%20haven%2C%20ct%22)&format=xml&env=store%3A%2F%2Fdatatables.org%2Falltableswithkeys"
RegExp="(?siU)<yweather:astronomy .*sunrise="(.*):(.*) (.*)" sunset="(.*):(.*) (.*)""
Debug=1

[MeasureAstronomySunriseHour]
Measure=Plugin
Plugin=WebParser
URL=[MeasureParent]
StringIndex=1

[MeasureAstronomySunriseMin]
Measure=Plugin
Plugin=WebParser
URL=[MeasureParent]
StringIndex=2

[MeasureAstronomySunriseAMPM]
Measure=Plugin
Plugin=WebParser
URL=[MeasureParent]
StringIndex=3
Substitute="am":"0","pm":"1"

[MeasureAstronomySunsetHour]
Measure=Plugin
Plugin=WebParser
URL=[MeasureParent]
StringIndex=4

[MeasureAstronomySunsetMin]
Measure=Plugin
Plugin=WebParser
URL=[MeasureParent]
StringIndex=5

[MeasureAstronomySunsetAMPM]
Measure=Plugin
Plugin=WebParser
URL=[MeasureParent]
StringIndex=6
Substitute="am":"0","pm":"1"

[MeasureCurrent]
Measure=Calc
Formula=( 60 * MeasureCurrentHour + MeasureCurrentMin )

[MeasureToSunrise]
Measure=Calc
Formula=( MeasureAstronomySunrise - MeasureCurrent )

[MeasureToSunset]
Measure=Calc
Formula=( MeasureAstronomySunset - MeasureCurrent )

[SunsetShift]
Measure=Time
[Refresher]
Measure=Time
Format=%S
IfEqualValue=0
IfEqualAction=!Redraw

[MeasureTime]
Measure=Time
AverageSize=20

[MeasureSeconds]
Measure=Calc
Formula=MeasureTime%60

[MeasureSecondsSpringing]
Measure=Calc
Formula=Trunc(MeasureSeconds) + Frac(MeasureSeconds) ** 5
MinValue=0
MaxValue=60

[MeasureDayNight]
Measure=Calc
Formula=Abs(Trunc(MeasureTime/3600%24) - 11.5) <= 6? 0: 1

[MeasureHourFileName]
Measure=String
String=hours[MeasureDayNight].png
DynamicVariables=1

[MeasureShifter]
Measure=Time
Format=%H.%M
IfCondition=MeasureTime = 00.00
IfTrueAction=
IfCondition2=MeasureTime = 
IfTrueAction2=

[MeterHours]
MeasureName=MeasureTime
Meter=Rotator
ImageName=[MeasureHourFileName]
ValueRemainder=43200
X=150
Y=150
StartAngle=0
RotationAngle=6.2832
OffsetX=96
OffsetY=96
DynamicVariables=1

[MeterMinutes]
MeasureName=MeasureTime
Meter=Rotator
ImageName=minutes.png
ValueRemainder=3600
StartAngle=0
RotationAngle=6.2832
OffsetX=125
OffsetY=125
W=250
H=250
Padding=25,25,25,25

[MeterSeconds]
MeasureName=MeasureSecondsSpringing
Meter=Rotator
ImageName=seconds.png
X=150
Y=150
StartAngle=0
RotationAngle=6.2832
OffsetX=10
OffsetY=130 
And yeah it's a little messy.
Last edited by eclectic-tech on July 20th, 2019, 5:18 am, edited 2 times in total.
Reason: Please use code tags. It is the </> symbol.
User avatar
balala
Rainmeter Sage
Posts: 16169
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: IfConditions Cross Referencing 2 Measures

Post by balala »

justsomeguyhere wrote: July 19th, 2019, 9:13 pm What I want to do is, say it's 5 hours to sunset, I want to take the image that exists and (externally) edit it and then have it displayed when it's 5 hours until sunset or 5 hours to sunrise.
Not sure I completely understood what you want, however I'd say you have to add proper IfConditions (as you probably have figured it out by yourself). That's why it's hard to help and even more, there are a few more problems: the [MeasureAstronomySunrise] and [MeasureAstronomySunset] measures are missing, plus, at least for me, the WebParser measures don't work (getting a (Fetch error) The server name or address could not be resolved (ErrorCode=12007) error message in the log).
So, these being said, my tip is you have to add some IfConditions to [MeasureToSunrise] and [MeasureToSunset] measures, something like:

Code: Select all

[MeasureToSunrise]
...
IfCondition=(#CURRENTSECTION#=5*60)
IfTrueAction=...

[MeasureToSunset]
...
IfCondition=(#CURRENTSECTION#=5*60)
IfTrueAction=...
Not sure what you want to do when there are five hours until Sunrise / Sunset, that's why I didn't post IfTrueAction options above. So, what's your intention? Please give us more details to can help you.
justsomeguyhere
Posts: 20
Joined: July 12th, 2019, 7:29 pm

Re: IfConditions Cross Referencing 2 Measures

Post by justsomeguyhere »

Here I think I figured out exactly what I needed to do. Thank you so much for your help, man. Here's the full skin. http://bit.ly/rmskin1
User avatar
balala
Rainmeter Sage
Posts: 16169
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: IfConditions Cross Referencing 2 Measures

Post by balala »

justsomeguyhere wrote: July 20th, 2019, 4:48 pm Here I think I figured out exactly what I needed to do. Thank you so much for your help, man. Here's the full skin. http://bit.ly/rmskin1
I'm glad if you got it working, however there are more errors in your code:
  • The WebParser measures don't work. In fact as I said, I get an error message in the log, telling that the WebParser measure can't get the information. As far as I can say, YahooApis doesn't work any more, you can't use it.
  • There are three measures which don't exist: [MeasureAstronomySunset], [MeasureAstronomySunrise] and [MeasureCurrentHour]. These missing measures give three other error messages in the log (please check the log!).
  • None of the posted IfConditions don't work, because all first options have a not required 1 index. I mean that the first IfCondition isn't IfCondition1, but simply IfCondition (without the 1). Same for IfTrueAction and IfFalseAction. All further IfConditions have the appropriate index (starting from 2), but the first one doesn't have it. Due to this, none of the conditions work.
justsomeguyhere
Posts: 20
Joined: July 12th, 2019, 7:29 pm

Re: IfConditions Cross Referencing 2 Measures

Post by justsomeguyhere »

So I fixed the missing Measures issue and the Web Parser issue. All that I'm getting errors for are my IfConditions. Is there any solution for that?

https://drive.google.com/open?id=1_FcaHbqEK-he4aQm16gTNXU2Hxrn2sLp
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5406
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: IfConditions Cross Referencing 2 Measures

Post by eclectic-tech »

justsomeguyhere wrote: July 23rd, 2019, 12:44 am So I fixed the missing Measures issue and the Web Parser issue. All that I'm getting errors for are my IfConditions. Is there any solution for that?

https://drive.google.com/open?id=1_FcaHbqEK-he4aQm16gTNXU2Hxrn2sLp
Almost there... I eliminated the errors in the log 1-by-1.

First, I changed Debug=2 to Debug=1 so webparser measure is not saving the page on every update.

You referenced a non-existing measure (MeasureTimeAdjustSunrise) in the formula of section [MeasureToSunrise].
I changed it to use MeasureAstronomySunriseHour

You are setting variables for SunriseTime and SunsetTime in measures [MeasureToSunrise] and [MeasureToSunset], so you need to add DynamicVariables=1 to the measure that uses them in the IfConditions tests [MeasureDayNight].

There was a syntax error in the !SetOption bang in section [MeasureDayNight]; you had an equal sign after "Formula"; I corrected the syntax and added quotation marks to denote each parameter.

Those changes eliminated the errors. Lastly, I modified the values to align your rotator meters around a common point with 5 pixels spacing at top and left. And centered your digital clock.

clocktown.png
Here is a modified "Modernized.ini" You can copy and paste this code, save it as a variant in your ClockTown folder, refresh Rainmeter and load it to see the differences

Code: Select all

[Rainmeter]
Update=75

[MeasureParent]
Measure=Plugin
Plugin=WebParser
UpdateRate=1800
URL=http://wxdata.weather.com/wxdata/weather/local/USNH0102?cc=*&unit=f&dayf=6
RegExp=(?siU)<sunr>(.*):(.*) (.*)</sunr>.*<suns>(.*):(.*) (.*)</suns>
Debug=1

[MeasureAstronomySunriseHour]
Measure=Plugin
Plugin=WebParser
URL=[MeasureParent]
StringIndex=1

[MeasureAstronomySunriseMin]
Measure=Plugin
Plugin=WebParser
URL=[MeasureParent]
StringIndex=2

[MeasureAstronomySunriseAMPM]
Measure=Plugin
Plugin=WebParser
URL=[MeasureParent]
StringIndex=3
Substitute="am":"0","pm":"1"

[MeasureAstronomySunsetHour]
Measure=Plugin
Plugin=WebParser
URL=[MeasureParent]
StringIndex=4

[MeasureAstronomySunsetMin]
Measure=Plugin
Plugin=WebParser
URL=[MeasureParent]
StringIndex=5

[MeasureAstronomySunsetAMPM]
Measure=Plugin
Plugin=WebParser
URL=[MeasureParent]
StringIndex=6
Substitute="am":"0","pm":"1"

[MeasureTimeAdjustSunset]
Measure=Calc
Formula=( MeasureAstronomySunsetHour + (12 * MeasureAstronomySunsetAMPM ) + MeasureAstronomySunsetMin )

[MeasureTimeAdjustSunset]
Measure=Calc
Formula=( MeasureAstronomySunriseHour + (12 * MeasureAstronomySunriseAMPM ) + MeasureAstronomySunriseMin )

[MeasureCurrentHour]
Measure=Calc
Formula=MeasureTime/3600%12

[MeasureCurrentMin]
Measure=Calc
Formula=MeasureCurrentHour/60%12

[MeasureCurrent]
Measure=Calc
Formula=( 60 * MeasureCurrentHour + MeasureCurrentMin )

[MeasureToSunrise]
Measure=Calc
Formula=( MeasureAstronomySunriseHour - MeasureCurrent )
;Formula=( MeasureTimeAdjustSunrise - MeasureCurrent )
IfCondition=(#CURRENTSECTION#<=5*60) && (#CURRENTSECTION#>4*60)
IfTrueAction=[!SetVariable SunriseTime 5]
IfFalseAction=[!SetVariable SunriseTime 12]
IfCondition2=(#CURRENTSECTION#<=4*60) && (#CURRENTSECTION#>3*60)
IfTrueAction2=[!SetVariable SunriseTime 4]
IfFalseAction2=[!SetVariable SunriseTime 12]
IfCondition3=(#CURRENTSECTION#<=3*60) && (#CURRENTSECTION#>2*60)
IfTrueAction3=[!SetVariable SunriseTime 3]
IfFalseAction3=[!SetVariable SunriseTime 12]
IfCondition4=(#CURRENTSECTION#<=2*60) && (#CURRENTSECTION#>1*60)
IfTrueAction4=[!SetVariable SunriseTime 2]
IfFalseAction4=[!SetVariable SunriseTime 12]
IfCondition5=(#CURRENTSECTION#<=1*60) && (#CURRENTSECTION#>0*60)
IfTrueAction5=[!SetVariable SunriseTime 1]
IfFalseAction5=[!SetVariable SunriseTime 12]

[MeasureToSunset]
Measure=Calc
Formula=( MeasureAstronomySunsetHour - MeasureCurrent )
IfCondition=(#CURRENTSECTION#<=5*60) && (#CURRENTSECTION#>4*60)
IfTrueAction=[!SetVariable SunsetTime 5] 
IfFalseAction=[!SetVariable SunsetTime 24]
IfCondition2=(#CURRENTSECTION#<=4*60) && (#CURRENTSECTION#>3*60)
IfTrueAction2=[!SetVariable SunsetTime 4]
IfFalseAction2=[!SetVariable SunsetTime 24]
IfCondition3=(#CURRENTSECTION#<=3*60) && (#CURRENTSECTION#>2*60)
IfTrueAction3=[!SetVariable SunsetTime 3]
IfFalseAction3=[!SetVariable SunsetTime 24]
IfCondition4=(#CURRENTSECTION#<=2*60) && (#CURRENTSECTION#>1*60)
IfTrueAction4=[!SetVariable SunsetTime 2]
IfFalseAction4=[!SetVariable SunsetTime 24]
IfCondition5=(#CURRENTSECTION#<=1*60) && (#CURRENTSECTION#>0*60)
IfTrueAction5=[!SetVariable SunsetTime 1]
IfFalseAction5=[!SetVariable SunsetTime 24]

[Refresher]
Measure=Time
Format=%S
IfEqualValue=0
IfEqualAction=!Redraw

[MeasureTime]
Measure=Time
AverageSize=20

[MeasureSeconds]
Measure=Calc
Formula=MeasureTime%60

[MeasureSecondsSpringing]
Measure=Calc
Formula=Trunc(MeasureSeconds) + Frac(MeasureSeconds) ** 5
MinValue=0
MaxValue=60

[MeasureDayNight]
Measure=Calc
Formula=Abs(Trunc(MeasureTime/3600%24) - 11.5) <= 6? 12: 24
IfCondition=(#SunsetTime# = 5) || (#SunriseTime# = 1)
IfTrueAction=[!SetOption MeasureDayNight Formula=5]
IfFalseAction=[!SetOption MeasureDayNight Formula "Abs(Trunc(MeasureTime/3600%24) - 11.5) <= 6? 12: 24"]
IfCondition2=(#SunsetTime# = 4) || (#SunriseTime# = 2)
IfTrueAction2=[!SetOption MeasureDayNight Formula=4]
IfFalseAction2=[!SetOption MeasureDayNight Formula "Abs(Trunc(MeasureTime/3600%24) - 11.5) <= 6? 12: 24"]
IfCondition3=(#SunsetTime# = 3) || (#SunriseTime# = 3)
IfTrueAction3=[!SetOption MeasureDayNight Formula=3]
IfFalseAction3=[!SetOption MeasureDayNight Formula "Abs(Trunc(MeasureTime/3600%24) - 11.5) <= 6? 12: 24"]
IfCondition4=(#SunsetTime# = 2) || (#SunriseTime# = 4)
IfTrueAction4=[!SetOption MeasureDayNight Formula=2]
IfFalseAction4=[!SetOption MeasureDayNight Formula "Abs(Trunc(MeasureTime/3600%24) - 11.5) <= 6? 12: 24"]
IfCondition5=(#SunsetTime# = 1) || (#SunriseTime# = 5)
IfTrueAction5=[!SetOption MeasureDayNight Formula=1]
IfFalseAction5=[!SetOption MeasureDayNight Formula "Abs(Trunc(MeasureTime/3600%24) - 11.5) <= 6? 12: 24"]
DynamicVariables=1

[MeasureHourFileName]
Measure=String
String=hours[MeasureDayNight].png
DynamicVariables=1

[MeasureShifter]
Measure=Time
Format=%H.%M
IfCondition=MeasureTime = 00.00
IfTrueAction=
IfCondition2=MeasureTime = 
IfTrueAction2=

[MeterHours]
MeasureName=MeasureTime
Meter=Rotator
ImageName=[MeasureHourFileName]
ValueRemainder=43200
X=130
Y=130
StartAngle=0
RotationAngle=6.2832
OffsetX=96
OffsetY=96
DynamicVariables=1

[MeterMinutes]
MeasureName=MeasureTime
Meter=Rotator
ImageName=minutes.png
ValueRemainder=3600
StartAngle=0
RotationAngle=6.2832
OffsetX=125
OffsetY=125
W=260
H=260
;Padding=25,25,25,25

[MeterSeconds]
MeasureName=MeasureSecondsSpringing
Meter=Rotator
ImageName=seconds.png
X=130
Y=130
StartAngle=0
RotationAngle=6.2832
OffsetX=10
OffsetY=130

[Time]
Meter=String
MeasureName=MeasureTime
FontFace=Century Gothic
FontSize=10
FontColor=20,100,255,255
StringAlign=Center
X=130
Y=260
AntiAlias=1
You do not have the required permissions to view the files attached to this post.
User avatar
balala
Rainmeter Sage
Posts: 16169
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: IfConditions Cross Referencing 2 Measures

Post by balala »

eclectic-tech wrote: July 23rd, 2019, 2:20 am Here is a modified "Modernized.ini" You can copy and paste this code, save it as a variant in your ClockTown folder, refresh Rainmeter and load it to see the differences
eclectic-tech, unfortunately I believe that's not so simple.
The most important inadvertence in your code is in the Formula options of the [MeasureToSunrise] and [MeasureToSunset] measures. For instance in case of [MeasureToSunrise], extracting the current time (returned in minutes by the [MeasureCurrent] measure) from the Sunrise hour (returned by [MeasureAstronomySunriseHour]) doesn't look alright. Instead I'd use a little bit more complicated formula to calculate the differences:

Code: Select all

[MeasureToSunrise]
...
Formula=(( 60 * ( (( MeasureAstronomySunriseHour = 12 ) ? 0 : MeasureAstronomySunriseHour ) + 12 * [MeasureAstronomySunriseAMPM] ) + MeasureAstronomySunriseMin ) - MeasureCurrent )
...
DynamicVariables=1
Group=SunriseSunset
Disabled=1

[MeasureToSunset]
...
Formula=(( 60 * ( (( MeasureAstronomySunsetHour = 12 ) ? 0 : MeasureAstronomySunsetHour ) + 12 * [MeasureAstronomySunsetAMPM] ) + MeasureAstronomySunsetMin ) - MeasureCurrent )
...
DynamicVariables=1
Group=SunriseSunset
Disabled=1
When modifying the formulas as described here, I had to disable the measures, to avoid the error messages in the log, then enable them when the WebParser measures get their values. Setting the dynamic variables were also needed to be done. That's why I added the DynamicVariables=1, the Group=SunriseSunset and finally the Disabled=1 options to both measures (with the Group option I included those measures into a group, to can easier enable them when needed). Finally I added a FinishAction=[!EnableMeasureGroup "SunriseSunset"][!UpdateMeasureGroup "SunriseSunset"] option to the parent WebParser measure ([MeasureParent]). With these updates now you get the appropriate differences, which can be used. But because the [MeasureDayNight] measure uses as well the #SunsetTime# and #SunriseTime# variables in its IfConditions, I had to define an initial value for these variables, adding a [Variables] section:

Code: Select all

[Variables]
SunsetTime=0
SunriseTime=0
Further issues:
  • You forgot to remove the equal signs from the IfTrueAction options of the [MeasureDayNight] measure, removing them just from the IfFalsActions (as described by yourself).
  • The substitutions are not made correctly in the [MeasureAstronomySunriseAMPM] and [MeasureAstronomySunsetAMPM] measures, because the substitution is case sensitive. So replace the original Substitute="am":"0","pm":"1" option with Substitute="AM":"0","PM":"1".
  • I don't see a reason to use a such small Update value (within the [Rainmeter] section). I'd use the default Update=1000. With the original Update=75, the WebParser measures are updated each 135 seconds (135 s = 75 milliseconds x 1800 - the UpdateRate value of the parent WebParser measure), which is too much and there isn't even needed a such frequent update.
  • There are some uncompleted IfCondition options in the [MeasureShifter] measure. Not sure what was the intention with them, I leaved them as they were.
Making all these modifications, here is my proposal of code:

Code: Select all

[Rainmeter]
Update=1000

[Variables]
SunsetTime=0
SunriseTime=0

[MeasureParent]
Measure=Plugin
Plugin=WebParser
UpdateRate=1800
URL=http://wxdata.weather.com/wxdata/weather/local/USNH0102?cc=*&unit=f&dayf=6
RegExp=(?siU)<sunr>(.*):(.*) (.*)</sunr>.*<suns>(.*):(.*) (.*)</suns>
FinishAction=[!EnableMeasureGroup "SunriseSunset"][!UpdateMeasureGroup "SunriseSunset"]
Debug=1

[MeasureAstronomySunriseHour]
Measure=Plugin
Plugin=WebParser
URL=[MeasureParent]
StringIndex=1

[MeasureAstronomySunriseMin]
Measure=Plugin
Plugin=WebParser
URL=[MeasureParent]
StringIndex=2

[MeasureAstronomySunriseAMPM]
Measure=Plugin
Plugin=WebParser
URL=[MeasureParent]
StringIndex=3
Substitute="AM":"0","PM":"1"

[MeasureAstronomySunsetHour]
Measure=Plugin
Plugin=WebParser
URL=[MeasureParent]
StringIndex=4

[MeasureAstronomySunsetMin]
Measure=Plugin
Plugin=WebParser
URL=[MeasureParent]
StringIndex=5

[MeasureAstronomySunsetAMPM]
Measure=Plugin
Plugin=WebParser
URL=[MeasureParent]
StringIndex=6
Substitute="AM":"0","PM":"1"

[MeasureTimeAdjustSunset]
Measure=Calc
Formula=( MeasureAstronomySunsetHour + (12 * MeasureAstronomySunsetAMPM ) + MeasureAstronomySunsetMin )

[MeasureTimeAdjustSunset]
Measure=Calc
Formula=( MeasureAstronomySunriseHour + (12 * MeasureAstronomySunriseAMPM ) + MeasureAstronomySunriseMin )

[MeasureCurrentHour]
Measure=Calc
Formula=MeasureTime/3600%12

[MeasureCurrentMin]
Measure=Calc
Formula=MeasureCurrentHour/60%12

[MeasureCurrent]
Measure=Calc
Formula=( 60 * MeasureCurrentHour + MeasureCurrentMin )

[MeasureToSunrise]
Measure=Calc
Formula=(( 60 * ((( MeasureAstronomySunriseHour = 12 ) ? 0 : MeasureAstronomySunriseHour ) + 12 * [MeasureAstronomySunriseAMPM] ) + MeasureAstronomySunriseMin ) - MeasureCurrent )
IfCondition=(#CURRENTSECTION#<=5*60) && (#CURRENTSECTION#>4*60)
IfTrueAction=[!SetVariable SunriseTime 5]
IfFalseAction=[!SetVariable SunriseTime 12]
IfCondition2=(#CURRENTSECTION#<=4*60) && (#CURRENTSECTION#>3*60)
IfTrueAction2=[!SetVariable SunriseTime 4]
IfFalseAction2=[!SetVariable SunriseTime 12]
IfCondition3=(#CURRENTSECTION#<=3*60) && (#CURRENTSECTION#>2*60)
IfTrueAction3=[!SetVariable SunriseTime 3]
IfFalseAction3=[!SetVariable SunriseTime 12]
IfCondition4=(#CURRENTSECTION#<=2*60) && (#CURRENTSECTION#>1*60)
IfTrueAction4=[!SetVariable SunriseTime 2]
IfFalseAction4=[!SetVariable SunriseTime 12]
IfCondition5=(#CURRENTSECTION#<=1*60) && (#CURRENTSECTION#>0*60)
IfTrueAction5=[!SetVariable SunriseTime 1]
IfFalseAction5=[!SetVariable SunriseTime 12]
DynamicVariables=1
Group=SunriseSunset
Disabled=1

[MeasureToSunset]
Measure=Calc
Formula=(( 60 * ((( MeasureAstronomySunsetHour = 12 ) ? 0 : MeasureAstronomySunsetHour ) + 12 * [MeasureAstronomySunsetAMPM] ) + MeasureAstronomySunsetMin ) - MeasureCurrent )
IfCondition=(#CURRENTSECTION#<=5*60) && (#CURRENTSECTION#>4*60)
IfTrueAction=[!SetVariable SunsetTime 5] 
IfFalseAction=[!SetVariable SunsetTime 24]
IfCondition2=(#CURRENTSECTION#<=4*60) && (#CURRENTSECTION#>3*60)
IfTrueAction2=[!SetVariable SunsetTime 4]
IfFalseAction2=[!SetVariable SunsetTime 24]
IfCondition3=(#CURRENTSECTION#<=3*60) && (#CURRENTSECTION#>2*60)
IfTrueAction3=[!SetVariable SunsetTime 3]
IfFalseAction3=[!SetVariable SunsetTime 24]
IfCondition4=(#CURRENTSECTION#<=2*60) && (#CURRENTSECTION#>1*60)
IfTrueAction4=[!SetVariable SunsetTime 2]
IfFalseAction4=[!SetVariable SunsetTime 24]
IfCondition5=(#CURRENTSECTION#<=1*60) && (#CURRENTSECTION#>0*60)
IfTrueAction5=[!SetVariable SunsetTime 1]
IfFalseAction5=[!SetVariable SunsetTime 24]
DynamicVariables=1
Group=SunriseSunset
Disabled=1

[Refresher]
Measure=Time
Format=%S
IfEqualValue=0
IfEqualAction=!Redraw

[MeasureTime]
Measure=Time
AverageSize=20

[MeasureSeconds]
Measure=Calc
Formula=MeasureTime%60

[MeasureSecondsSpringing]
Measure=Calc
Formula=Trunc(MeasureSeconds) + Frac(MeasureSeconds) ** 5
MinValue=0
MaxValue=60

[MeasureDayNight]
Measure=Calc
Formula=Abs(Trunc(MeasureTime/3600%24) - 11.5) <= 6? 12: 24
IfCondition=(#SunsetTime# = 5) || (#SunriseTime# = 1)
IfTrueAction=[!SetOption MeasureDayNight Formula "5"]
IfFalseAction=[!SetOption MeasureDayNight Formula "Abs(Trunc(MeasureTime/3600%24) - 11.5) <= 6? 12: 24"]
IfCondition2=(#SunsetTime# = 4) || (#SunriseTime# = 2)
IfTrueAction2=[!SetOption MeasureDayNight Formula "4"]
IfFalseAction2=[!SetOption MeasureDayNight Formula "Abs(Trunc(MeasureTime/3600%24) - 11.5) <= 6? 12: 24"]
IfCondition3=(#SunsetTime# = 3) || (#SunriseTime# = 3)
IfTrueAction3=[!SetOption MeasureDayNight Formula "3"]
IfFalseAction3=[!SetOption MeasureDayNight Formula "Abs(Trunc(MeasureTime/3600%24) - 11.5) <= 6? 12: 24"]
IfCondition4=(#SunsetTime# = 2) || (#SunriseTime# = 4)
IfTrueAction4=[!SetOption MeasureDayNight Formula "2"]
IfFalseAction4=[!SetOption MeasureDayNight Formula "Abs(Trunc(MeasureTime/3600%24) - 11.5) <= 6? 12: 24"]
IfCondition5=(#SunsetTime# = 1) || (#SunriseTime# = 5)
IfTrueAction5=[!SetOption MeasureDayNight Formula "1"]
IfFalseAction5=[!SetOption MeasureDayNight Formula "Abs(Trunc(MeasureTime/3600%24) - 11.5) <= 6? 12: 24"]
DynamicVariables=1

[MeasureHourFileName]
Measure=String
String=hours[MeasureDayNight].png
DynamicVariables=1

[MeasureShifter]
Measure=Time
Format=%H.%M
IfCondition=MeasureTime = 00.00
IfTrueAction=
IfCondition2=MeasureTime = 
IfTrueAction2=

[MeterHours]
MeasureName=MeasureTime
Meter=Rotator
ImageName=[MeasureHourFileName]
ValueRemainder=43200
X=130
Y=130
StartAngle=0
RotationAngle=6.2832
OffsetX=96
OffsetY=96
DynamicVariables=1

[MeterMinutes]
MeasureName=MeasureTime
Meter=Rotator
ImageName=minutes.png
ValueRemainder=3600
StartAngle=0
RotationAngle=6.2832
OffsetX=125
OffsetY=125
W=260
H=260
;Padding=25,25,25,25

[MeterSeconds]
MeasureName=MeasureSecondsSpringing
Meter=Rotator
ImageName=seconds.png
X=130
Y=130
StartAngle=0
RotationAngle=6.2832
OffsetX=10
OffsetY=130

[Time]
Meter=String
MeasureName=MeasureTime
FontFace=Century Gothic
FontSize=10
FontColor=20,100,255,255
StringAlign=Center
X=130
Y=260
AntiAlias=1
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5406
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: IfConditions Cross Referencing 2 Measures

Post by eclectic-tech »

@ balala

I didn't go any further than eliminating errors in the log; I didn't test any of the code for accuracy.

My intention was just getting the skin to an "error free" state in the log so they could test it further. :Whistle

Where's the fun if we fix everything? ;-)
User avatar
balala
Rainmeter Sage
Posts: 16169
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: IfConditions Cross Referencing 2 Measures

Post by balala »

eclectic-tech wrote: July 23rd, 2019, 1:53 pm My intention was just getting the skin to an "error free" state in the log so they could test it further. :Whistle
Ok, just seeing those inadvertences, I had to post the comments. Hope you don't mind.
justsomeguyhere
Posts: 20
Joined: July 12th, 2019, 7:29 pm

Re: IfConditions Cross Referencing 2 Measures

Post by justsomeguyhere »

Thank you both so much for helping me out. It's great to have it working!