It is currently May 2nd, 2024, 4:53 am

questions on String Handling & Conversion

Get help with creating, editing & fixing problems with skins
Afaflix
Posts: 5
Joined: May 13th, 2011, 1:20 am

questions on String Handling & Conversion

Post by Afaflix »

Hello,
I have been using Rainmeter since a while now, but usually never ventured further than adjusting the fontface for the 10ft HUD or similar.

But I have now found something I really would like to display on my desktop, and that is an event calendar which is available via api/xml from the web.
I have understood the Url / webparser part far enough as to get it working, and I can separate the main blocks I am interested in from each other.
Once I have the strings I run into a small problem though. How can I take a string version of a date and time and turn them into numbers? with that I can then make a countdown for it. Which is really the grand idea behind this.
Second question; I can't figure out is how to do 3 runs of them ... I can't find any "programming" style syntax to make a loop.
Third question; in the 'EventTextn' part there I have 2 ways how some announcements carry url information. How can I extract that information 'IF IT IS PRESENT' without borking everything up if it isn't? With that I can then make the whole text clickable that will take me to the event announcement page.
Just in case it's the answer .. I don't understand "StringIndex2=1" ... first I thought it returns the leftover value of the string, but that's not it.

this is the xml file I am parsing
UpcomingCalendarEvents.xml

Code: Select all

<?xml version='1.0' encoding='UTF-8'?>
<calenderapi version="2">
  <currentTime>2011-05-12 07:29:43</currentTime>
  <result>
    <rowset name="upcomingEvents" key="eventID" columns="eventID,ownerID,ownerName,eventDate,eventTitle,duration,importance,response,eventText">
      <row eventID="166289" ownerID="498124361" ownerName="Organing Party" eventDate="2011-05-23 05:00:00" eventTitle="05.23 @0500 Rainmeter Strings Handling" duration="180" importance="0" response="Undecided" eventText="topic=16691&#xA;&#xA;WHERE: In front of your Computer WHEN: 0500 Local Time WHAT: We're all sitting around trying to figure out how to split STRINGS with Rainmeter" />
      <row eventID="154006" ownerID="1" ownerName="Someone Else" eventDate="2011-05-20 20:00:00" eventTitle="Countdown Clock  May 20, 2011" duration="0" importance="0" response="Undecided" eventText="This time we're trying to figure out how to make a countdown for this thing. For more information, click <a href="http://rainmeter.net&topic=12345">here.</a>." />
    </rowset>
  </result>
  <cachedUntil>2011-05-12 08:24:58</cachedUntil>
</calendarapi>
And here is my code so far. It displays the first set. the second doesn't display.

Code: Select all


[Variables]
fontname=Orbitron
URL="file://C:\Users\phn\My Documents\Rainmeter\Skins\TEST\Events\UpcomingCalendarEvents.xml"


[Source]
Measure=Plugin
Plugin=Plugins\WebParser.dll
UpdateRate=1800
Url=#URL#
RegExp="(?siU)<row eventID=".+" ownerID=".+" ownerName=".+" eventDate="(.+)" eventTitle="(.+)" duration="(.+)" importance=".+" response=".+" eventText="(.+)" />"
RegExp="(?siU)<row eventID=".+" ownerID=".+" ownerName=".+" eventDate="(.+)" eventTitle="(.+)" duration="(.+)" importance=".+" response=".+" eventText="(.+)" />"
RegExp="(?siU)<row eventID=".+" ownerID=".+" ownerName=".+" eventDate="(.+)" eventTitle="(.+)" duration="(.+)" importance=".+" response=".+" eventText="(.+)" />"

[MeasureEventDate1]
   Measure=Plugin
   Plugin=Plugins\WebParser.dll
   Url=[Source]
   StringIndex=1

[MeasureTitle1]
   Measure=Plugin
   Plugin=Plugins\WebParser.dll
   Url=[Source]
   StringIndex=2

[MeasureDuration1]
   Measure=Plugin
   Plugin=Plugins\WebParser.dll
   Url=[Source]
   StringIndex=3

