It is currently May 8th, 2024, 11:58 pm

Help with substitute

Get help with creating, editing & fixing problems with skins
ms310
Posts: 225
Joined: April 1st, 2015, 7:16 am

Help with substitute

Post by ms310 »

Hello

I am picking apart a skin and found this:

Code: Select all

[MeasureWeatherCond]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[MeasureCurrent]
StringIndex=4
Substitute=#Conditions#
The text "Conditions" or "#Conditions#" does not exist ANYWHERE in any of the files. Is Substitute line, in this case, actually doing something?

I am also confused by this part - I don't see a variable called "counter" anywhere.

Code: Select all

[IconNumberCalc]
Measure=Calc
Formula=Counter % 87
The skin comes from here:

https://www.deviantart.com/by-segaal/art/Tri-Station-1-11-754643808
ms310
Posts: 225
Joined: April 1st, 2015, 7:16 am

Re: Help with substitute

Post by ms310 »

Consider this closed. Found this in the "About" for Rainmeter:

Measure: Invalid Substitute="#Conditions#" (Tri-Station\COLOR.ini - [MeasureWeatherCond])

So - to answer my first question, it was doing nothing.

For the second I found this:

https://docs.rainmeter.net/tips/counters-guide/

Thanks!
mak_kawa
Posts: 908
Joined: December 30th, 2015, 9:47 am

Re: Help with substitute

Post by mak_kawa »

First, do you see the line like @include=XXXXXX.inc in [Variables] sedction of the skin? Probably, #Conditions# variable is stored in that file.

Second, "Counter" is not a variable but a special function of the Calc measure. See Rainmeter documents.

Edit: Sorry for too late reply.
User avatar
balala
Rainmeter Sage
Posts: 16206
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Help with substitute

Post by balala »

ms310 wrote: December 17th, 2019, 12:31 am The text "Conditions" or "#Conditions#" does not exist ANYWHERE in any of the files. Is Substitute line, in this case, actually doing something?
Conditions in this case is a variable. A variable has a name (in this case Conditions), but if you want to use that variable anywhere you're referencing to it as #Conditions#. To can be used into the mentioned measure, it indeed should be declared into the [Variables] section, either into the skins .ini file itself, or into an included file (read mak_kawa's reply above). In many cases you can't figure out easily where the variable is declared, so if you want to assure it can be used, you should add a String meter to the code, which should show the variable, something like this:

Code: Select all

[MeterSubstitute]
Meter=STRING
X=0
Y=0
Padding=15,5,15,5
FontColor=220,220,220
FontEffectColor=0,0,0
StringEffect=Shadow
SolidColor=0,0,0,150
FontSize=8
FontFace=Segoe UI
StringStyle=BOLD
StringAlign=LEFT
AntiAlias=1
Text=#Conditions#
DynamicVariables=1
(add this meter to the end of your code, after the [SettingsIcon] meter).
In the upper left corner of your skin, should be shown either the effective value of the variable (if it is properly declared somewhere), or #Conditions# (if it is not declared, or not properly declared).
In this case the second case is going on, so you see #Conditions#, instead of the current value of the variable, which means it's not declared, so practically it's useless.
User avatar
jsmorley
Developer
Posts: 22631
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Help with substitute

Post by jsmorley »

Seems to me that the easier way to see if a #Variable# exists or not, and what it's current value is, is to simply look in About/Skins...

Code: Select all

[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1

[Variables]
Conditions=I'm Here!

[MeterString]
Meter=String
FontSize=11
FontWeight=400
FontColor=255,255,255,255
SolidColor=47,47,47,255
Padding=5,5,5,5
AntiAlias=1
Text=Hello World

1.png
You do not have the required permissions to view the files attached to this post.
User avatar
balala
Rainmeter Sage
Posts: 16206
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Help with substitute

Post by balala »

jsmorley wrote: December 17th, 2019, 3:21 pm Seems to me that the easier way to see if a #Variable# exists or not, and what it's current value is, is to simply look in About/Skins...
Obviously, as usually, more ways to achieve the same result...
ms310
Posts: 225
Joined: April 1st, 2015, 7:16 am

Re: Help with substitute

Post by ms310 »

Thank you both - I have learned a bit more how to debug !

This was not my Skin so I was unclear on if there was something internal going on (like the Counter) or not.

Cheers!
User avatar
balala
Rainmeter Sage
Posts: 16206
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Help with substitute

Post by balala »

ms310 wrote: December 19th, 2019, 6:34 am This was not my Skin so I was unclear on if there was something internal going on (like the Counter) or not.
About the Counter note that the link ms310 had posted:
ms310 wrote: December 17th, 2019, 1:24 am For the second I found this:

https://docs.rainmeter.net/tips/counters-guide/
This is not exactly what you need for, because it is a description on how to create counting functions in Rainmeter. But here is a short description of the Counter function. As you can see it is (as its name says) a counter function, which numbers the update cycles. What is important is that it starts counting when you load the skin and a refresh doesn't reset it. To reset it you have to unload the skin, then load it again.
ms310
Posts: 225
Joined: April 1st, 2015, 7:16 am

Re: Help with substitute

Post by ms310 »

balala wrote: December 19th, 2019, 7:37 am About the Counter note that the link ms310 had posted:

This is not exactly what you need for, because it is a description of how to create counting functions in Rainmeter. But here is a short description of the Counter function. As you can see it is (as its name says) a counter function, which numbers the update cycles. What is important is that it starts counting when you load the skin and a refresh doesn't reset it. To reset it you have to unload the skin, then load it again.
Thank you very much. This skin in question is something I am still investigating. I am using a different weather source with a different icon sequence for my current creation so the icons are different. One thing about the skin I based mine off of is the sun or moon (time of day) moves like a GIF. I really like that but have not done enough study of the skin to figure it out. I will get there!

Thanks for always being helpful!
User avatar
balala
Rainmeter Sage
Posts: 16206
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Help with substitute

Post by balala »

ms310 wrote: December 19th, 2019, 10:47 am One thing about the skin I based mine off of is the sun or moon (time of day) moves like a GIF. I really like that but have not done enough study of the skin to figure it out. I will get there!
Would be extremely curious how this has been done. Could you please post a sample package when it is ready? Thanks.