Hello! i'm new here and I really like this software. I have experience in coding but I need some help to understand some details
I have variable:
CurrentItem=0
And some meters:
[Item1]
..
[Item10]
How can i get the reference of meter? I'm trying this code but it does not work
[&Item[#CurrentItem]]
I need to do the following stuff
[!SetOption [&Item[#CurrentItem]] SolidColor "0,0,0,0"]
It is currently April 18th, 2024, 7:59 am
Reference of meter
-
- Posts: 3
- Joined: August 4th, 2018, 6:34 pm
-
- Rainmeter Sage
- Posts: 16143
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
Re: Reference of meter
First you have to add a DynamicVariables=1 option to the meter / measure which use those Nesting Variables.disawar wrote:I need to do the following stuff
[!SetOption [&Item[#CurrentItem]] SolidColor "0,0,0,0"]
But secondly, I don't think in this case a such complicated approach would be needed. You can simply use the following form of the bang: [!SetOption Item#CurrentItem# SolidColor "0,0,0,0"] (or probably a similar result would be given by the [!HideMeter "Item#CurrentItem#"] bang, but this only if you don't have there something like a shadow, which has to remain visible, even if you set transparent fonts). Take care that this approach also requires the DyanmicVariables=1 option.
-
- Posts: 3
- Joined: August 4th, 2018, 6:34 pm
Re: Reference of meter
Thank you it help! I have one more question.
Rainmeter Logs throw an error "Calc: Division by 0", but I did check for a negative number.
Rainmeter Logs throw an error "Calc: Division by 0", but I did check for a negative number.
Code: Select all
[Variables]
Value=1
[MeasureCalc]
Measure=Calc
Formula=#Value# = 0 ? 0 : (100/#Value#)
MinValue=0
MaxValue=100
DynamicVariables=1
-
- Posts: 3
- Joined: August 4th, 2018, 6:34 pm
Re: Reference of meter
Here the solution. Thank @sclaronda for helping me in discord.
Code: Select all
Formula=#Value# = 0 ? 0 : (100*(#Value#**(-1)))