It is currently October 21st, 2019, 4:13 am

Another noob question.

Help with creating, editing & fixing problems with skins
Xune531
Posts: 10
Joined: March 16th, 2010, 10:01 pm

Another noob question.

Xune531 » May 22nd, 2010, 3:44 am

Say I want to make a config that displays text as if its being said.
Example: if its 11:39PM on friday it say

Good evening ,#NAME#. The current time is 11:39 at night on Friday.

I want the "Good evening" to be a changing phrase, the goes from "Good morning" to "good afternoon" to "good evening".

The problem is I also want "at night" to match the greeting. Do I need to code these together?

I'm using Substitute to get both to read out, but I want them to be one phrase.
User avatar
smurfier
Moderator
Posts: 1937
Joined: January 29th, 2010, 1:43 am
Location: Willmar, MN

Re: Another noob question.

smurfier » May 22nd, 2010, 3:21 pm

You can use multiple measures in one string meter:

Code: Select all

[mtString]
Meter=String
MeasureName=SomeMeasure
MeasureName2=SomeOtherMeasure
MeasureName3=AndSoOn
Text="%1 and %2, but don't forget %3"
I'm guessing that's what you needed.
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 . . .
Xune531
Posts: 10
Joined: March 16th, 2010, 10:01 pm

Re: Another noob question.

Xune531 » May 22nd, 2010, 9:55 pm

That works great!

Another problem I'm having is with the substitute line.

I have the config measuring time twice, but the two have different functions. I want the First to Substitute the time for "In the Afternoon" Ect, and the other for "Good afternoon" Ect. But it keeps displaying the time and the substitute. How do I make it only show the substitute? Is there a different Measure I should use?
User avatar
smurfier
Moderator
Posts: 1937
Joined: January 29th, 2010, 1:43 am
Location: Willmar, MN

Re: Another noob question.

smurfier » May 22nd, 2010, 11:58 pm

My suggestion is to Measure the time in 24 hour format, then use a calc measure to do the substitution.

Code: Select all

[msTime]
Measure=Time
Format=%#I

[msSub]
Measure=Calc
Formula=msTime<12 && mstime>6 ? 1 : (msTime>12 && msTime<18 ? 2 : 3)
Substitute="1":"Good morning","2":"Good afternoon","3":"Good evening"
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 . . .
Xune531
Posts: 10
Joined: March 16th, 2010, 10:01 pm

Re: Another noob question.

Xune531 » May 23rd, 2010, 2:24 am

Here's the Code:

Code: Select all

[Rainmeter]
Author:Xune531
Update=1000
Title=Greeting Config

[Variables]
Font=Trebuchet MS
Name=Peter
Color=255, 255, 255

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

[MeasureTime]
Measure=Time
Format=%H:%M %I #Name#
Substitute=" 00":" Good morning"," 01":" Good morning"," 02":" Good morning"," 03":" Good morning"," 04":" Good morning"," 05":" Good morning"," 06":" Good morning"," 07":" Good morning"," 08":" Good morning"," 09":" Good morning"," 10":" Good morning"," 11":" Good morning"," 12":" Good afternoon"," 13":" Good afternoon"," 14":" Good afternoon"," 15":" Good afternoon"," 16":" Good afternoon"," 17":" Good afternoon"," 18":" Good evening"," 19":" Good evening"," 20":" Good evening"," 21":" Good evening"," 22":" Good evening"," 23":" Good evening"


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

[MeterTime]
MeasureName=MeasureTime
Meter=String
W=700
H=50
FontColor=#Color#, 255
FontSize=20
FontFace=#Font#
StringAlign=Left
AntiAlias=1

It displays "11:65 Good Morning Peter"

How do I make it hide the actual numerical time? I just want it to show the phrase, but if I try to remove the numbers it removes the "Good morning."