I want to change my X position if some measure have "one" inside it (the number)
But can't find any "contains" for the syntax here
Can you guide me to the right way?
It is currently May 3rd, 2024, 10:57 am
X Y string position based up on other measure value
-
- Posts: 6
- Joined: April 24th, 2012, 9:07 am
-
- Posts: 1173
- Joined: January 22nd, 2011, 4:23 pm
- Location: GMT +8
Re: X Y string position based up on other measure value
I suspect you could use Substitute to get the X position. It would help if you gave us some idea of the range and format of number values you are expecting from the measure you want to use to change the X value..
-
- Posts: 6
- Joined: April 24th, 2012, 9:07 am
Re: X Y string position based up on other measure value
Code: Select all
[Rainmeter]
Update=1000
[TimeMeasure]
Measure=Time
Format=%S
[TimeText]
Meter=String
MeasureName=TimeMeasure
X=5
Y=5
W=100
H=25
FontColor=255,255,255,255
Text="Seconds: %1"
To make it clearer I mean all numbers with 1 inside.. like 21;12;11;41;15 etc.
-
- Posts: 1173
- Joined: January 22nd, 2011, 4:23 pm
- Location: GMT +8
Re: X Y string position based up on other measure value
Something like this might work:atuum wrote:To make it clearer I mean all numbers with 1 inside.. like 21;12;11;41;15 etc.
Code: Select all
[Variables]
XposOnes=111
XposNoOnes=0
[TimeMeasure]
Measure=Time
Format=%S
Substitute="01":"#XposOnes#", "10":"#XposOnes#", "11":"#XposOnes#", "12":"#XposOnes#", "13":"#XposOnes#", "14":"#XposOnes#", "15":"#XposOnes#", "16":"#XposOnes#", "17":"#XposOnes#", "18":"#XposOnes#", "19":"#XposOnes#", "21":"#XposOnes#","31":"#XposOnes#", "41":"#XposOnes#", "51":"#XposOnes#"
DynamicVariables=1
[ChangeXpos]
Measure=Calc
Formula=([TimeMeasure]*1)
IfBelowValue=#XposOnes#
IfBelowAction=[!SetVariable Xpos #XposNoOnes#]
IfEqualValue=#XposOnes#
IfEqualAction=[!SetVariable Xpos #XposOnes#]
DynamicVariables=1
EDIT2: I knew there would be a neater Substitute= way (like that provided by Kaelri below).
EDIT3: Carrying on as usual one step behind everyone else
Last edited by Mordasius on November 12th, 2012, 2:59 pm, edited 3 times in total.
-
- Developer
- Posts: 1721
- Joined: July 25th, 2009, 4:47 am
Re: X Y string position based up on other measure value
Code: Select all
RegExpSubstitute=1
Substitute="^[^1]*$":"#No#","(.*)1(.*)":"#Yes#"
The catch is that the "No" value cannot contain a "1" character itself, because then it will be matched by the second substitute rule (as if there was a "1" in the original value). That means if you want, say, X=10 or X=21 when there is no "1", you'll have to work around this a little bit. The cleanest example would be to use a conditional in your formula:
Code: Select all
RegExpSubstitute=1
Substitute="^[^1]*$":"0","(.*)1(.*)":"1"
Code: Select all
X=([TimeMeasure] = 1 ? #Yes# : #No#)
EDIT 2: Although I guess that doesn't really matter in this case, since it will be replaced with itself. Nevermind, carry on. :)
-
- Posts: 6
- Joined: April 24th, 2012, 9:07 am
Re: X Y string position based up on other measure value
Thank you all for your time! Maybe I will stop modifying my skin.. pretty satisfied with the result, but most important I'm don't understand anything already