It is currently May 1st, 2024, 9:22 am

Substitute wont work like I want it to.

Get help with creating, editing & fixing problems with skins
junnyuu
Posts: 4
Joined: May 20th, 2012, 9:31 am

Substitute wont work like I want it to.

Post by junnyuu »

Hi, I've done some google search and tried to theme myself. Problem is, substitute will only work with %I and not %H. I want %H because i can substitute. what hours I want to be good morning, good evening and good night. but %I only has 12 hours, i don't know how to substitute it.

Here's some code that i copied and modded

Code: Select all

[Rainmeter]
Author:Junyu
Update=1000


[Variables]
Font=Trebuchet MS
Name=Junyu
Color=255, 255, 255
pm=%I%p

;----------MEASURES----------
//[msTime]
//Measure=Time
//Format=%#H
//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"

//[msAPM]
//Measure=Time
//Format=%p


//[mtstring]
//Meter=String
//MeasureName=msTime
//Measurename2=msAPM
//FontColor=#color#, 255
//FontSize=20
//AntiAlias=1


[MeasureTime]
Measure=Time
Format=%X




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

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

Anyone know how to make %H substitute=able or make %I and %p the same thing so that I can substitute 05AM and 05PM differently?
User avatar
jsmorley
Developer
Posts: 22631
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Substitute wont work like I want it to.

Post by jsmorley »

You can't use Format=%#H and then look for "05" in the substitute, as the "#" char in the format means "strip off leading zeros". You are also searching for " 05" when it is returning (or will be when you take off the "#") "05". Also, the spaces in front of the text replacements like " Good morning" are pointless. Use the X and Y formatting of the meters to handle spacing.

So this works fine for me:

Code: Select all

[Rainmeter]
Author:Junyu
Update=1000

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

;----------MEASURES----------
[msTime]
Measure=Time
Format=%H
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=msTime
Meter=String
W=700
H=50
FontColor=#Color#,255
FontSize=20
FontFace=#Font#
StringAlign=Left
AntiAlias=1

junnyuu
Posts: 4
Joined: May 20th, 2012, 9:31 am

Re: Substitute wont work like I want it to.

Post by junnyuu »

jsmorley wrote:You can't use Format=%#H and then look for "05" in the substitute, as the "#" char in the format means "strip off leading zeros". You are also searching for " 05" when it is returning (or will be when you take off the "#") "05". Also, the spaces in front of the text replacements like " Good morning" are pointless. Use the X and Y formatting of the meters to handle spacing.

So this works fine for me:

Code: Select all

[Rainmeter]
Author:Junyu
Update=1000

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

;----------MEASURES----------
[msTime]
Measure=Time
Format=%H
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=msTime
Meter=String
W=700
H=50
FontColor=#Color#,255
FontSize=20
FontFace=#Font#
StringAlign=Left
AntiAlias=1

wow.. such an "easy" fix yet i couldn't figure it out @.@ I feel useless now. but thank you! :)
User avatar
jsmorley
Developer
Posts: 22631
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Substitute wont work like I want it to.

Post by jsmorley »

My pleasure. Hey, we were all new at this at some point.