It is currently April 28th, 2024, 7:13 am

!setvariable help needed

Get help with creating, editing & fixing problems with skins
User avatar
Yincognito
Rainmeter Sage
Posts: 7178
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: !setvariable help needed

Post by Yincognito »

balala wrote: December 25th, 2023, 3:41 pm Little bit late in this party, but in fact there is one more, which has not been mentioned in your list: even if [MeasureSentValue] of the sending skin would be a "real" measure (having a Measure=... option), adding a bang just like that in its code, get's nothing working. That bang (in this case the !SetVariable) not being included into an option, just being posted there, is never executed (even if it'sd correct, even less if it's not).
Well, there were way too many issues with that code - at one point I considered to just skip pointing them altogether and just post the correct sample. But you're correct, whatever [!SetVariable ...] or [!SetOption ...] bangs should have been added only after an ...Action= part (i.e. an action option) that would have started the line and provided the framework for such bangs to work.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
balala
Rainmeter Sage
Posts: 16183
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: !setvariable help needed

Post by balala »

Yincognito wrote: December 25th, 2023, 4:24 pm Well, there were way too many issues with that code - at one point I considered to just skip pointing them altogether and just post the correct sample.
Yep, right. When I came over the forum and saw this topic, the first thing which caught my attention was that "orphan" bang. This is why I posted.
Laaglander
Posts: 15
Joined: April 25th, 2015, 9:45 pm

Re: !setvariable help needed

Post by Laaglander »

i have changed it and i have now 2 nice rows and the numbers are now nicely and easely adding up.

i indeed use for every single block a new webparser, because in the url the name of the crypto is being used to get the correct number
User avatar
Yincognito
Rainmeter Sage
Posts: 7178
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: !setvariable help needed

Post by Yincognito »

Laaglander wrote: December 26th, 2023, 4:54 pm i have changed it and i have now 2 nice rows and the numbers are now nicely and easely adding up.

i indeed use for every single block a new webparser, because in the url the name of the crypto is being used to get the correct number
Glad to see you managed to achieve what you wanted. Yeah, using multiple WebParsers is indeed needed in certain cases. :thumbup:
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
Laaglander
Posts: 15
Joined: April 25th, 2015, 9:45 pm

Re: !setvariable help needed

Post by Laaglander »

most likely you hit your head when you see the script :D but for know it is doing what i hope it does. perhaps i will extent on this.
Laaglander
Posts: 15
Joined: April 25th, 2015, 9:45 pm

Re: !setvariable help needed

Post by Laaglander »

if i may .. i have another question in the same script.

Code: Select all

[MetersingleValue11]
Meter=String
Text="De huidige waarde:"
X=300
Y=15r
FontColor=#FFFFFF#
DynamicVariables=1

[MetersingleValue11b]
Meter=String
MeasureName=MeasurePrice11
Text="%1 Euro"
X=125R
Y=r
StringAlign=Right
FontColor=117,199,235,255
NumOfDecimals=5
DynamicVariables=1
what i want is that the output of 1% is with max 5 decimals, but still with 10. I collect the data with 10 and i want the script to calculate with all 10, but the output only with 5. I probably doing something wrong, but wat?
User avatar
Yincognito
Rainmeter Sage
Posts: 7178
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: !setvariable help needed

Post by Yincognito »

Laaglander wrote: January 9th, 2024, 10:39 pm if i may .. i have another question in the same script.

Code: Select all

[MetersingleValue11]
Meter=String
Text="De huidige waarde:"
X=300
Y=15r
FontColor=#FFFFFF#
DynamicVariables=1

[MetersingleValue11b]
Meter=String
MeasureName=MeasurePrice11
Text="%1 Euro"
X=125R
Y=r
StringAlign=Right
FontColor=117,199,235,255
NumOfDecimals=5
DynamicVariables=1
what i want is that the output of 1% is with max 5 decimals, but still with 10. I collect the data with 10 and i want the script to calculate with all 10, but the output only with 5. I probably doing something wrong, but wat?
You're not doing anything wrong, Rainmeter works with a maximum of 5 decimals (well, at least the string representation of a numerical value does). If you want to display more, you'd have to do your calculations in Lua (or, if you're directly displaying some values scraped from a webpage, use it as a plain string, without converting it to a number) and similarly return the result as a plain string and not a number.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
balala
Rainmeter Sage
Posts: 16183
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: !setvariable help needed

Post by balala »

Laaglander wrote: January 9th, 2024, 10:39 pm what i want is that the output of 1% is with max 5 decimals, but still with 10. I collect the data with 10 and i want the script to calculate with all 10, but the output only with 5. I probably doing something wrong, but wat?
I might lose something important at this point, but unlike Yincognito, I suspect something different here. What I believe is that you want to get the number returned by the not-posted [MeasurePrice11] measure with certain number of decimals, while [MeasurePrice11] is most probably a WebParser measure, isn't it? If I'm right and it really is, there is another problem: a WebParser measure returns its result as a string, even if that's in fact a number. Due to this, applying the NumOfDecimals option is vain: it has no effect in such cases. To get it applied, you have to either pass the returned value through a Calc measure (this is a little bit more complicated solution, because you need an additional Calc measure), or have to use a properly written section variable in the [MetersingleValue11b] String meter. So, both of the following two solutions should work:
  • Solution 1:

    Code: Select all

    [MeasurePrice11C]
    Measure=Calc
    Formula=MeasurePrice11
    
    ...
    
    [MetersingleValue11b]
    Meter=String
    MeasureName=MeasurePrice11C
    Text=%1 Euro
    X=125R
    Y=r
    StringAlign=Right
    FontColor=117,199,235,255
    NumOfDecimals=5
    DynamicVariables=1
  • Solution 2:

    Code: Select all

    [MetersingleValue11b]
    Meter=String
    Text=[MeasurePrice11:5]
    X=125R
    Y=r
    StringAlign=Right
    FontColor=117,199,235,255
    DynamicVariables=1
    Note in this case the [MeasurePrice11:5] section variable, used into the Text option: the :5 parameter tells Rainmeter to show the result with 5 decimals. Obviously you can adjust the number of needed decimals simply by using the proper number. In this case the NumOfDecimals option is not needed and has no effect (even if you add it).
Both above two solution applies ONLY if my assumption that [MeasurePrice11] is a WebParser measure is correct.
Laaglander
Posts: 15
Joined: April 25th, 2015, 9:45 pm

Re: !setvariable help needed

Post by Laaglander »

Thank you both.

and yes balala you are right, this is indeed a webparser, so before i going to try the very first option, i will try your options first.
I will at the end show here what i have made, i am very proud of what is have made so far :)
User avatar
balala
Rainmeter Sage
Posts: 16183
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: !setvariable help needed

Post by balala »

Laaglander wrote: January 12th, 2024, 6:17 pm and yes balala you are right, this is indeed a webparser, so before i going to try the very first option, i will try your options first.
I will at the end show here what i have made, i am very proud of what is have made so far :)
Alright, just let us know what has went on, when you've tried it out.