[MeasureEventText1]
   Measure=Plugin
   Plugin=Plugins\WebParser.dll
   Url=[Source]
   StringIndex=4
   Substitute="&#xA;":" ",">":">","<":"<","&":"&",""":""","&Quot;":"""
 
[MeasureEventDate2]
   Measure=Plugin
   Plugin=Plugins\WebParser.dll
   Url=[Source]
   StringIndex=5

[MeasureTitle2]
   Measure=Plugin
   Plugin=Plugins\WebParser.dll
   Url=[Source]
   StringIndex=6

[MeasureDuration2]
   Measure=Plugin
   Plugin=Plugins\WebParser.dll
   Url=[Source]
   StringIndex=7

[MeasureEventText2]
   Measure=Plugin
   Plugin=Plugins\WebParser.dll
   Url=[Source]
   StringIndex=8
   Substitute="&#xA;":" ",">":">","<":"<","&":"&",""":""","&Quot;":"""

[MeasureEventDate3]
   Measure=Plugin
   Plugin=Plugins\WebParser.dll
   Url=[Source]
   StringIndex=9

[MeasureTitle3]
   Measure=Plugin
   Plugin=Plugins\WebParser.dll
   Url=[Source]
   StringIndex=10

[MeasureDuration3]
   Measure=Plugin
   Plugin=Plugins\WebParser.dll
   Url=[Source]
   StringIndex=11

[MeasureEventText3]
   Measure=Plugin
   Plugin=Plugins\WebParser.dll
   Url=[Source]
   StringIndex=12
   Substitute="&#xA;":" ",">":">","<":"<","&":"&",""":""","&Quot;":"""
----------




[MeterEventTitle1]
   MeasureName=MeasureTitle1
   Meter=STRING
   X=0
   Y=0
   FontColor=255, 255, 155, 180
   FontSize=10
   FontFace=#fontname#
   StringAlign=LEFT
   AntiAlias=1
   Text= Title                 : %1 

[MeterEventDate1]
   MeasureName=MeasureEventDate1
   Meter=STRING
   X=0
   Y=20
   FontColor=255, 155, 255, 180
   FontSize=10
   FontFace=#fontname#
   StringAlign=LEFT
   AntiAlias=1
   Text= EventDate    : %1 

[MeterDuration1]
   MeasureName=MeasureDuration1
   Meter=STRING
   X=0
   Y=40
   FontColor=155, 155, 255, 180
   FontSize=10
   FontFace=#fontname#
   StringAlign=LEFT
   AntiAlias=1
   Text= Duration         : %1 

[MeterEventText1]
   MeasureName=MeasureEventText1
   Meter=STRING
   X=0
   Y=60
   W=600 
   H=200
   ClipString=1
   FontColor=255, 155, 155, 180
   FontSize=10
   FontFace=#fontname#
   StringAlign=LEFT
   AntiAlias=1
   Text= EventText    : %1 

[MeterEventTitle2]
   MeasureName=MeasureTitle2
   Meter=STRING
   X=0
   Y=140
   FontColor=255, 255, 155, 180
   FontSize=10
   FontFace=#fontname#
   StringAlign=LEFT
   AntiAlias=1
   Text= Title                 : %1 

[MeterEventDate2]
   MeasureName=MeasureEventDate2
   Meter=STRING
   X=0
   Y=160
   FontColor=255, 155, 255, 180
   FontSize=10
   FontFace=#fontname#
   StringAlign=LEFT
   AntiAlias=1
   Text= EventDate    : %1 

[MeterDuration2]
   MeasureName=MeasureDuration2
   Meter=STRING
   X=0
   Y=180
   FontColor=155, 155, 255, 180
   FontSize=10
   FontFace=#fontname#
   StringAlign=LEFT
   AntiAlias=1
   Text= Duration         : %1 

[MeterEventText2]
   MeasureName=MeasureEventText2
   Meter=STRING
   X=0
   Y=200
   W=600 
   H=200
   ClipString=1
   FontColor=255, 155, 155, 180
   FontSize=10
   FontFace=#fontname#
   StringAlign=LEFT
   AntiAlias=1
   Text= EventText    : %1 

[MeterEventTitle3]
   MeasureName=MeasureTitle3
   Meter=STRING
   X=0
   Y=280
   FontColor=255, 255, 155, 180
   FontSize=10
   FontFace=#fontname#
   StringAlign=LEFT
   AntiAlias=1
   Text= Title                 : %1 

[MeterEventDate3]
   MeasureName=MeasureEventDate3
   Meter=STRING
   X=0
   Y=300
   FontColor=255, 155, 255, 180
   FontSize=10
   FontFace=#fontname#
   StringAlign=LEFT
   AntiAlias=1
   Text= EventDate    : %1 

[MeterDuration3]
   MeasureName=MeasureDuration3
   Meter=STRING
   X=0
   Y=320
   FontColor=155, 155, 255, 180
   FontSize=10
   FontFace=#fontname#
   StringAlign=LEFT
   AntiAlias=1
   Text= Duration         : %1 

[MeterEventText3]
   MeasureName=MeasureEventText3
   Meter=STRING
   X=0
   Y=340
   W=600 
   H=200
   ClipString=1
   FontColor=255, 155, 155, 180
   FontSize=10
   FontFace=#fontname#
   StringAlign=LEFT
   AntiAlias=1
   Text= EventText    : %1 
Any help toward solving this is greatly appreciated
User avatar
jsmorley
Developer
Posts: 22631
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: questions on String Handling & Conversion

Post by jsmorley »

1) Break up the date into its separate components using the RegExp, then you can pass those string numbers (year, month, day) through Measure=Calc measures to convert them to numbers you can use as you see fit. See my example below

2) You only have to repeat the RegExp pattern as many times as you like to get repeated iterations of what you are capturing. There is no "loop" in Rainmeter that could be used to do this, you do it with the RegExp itself. In my example below, I showed how you would use a "look ahead assertion" in Regular Expression to get as many iterations as you want, without failing if there are in fact fewer in the source than you are asking for.

3) Pulling the links out of the "text" will take some doing. I did not put it in my example below, but you would probably have to do two full parses of the source using WebParser. The first to get everything in my example below, then a second pass through with a whole new RegExp to pull the links out of the text, again using a "look ahead assertion" to ensure it doesn't fail if there isn't a link in a particular entry. There may be (and probably is) a way to get them in the first pass, by changing the main RegExp to have embedded look ahead assertions looking for links inside the capture for the "text", but that is beyond my current Regular Expression skills, and I had a small stroke just thinking about it...

This is based on your XML file, but not on your skin as such. Poke around with this and see what I am doing, and it should give you some help to see how to use the approaches in your own skin.

Code: Select all

[Rainmeter]
Update=1000
DynamicWindowSize=1

[Variables]
FontName=Trebuchet MS
URL="file://#CURRENTPATH#Test.xml"
Get=(?(?=.*<row eventID=".*").*<row eventID=".*eventDate="(\d\d\d\d)-(\d\d)-(\d\d).*".*eventTitle="(.*)".*duration="(.*)".*eventText="(.*)")

[FontStyle]
FontFace=Trebuchet MS
FontColor=255,255,255,255
FontSize=11
StringStyle=Bold
AntiAlias=1

[Source]
Measure=Plugin
Plugin=Plugins\WebParser.dll
UpdateRate=1800
Url=#URL#
RegExp="(?siU)#Get##Get##Get#"

[MeasureYear1]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[Source]
StringIndex=1

[MeasureMonth1]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[Source]
StringIndex=2

[MeasureDay1]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[Source]
StringIndex=3

[MeasureTitle1]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[Source]
StringIndex=4

[MeasureDuration1]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[Source]
StringIndex=5

[MeasureText1]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[Source]
StringIndex=6
Substitute="&#xA;":" ",">":">","<":"<","&":"&",""":""","&Quot;":"","<a href=":"","</a>":"""

[MeasureYear2]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[Source]
StringIndex=7

[MeasureMonth2]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[Source]
StringIndex=8

[MeasureDay2]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[Source]
StringIndex=9

[MeasureTitle2]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[Source]
StringIndex=10

[MeasureDuration2]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[Source]
StringIndex=11

[MeasureText2]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[Source]
StringIndex=12
Substitute="&#xA;":" ",">":"","<":"","&":"&",""":" ","&Quot;":" ","a href=":"","/a":"""

[MeasureYear3]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[Source]
StringIndex=13

[MeasureMonth3]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[Source]
StringIndex=14

[MeasureDay3]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[Source]
StringIndex=15

[MeasureTitle3]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[Source]
StringIndex=16

[MeasureDuration3]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[Source]
StringIndex=17

[MeasureText3]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[Source]
StringIndex=18
Substitute="&#xA;":" ",">":">","<":"<","&":"&",""":""","&Quot;":"","<a href=":"","</a>":"""

[MeasureYear1Num]
Measure=Calc
Formula=MeasureYear1
Substitut=".0000":""

[MeasureMonth1Num]
Measure=Calc
Formula=MeasureMonth1
Substitut=".0000":""

[MeasureDay1Num]
Measure=Calc
Formula=MeasureDay1
Substitut=".0000":""

[MeasureYear2Num]
Measure=Calc
Formula=MeasureYear2
Substitut=".0000":""

[MeasureMonth2Num]
Measure=Calc
Formula=MeasureMonth2
Substitut=".0000":""

[MeasureDay2Num]
Measure=Calc
Formula=MeasureDay2
Substitut=".0000":""

[MeasureYear3Num]
Measure=Calc
Formula=MeasureYear3
Substitut=".0000":""

[MeasureMonth3Num]
Measure=Calc
Formula=MeasureMonth3
Substitut=".0000":""

[MeasureDay3Num]
Measure=Calc
Formula=MeasureDay3
Substitut=".0000":""

[MeterDate1]
Meter=String
MeasureName=MeasureMonth1Num
MeasureName2=MeasureDay1Num
MeasureName3=MeasureYear1Num
MeterStyle=FontStyle
X=0
Y=0
Text=Date: %1 %2 %3

[MeterTitle1]
Meter=String
MeasureName=MeasureTitle1
MeterStyle=FontStyle
X=r
Y=R
Text=Title: %1

[MeterDuration1]
Meter=String
MeasureName=MeasureDuration1
MeterStyle=FontStyle
X=r
Y=R
Text=Duration: %1"

[MeterText1]
Meter=String
MeasureName=MeasureText1
MeterStyle=FontStyle
SolidColor=0,0,0,100
X=r
Y=R
W=300
H=95
ClipString=1
Text=Text %1

[MeterDate2]
Meter=String
MeasureName=MeasureMonth2Num
MeasureName2=MeasureDay2Num
MeasureName3=MeasureYear2Num
MeterStyle=FontStyle
X=r
Y=R
Text=Date: %1 %2 %3

[MeterTitle2]
Meter=String
MeasureName=MeasureTitle2
MeterStyle=FontStyle
X=r
Y=R
Text=Title: %1

[MeterDuration2]
Meter=String
MeasureName=MeasureDuration2
MeterStyle=FontStyle
X=r
Y=R
Text=Duration: %1"

[MeterText2]
Meter=String
MeasureName=MeasureText2
MeterStyle=FontStyle
SolidColor=0,0,0,100
X=r
Y=R
W=300
H=95
ClipString=1
Text=Text %1
5-13-2011 2-26-16 PM.jpg
Hope this helps get you off and running...
You do not have the required permissions to view the files attached to this post.
Afaflix
Posts: 5
Joined: May 13th, 2011, 1:20 am

Re: questions on String Handling & Conversion

Post by Afaflix »

jsmorley wrote:Poke around with this and see what I am doing, and it should give you some help to see how to use the approaches in your own skin.
....
Hope this helps get you off and running...
Thank you very much ... I think I got it .. mostly.
I'll read up on lua how to make a text pop-up on a mouse-over.

this is what I came up with, and for now it will do the trick .. just FYI (for a dark background)

Code: Select all

[Rainmeter]
  Update=1000
  DynamicWindowSize=1
  
[Variables]
  fontname1=Orbitron
  fontname2=Trebuchet MS
  URL="file://C:\Users\phn\My Documents\Rainmeter\Skins\TEST\Events\UpcomingCalendarEvents.xml"
  Get=(?(?=.*<row eventID=".*").*<row eventID=".*eventDate="(\d\d\d\d)-(\d\d)-(\d\d) (\d\d):(\d\d):(\d\d)".*eventTitle="(.*)".*duration="(.*)".*eventText="(.*)")

[FontStyle1]
FontFace=Orbitron
FontColor=160,160,160,255
FontSize=10
StringStyle=Bold
AntiAlias=1

[FontStyle2]
FontFace=EveSans
FontColor=199,199,255,255
FontSize=10
StringStyle=Bold
AntiAlias=1

[FontStyle3]
FontFace=EveSans
FontColor=222,222,255,255
FontSize=10
StringStyle=Bold
AntiAlias=1

[FontStyle4]
FontFace=EveSans
FontColor=222,222,255,222
FontSize=10
StringStyle=Bold
AntiAlias=1

[Source]
Measure=Plugin
Plugin=Plugins\WebParser.dll
UpdateRate=1800
Url=#URL#
RegExp="(?siU)#Get##Get##Get#"

[MeasureYear1]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[Source]
StringIndex=1

[MeasureMonth1]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[Source]
StringIndex=2

[MeasureDay1]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[Source]
StringIndex=3

[MeasureHour1]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[Source]
StringIndex=4

[MeasureMinutes1]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[Source]
StringIndex=5

[MeasureSeconds1]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[Source]
StringIndex=6

[MeasureTitle1]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[Source]
StringIndex=7

[MeasureDuration1]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[Source]
StringIndex=8

[MeasureText1]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[Source]
StringIndex=9
Substitute="&#xA;":" ",">":">","<":"<","&":"&",""":""","&Quot;":"","<a href=":"","</a>":"""

[MeasureYear2]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[Source]
StringIndex=10

[MeasureMonth2]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[Source]
StringIndex=11

[MeasureDay2]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[Source]
StringIndex=12

[MeasureHour2]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[Source]
StringIndex=13

[MeasureMinutes2]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[Source]
StringIndex=14

[MeasureSeconds2]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[Source]
StringIndex=15

[MeasureTitle2]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[Source]
StringIndex=16

[MeasureDuration2]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[Source]
StringIndex=17

[MeasureText2]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[Source]
StringIndex=18
Substitute="&#xA;":" ",">":"","<":"","&":"&",""":" ","&Quot;":" ","a href=":"","/a":"""

[MeasureYear3]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[Source]
StringIndex=19

[MeasureMonth3]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[Source]
StringIndex=20

[MeasureDay3]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[Source]
StringIndex=21

[MeasureHour3]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[Source]
StringIndex=22

[MeasureMinutes3]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[Source]
StringIndex=23

[MeasureSeconds3]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[Source]
StringIndex=24

[MeasureTitle3]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[Source]
StringIndex=25

[MeasureDuration3]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[Source]
StringIndex=26

[MeasureText3]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[Source]
StringIndex=27
Substitute="&#xA;":" ",">":">","<":"<","&":"&",""":""","&Quot;":"","<a href=":"","</a>":"""

[MeasureDuration1Min]
Measure=Calc
Formula=TRUNC(MeasureDuration1)

[MeasureDuration1Hr]
Measure=Calc
Formula=TRUNC(MeasureDuration1/60)

[MeasureDuration2Min]
Measure=Calc
Formula=TRUNC(MeasureDuration2)

[MeasureDuration2Hr]
Measure=Calc
Formula=TRUNC(MeasureDuration2/60)

[MeasureDuration3Min]
Measure=Calc
Formula=TRUNC(MeasureDuration1)

[MeasureDuration3Hr]
Measure=Calc
Formula=TRUNC(MeasureDuration3/60)

[MeasureCurrentYear]
Measure=Time
Format=%Y

[MeasureCurrentMonth]
Measure=Time
Format=%m

[MeasureCurrentDay]
Measure=Time
Format=%d

[MeasureCurrentHour]
Measure=Time
Format=%H

[MeasureCurrentMinutes]
Measure=Time
Format=%M

[MeasureCurrentSeconds]
Measure=Time
Format=%S

[MeasureYear1Num]
Measure=Calc
Formula=TRUNC(MeasureYear1)

[MeasureMonth1Num]
Measure=Calc
Formula=TRUNC(MeasureMonth1)

[MeasureDay1Num]
Measure=Calc
Formula=TRUNC(MeasureDay1)

[MeasureHour1Num]
Measure=Calc
Formula=TRUNC(MeasureHour1)

[MeasureMinutes1Num]
Measure=Calc
Formula=TRUNC(MeasureMinutes1)

[MeasureSeconds1Num]
Measure=Calc
Formula=TRUNC(MeasureSeconds1)

[MeasureCountdown1]
Measure=Calc
Formula=((MeasureDay1Num*86400)+(MeasureHour1Num*3600)+(MeasureMinutes1Num*60)+MeasureSeconds1Num)-((MeasureCurrentDay*86400)+(MeasureCurrentHour*3600)+(MeasureCurrentMinutes*60)+MeasureCurrentSeconds)

[MeasureDaysToGo1
Measure=Calc
Formula=TRUNC(MeasureCountdown1/86400)

[MeasureHoursToGo1]
Measure=Calc
Formula=TRUNC((MeasureCountdown1-MeasureDaysToGo1*86400)/3600)

[MeasureMinutesToGo1]
Measure=Calc
Formula=TRUNC((MeasureCountdown1-MeasureDaysToGo1*86400-MeasureHoursToGo1*3600)/60)

[MeasureSecondsToGo1]
Measure=Calc
Formula=TRUNC(MeasureCountdown1-MeasureDaysToGo1*86400-MeasureHoursToGo1*3600-MeasureMinutesToGo1*60)
-------------------------------------------------------------------

[MeasureYear2Num]
Measure=Calc
Formula=TRUNC(MeasureYear2)

[MeasureMonth2Num]
Measure=Calc
Formula=TRUNC(MeasureMonth2)

[MeasureDay2Num]
Measure=Calc
Formula=TRUNC(MeasureDay2)

[MeasureHour2Num]
Measure=Calc
Formula=TRUNC(MeasureHour2)

[MeasureMinutes2Num]
Measure=Calc
Formula=TRUNC(MeasureMinutes2)

[MeasureSeconds2Num]
Measure=Calc
Formula=TRUNC(MeasureSeconds2)

[MeasureCountdown2]
Measure=Calc
Formula=((MeasureDay2Num*86400)+(MeasureHour2Num*3600)+(MeasureMinutes2Num*60)+MeasureSeconds2Num)-((MeasureCurrentDay*86400)+(MeasureCurrentHour*3600)+(MeasureCurrentMinutes*60)+MeasureCurrentSeconds)

[MeasureDaysToGo2
Measure=Calc
Formula=TRUNC(MeasureCountdown2/86400)

[MeasureHoursToGo2]
Measure=Calc
Formula=TRUNC((MeasureCountdown2-MeasureDaysToGo2*86400)/3600)

[MeasureMinutesToGo2]
Measure=Calc
Formula=TRUNC((MeasureCountdown2-MeasureDaysToGo2*86400-MeasureHoursToGo2*3600)/60)

[MeasureSecondsToGo2]
Measure=Calc
Formula=TRUNC(MeasureCountdown2-MeasureDaysToGo2*86400-MeasureHoursToGo2*3600-MeasureMinutesToGo2*60)
---------------------------------------------

[RainletTitle]
Meter=String
MeterStyle=FontStyle1
X=0
Y=0
Text=------ OP Timer ------ OP Timer ------

[MeterCountdown1]
Meter=String
MeasureName=MeasureDaysToGo1
MeasureName2=MeasureHoursToGo1
MeasureName3=MeasureMinutesToGo1
MeasureName4=MeasureSecondsToGo1
MeterStyle=FontStyle2
X=r
Y=R
Text= %1d %2h %3m %4s 

[MeterDate1]
Meter=String
MeasureName=MeasureMonth1
MeasureName2=MeasureDay1
MeasureName3=MeasureYear1
MeasureName4=MeasureHour1
MeasureName5=MeasureMinutes1
MeterStyle=FontStyle2
X=r
Y=R
Text= %1 %2 %3  at - %4:%5

[MeterTitle1]
Meter=String
MeasureName=MeasureTitle1
MeterStyle=FontStyle3
X=r
Y=R

[MeterText1]
Meter=String
MeasureName=MeasureText1
MeterStyle=FontStyle4
X=r
Y=R
W=300
H=115
ClipString=1

[MeterCountdown2]
Meter=String
MeasureName=MeasureDaysToGo2
MeasureName2=MeasureHoursToGo2
MeasureName3=MeasureMinutesToGo2
MeasureName4=MeasureSecondsToGo2
MeterStyle=FontStyle2
X=r
Y=R
Text= %1d %2h %3m %4s 

[MeterDate2]
Meter=String
MeasureName=MeasureMonth2
MeasureName2=MeasureDay2
MeasureName3=MeasureYear2
MeasureName4=MeasureHour2
MeasureName5=MeasureMinutes2
MeterStyle=FontStyle2
X=r
Y=R
Text= %1 %2 %3  at - %4:%5

[MeterTitle2]
Meter=String
MeasureName=MeasureTitle2
MeterStyle=FontStyle3
X=r
Y=R

[MeterText2]
Meter=String
MeasureName=MeasureText2
MeterStyle=FontStyle4
X=r
Y=R
W=300
H=115
ClipString=1

Thanks again.
User avatar
jsmorley
Developer
Posts: 22631
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: questions on String Handling & Conversion

Post by jsmorley »

You are quite welcome. Be sure to look at ToolTip in the Rainmeter manual for a popup on mouse over. I don't think you should need Lua for that.