It is currently May 1st, 2024, 8:13 pm

[SOLVED] Measure=Calc return me zero (Need Help)

Get help with creating, editing & fixing problems with skins
istylish
Posts: 3
Joined: April 12th, 2012, 6:35 am

[SOLVED] Measure=Calc return me zero (Need Help)

Post by istylish »

So What i did with my skin is I read Time From a website as hour and minute
I want to play SOUND when it match the local PC TIME.
I calculate the time to match
But Measure=Calc is returning me Zero Value which match and play sound
I have posted the code below...
Please Help me, I really wanna do this !!

Code: Select all

[Rainmeter]
Author=Istylish Larka
Update=1000
LocalFont=Fabada-regular



;===============================
; Variables [note: you can change
; Url and/Or AzaanSounds
;===============================

[Variables]
FontName=Fabada
FontSize=10

Sound=SOUND.wav

URL=http://www.islamicfinder.org/prayer_service.php?country=usa&city=staten_island&state=NY&zipcode=10304&latitude=40.6059&longitude=-74.0942&timezone=-5&HanfiShafi=1&pmethod=1&fajrTwilight1=10&fajrTwilight2=10&ishaTwilight=10&ishaInterval=30&dhuhrInterval=1&maghribInterval=1&dayLight=1&simpleFormat=xml
Substitute="&":"&",""":"","&Quot;":"","<br>":"","![CDATA[":"","]]":"","...":"","<":"",">":"","/PRE>":"","PRE>":"","<":""




;===============================
; Styles (default for meters)
;===============================

[prayerName]
StringCase=NONE
StringStyle=BOLD
StringEffect=SHADOW
FontEffectColor=0,0,0,80
FontColor=0,0,0,200
FontFace=#FontName#
FontSize=#FontSize#
AntiAlias=1

[prayerValue]
StringCase=NONE
StringStyle=BOLD
StringEffect=SHADOW
FontEffectColor=0,0,0,80
FontColor=0,0,0,200
FontFace=#FontFace#
FontSize=#FontSize#
AntiAlias=1

;===============================
; Measure For Reading Website
;===============================

[MeasureWebsite]
Measure=Plugin
Plugin=Plugins\WebParser.dll
UpdateRate=1800
Url=#URL#
RegExp="(?siU)<fajr>(.*):(.*)</fajr>"


;===============================
; Measure For Fajr TIME
;===============================

[MeasureFajr_Hr]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[MeasureWebsite]
StringIndex=1

[MeasureFajr_Min]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[MeasureWebsite]
StringIndex=2



;===============================
; METER for Fajr Sala'ah
;===============================

[PrayerName1]
Meter=STRING
MeterStyle=PrayerName
Text=Fajr
X=5
Y=0
DynamicVariables=1

[MeterFajr_Hr]
MeasureName=MeasureFajr_Hr
MeterStyle=PrayerValue
Meter=STRING
X=80
Y=0
StringIndex=1


[MeterFajr_Min]
MeasureName=MeasureFajr_Min
MeterStyle=PrayerValue
Meter=STRING
X=100
Y=0
Prefix=: 
StringIndex=2





;===============================
; HERE IS MY PROBLEM !!
; I CALCULATE TIME AND WHEN IT MATCH IT PLAY SOUND
; BUT BOTH CALC RETURN ZERO AND IT START PLAY SOUND
;===============================


[MeasureFajr_Athaan]
Measure=Calc
Formula=(MeasureFajr_Hr + MeasureFajr_Min)

[MeasureTime_Hr]
Measure=Time
Format=%I

[MeasureTime_Min]
Measure=Time
Format=%M

[MeasureTime_Alarm]
Measure=Calc
Formula=(MeasureTime_Hr + MeasureTime_Min)
IfEqualValue=[MeasureFajr_Athaan]
IfEqualAction=!Execute [PLAY #Sound#]
Last edited by istylish on May 4th, 2012, 3:30 pm, edited 1 time in total.
User avatar
Brian
Developer
Posts: 2689
Joined: November 24th, 2011, 1:42 am
Location: Utah

Re: Measure=Calc return me zero (Need Help)

Post by Brian »

Works ok for me.

Here is what I get:
screen.png
Are you on the latest beta?

BTW - Adding the hour to the minute might not be the best solution to what you are trying to do. For instance, If you want to play a sound at 4:07, you wouldn't want to just add the hour to the minute (which is 11), because at 5:06, the sound would be played again (5+6=11). To fix that, you could times the hour by 60 to get everything in minutes, or use a Lua script to compare the times.

-Brian
You do not have the required permissions to view the files attached to this post.
istylish
Posts: 3
Joined: April 12th, 2012, 6:35 am

Re: Measure=Calc return me zero (Need Help)

Post by istylish »

Thanks alot for your concern But my focus on problem is that it takes time to read values from internet and while it calculates, it gives you zero which play sound in start :/
And thanks for that adding stuff, I am new so i am learning :)
I am rainmeter 2.2
User avatar
smurfier
Moderator
Posts: 1931
Joined: January 29th, 2010, 1:43 am
Location: Willmar, MN

Re: Measure=Calc return me zero (Need Help)

Post by smurfier »

Please upgrade to Rainmeter 2.3 Beta. A few things have changed that may affect the outcome of your issue.

If the issue still occurs, then try adding Disabled=1 to your [MeasureTime_Alarm] measure. Then add FinishAction=!EnableMeasure MeasureTime_Alarm to [MeasureWebsite]
GitHub | DeviantArt | Tumblr
This is the song that never ends. It just goes on and on my friends. Some people started singing it not knowing what it was, and they'll continue singing it forever just because . . .
istylish
Posts: 3
Joined: April 12th, 2012, 6:35 am

Re: Measure=Calc return me zero (Need Help)

Post by istylish »

:circle:
Yeyyy Thanks alot (five stars) it worked i am soooooooooooo much happy (:
you are awesome :thumbup: