It is currently April 26th, 2024, 3:21 am

Trouble using multiple files for display

Get help with creating, editing & fixing problems with skins
12hc12
Posts: 3
Joined: April 6th, 2010, 9:20 pm

Trouble using multiple files for display

Post by 12hc12 »

I've just recently started using Rainmeter, and it's quickly become my new obsession. However, I am still a beginner, so everything is a bit confusing.
In order to prep myself (read "procrastinate and mask as preparing") for university next year, I wanted to make a skin that would display my daily schedule. In theory, I would have five separate .txt files--one for each day of the school week--which would contain the appropriate day's schedule. The skin would then select which file to display based on what day of the week it is.

And as a beginner, I've hit a wall. I don't know if this is possible, and now know that it's improbable under my own knowledge of how to create skins. So I've come here for some "minor" guidance. My code so far is below; keep in mind that it may or may not make sense. (A majority of it, right now, is a combination of several different things I've found in skins I'm already using or help threads I've searched through.)

Code: Select all

[Rainmeter]
Update=3600000
;updates each hour

[Variables]
Colour=FFFFFF
TSize=10
SSize=7
Face=Verdana

;--------------------------------------------------------------------------------------------------
; MEASURES
;--------------------------------------------------------------------------------------------------

[GetDate]
Measure=Time
Format="%w"
;gets week date number (from 0 - 6, where 0 is Sunday)

[GetScheduleT1]
Measure=Plugin
Plugin=WebParser.dll
Url=file://#CURRENTPATH#/Schedule1.txt
RegExp="(?siU)<day>(.*)</day>.*<schedule>(.*)</schedule>"
StringIndex=1

[GetScheduleS1]
Measure=Plugin
Plugin=WebParser.dll
Url=[GetScheduleT1]
StringIndex=2

[GetScheduleT2]
Measure=Plugin
Plugin=WebParser.dll
Url=file://#CURRENTPATH#/Schedule2.txt
RegExp="(?siU)<day>(.*)</day>.*<schedule>(.*)</schedule>"
StringIndex=1

[GetScheduleS2]
Measure=Plugin
Plugin=WebParser.dll
Url=[GetScheduleT2]
StringIndex=2

[GetScheduleT3]
Measure=Plugin
Plugin=WebParser.dll
Url=file://#CURRENTPATH#/Schedule3.txt
RegExp="(?siU)<day>(.*)</day>.*<schedule>(.*)</schedule>"
StringIndex=1

[GetScheduleS3]
Measure=Plugin
Plugin=WebParser.dll
Url=[GetScheduleT3]
StringIndex=2

[GetScheduleT4]
Measure=Plugin
Plugin=WebParser.dll
Url=file://#CURRENTPATH#/Schedule4.txt
RegExp="(?siU)<day>(.*)</day>.*<schedule>(.*)</schedule>"
StringIndex=1

[GetScheduleS4]
Measure=Plugin
Plugin=WebParser.dll
Url=[GetScheduleT4]
StringIndex=2

[GetScheduleT5]
Measure=Plugin
Plugin=WebParser.dll
Url=file://#CURRENTPATH#/Schedule5.txt
RegExp="(?siU)<day>(.*)</day>.*<schedule>(.*)</schedule>"
StringIndex=1

[GetScheduleS5]
Measure=Plugin
Plugin=WebParser.dll
Url=[GetScheduleT5]
StringIndex=2

;--------------------------------------------------------------------------------------------------
; CALC
;--------------------------------------------------------------------------------------------------

[DoSchedule1]
Measure=Calc
Formula=((GetDate > 0) && (GetDate < 2)) ? 1 : 0
IfEqualValue=1
IfEqualAction=!Execute [!RainmeterShowMeter ScheduleT1][!RainmeterShowMeter Schedule1]
IfBelowValue=1
IfBelowAction=!Execute [!RainmeterHideMeter ScheduleT1][!RainmeterHideMeter Schedule1]

[DoSchedule2]
Measure=Calc
Formula=((GetDate > 1) && (GetDate < 3)) ? 1 : 0
IfEqualValue=1
IfEqualAction=!Execute [!RainmeterShowMeter ScheduleT2][!RainmeterShowMeter Schedule2]
IfBelowValue=1
IfBelowAction=!Execute [!RainmeterHideMeter ScheduleT2][!RainmeterHideMeter Schedule2]

[DoSchedule3]
Measure=Calc
Formula=((GetDate > 2) && (GetDate < 4)) ? 1 : 0
IfEqualValue=1
IfEqualAction=!Execute [!RainmeterShowMeter ScheduleT3][!RainmeterShowMeter Schedule3]
IfBelowValue=1
IfBelowAction=!Execute [!RainmeterHideMeter ScheduleT3][!RainmeterHideMeter Schedule3]

[DoSchedule4]
Measure=Calc
Formula=((GetDate > 3) && (GetDate < 5)) ? 1 : 0
IfEqualValue=1
IfEqualAction=!Execute [!RainmeterShowMeter ScheduleT4][!RainmeterShowMeter Schedule4]
IfBelowValue=1
IfBelowAction=!Execute [!RainmeterHideMeter ScheduleT4][!RainmeterHideMeter Schedule4]

[DoSchedule5]
Measure=Calc
Formula=((GetDate > 4) && (GetDate < 6)) ? 1 : 0
IfEqualValue=1
IfEqualAction=!Execute [!RainmeterShowMeter ScheduleT5][!RainmeterShowMeter Schedule5]
IfBelowValue=1
IfBelowAction=!Execute [!RainmeterHideMeter ScheduleT5][!RainmeterHideMeter Schedule5]

;--------------------------------------------------------------------------------------------------
; METERS
;--------------------------------------------------------------------------------------------------

[Background]
Meter=IMAGE
SolidColor=0,0,0,1
X=0
Y=0
W=150
H=60

[ScheduleT1]
Meter=STRING
MeasureName=GetScheduleT1
X=27
Y=10
H=15
W=150
StringStyle=BOLD
FontColor=#Colour#
FontFace=#Face#
FontSize=#TSize#
AntiAlias=1
Hidden=1

[Schedule1]
Meter=STRING
MeasureName=GetScheduleS1
X=2
Y=32
W=150
H=300
FontColor=#Colour#
FontFace=#Face#
FontSize=#SSize#
StringAlign=LEFT
StringStyle=NORMAL
AntiAlias=1
ClipString=1
Hidden=1

[ScheduleT2]
Meter=STRING
MeasureName=GetScheduleT2
X=27
Y=10
H=15
W=150
StringStyle=BOLD
FontColor=#Colour#
FontFace=#Face#
FontSize=#TSize#
AntiAlias=1
Hidden=1

[Schedule2]
Meter=STRING
MeasureName=GetScheduleS2
X=2
Y=32
W=150
H=300
FontColor=#Colour#
FontFace=#Face#
FontSize=#SSize#
StringAlign=LEFT
StringStyle=NORMAL
AntiAlias=1
ClipString=1
Hidden=1

[ScheduleT3]
Meter=STRING
MeasureName=GetScheduleT3
X=27
Y=10
H=15
W=150
StringStyle=BOLD
FontColor=#Colour#
FontFace=#Face#
FontSize=#TSize#
AntiAlias=1
Hidden=1

[Schedule3]
Meter=STRING
MeasureName=GetScheduleS3
X=2
Y=32
W=150
H=300
FontColor=#Colour#
FontFace=#Face#
FontSize=#SSize#
StringAlign=LEFT
StringStyle=NORMAL
AntiAlias=1
ClipString=1
Hidden=1

[ScheduleT4]
Meter=STRING
MeasureName=GetScheduleT4
X=27
Y=10
H=15
W=150
StringStyle=BOLD
FontColor=#Colour#
FontFace=#Face#
FontSize=#TSize#
AntiAlias=1
Hidden=1

[Schedule4]
Meter=STRING
MeasureName=GetScheduleS4
X=2
Y=32
W=150
H=300
FontColor=#Colour#
FontFace=#Face#
FontSize=#SSize#
StringAlign=LEFT
StringStyle=NORMAL
AntiAlias=1
ClipString=1
Hidden=1

[ScheduleT5]
Meter=STRING
MeasureName=GetScheduleT5
X=27
Y=10
H=15
W=150
StringStyle=BOLD
FontColor=#Colour#
FontFace=#Face#
FontSize=#TSize#
AntiAlias=1
Hidden=1

[Schedule5]
Meter=STRING
MeasureName=GetScheduleS5
X=2
Y=32
W=150
H=300
FontColor=#Colour#
FontFace=#Face#
FontSize=#SSize#
StringAlign=LEFT
StringStyle=NORMAL
AntiAlias=1
ClipString=1
Hidden=1
The .txt files (each named Schedule#.txt, where # is the corresponding day of the week) are properly formatted to display on the screen using <day> and <schedule> tags. That aspect has been tested and works properly on its own.

Currently, nothing shows up on the screen (aside from the Background meter, if I set it to something more visible). I'm completely lost, and any help would be greatly appreciated.
User avatar
Alex2539
Rainmeter Sage
Posts: 642
Joined: July 19th, 2009, 5:59 am
Location: Montreal, QC, Canada

Re: Trouble using multiple files for display

Post by Alex2539 »

In the URLs, try getting rid of the slash after #CURRENTPATH#. That variable includes the slash at the end, so really it's looking for something like "...Skins\Folder\/Schedule#.txt" and it can't find it because it technically doesn't exist.

Failing that, add "Debug=1" to the webparser measures and check the log to see whether they're actually reading the information.
ImageImageImageImage
User avatar
Chewtoy
Moderator
Posts: 995
Joined: June 10th, 2009, 12:44 pm
Location: Sweden

Re: Trouble using multiple files for display

Post by Chewtoy »

Eventhough I don't like premoting of selfmade skins like this, there is one skin that does pretty much what you're asking...
http://customize.org/rainmeter/skins/66478
Just put your schedule in there instead... Or strip the code.
I don't think, therefore I'm not.
12hc12
Posts: 3
Joined: April 6th, 2010, 9:20 pm

Re: Trouble using multiple files for display

Post by 12hc12 »

Thanks for the speedy replies. (:

Chewtoy: I feel like I'm close to getting this accomplished, and don't want to give up yet. If worst comes to worst, I could definitely use that; thanks for the link.

Alex: I deleted the unnecessary slashes and there was no effect. I also added Debug=1 to all the measures using WebParser.dll and according to the log file, all seems to be working properly.
User avatar
Alex2539
Rainmeter Sage
Posts: 642
Joined: July 19th, 2009, 5:59 am
Location: Montreal, QC, Canada

Re: Trouble using multiple files for display

Post by Alex2539 »

Ah, I should have seen it before. The real problem is the update rate. The way the skin works is that when the skin is started, all of the measure go and do their thing and get the information. However, on this first update the meters don't have any information to display, so they have to wait until the next update to show that info. The next update, however, is an hour away. I guarantee that if you waited an hour, it would start showing info.

The best way to solve this is to set the Update to something like 1000, then add "UpdateDivider=3600" to each of the measures. This way, it will still only update the measures once per hour, but you'll only need to wait one second after they do to see that information.
ImageImageImageImage
12hc12
Posts: 3
Joined: April 6th, 2010, 9:20 pm

Re: Trouble using multiple files for display

Post by 12hc12 »

Wow. Here I am thinking I have some major logic problem, and a simple update rate change was all I needed.
Thanks for the help; it's working wonders now. (: