It is currently June 16th, 2024, 2:30 am

Help to assemble a formula

Get help with creating, editing & fixing problems with skins
User avatar
balala
Rainmeter Sage
Posts: 16305
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Help to assemble a formula

Post by balala »

arcanosa84 wrote: September 17th, 2023, 5:07 am I am having problems writing a variable, when there is only one there are no problems, but I want to write the same value to several at the same time, I wrote it this way and it does not work, can you tell me what I am doing wrong???
I was reading but I only see that it can be done with one but try what they explain in Command1 so as not to make a super extensive code, I need 7 variables to take the edited value at the time I apply it, but I cannot join them, they all have different colors assigned, when I restore the default skin colors.
I don't know how to do it right, or how would it be applied? :confused: :confused:
As you figured it out, you have a problem with the $UserInput$ variables, which is used more times (seven times, to be precise) in a single Command1 option. In such cases you either have to divide the bangs of the option into different Command1 - Command7 options, or, if you want to use one single such option, all $UserInput$ variables excepting the first one, have to be replaced by the name of the measure. This way the above measure, written correctly, has to look this way:

Command1=[!WriteKeyValue Variables ColorRecycleBG "$UserInput$" "#@#\Config\Styles.inc"][!WriteKeyValue Variables ColorSpeedFanBG2 "[MeterInputBGGC]" "#@#\Config\Styles.inc"][!WriteKeyValue Variables ColorRecycledF "[MeterInputBGGC]" "#@#\Config\Styles.inc"][!WriteKeyValue Variables ColorRecycledF2 "[MeterInputBGGC]" "#@#\Config\Styles.inc"][!WriteKeyValue Variables ColorCircleF1 "[MeterInputBGGC]" "#@#\Config\Styles.inc"][!WriteKeyValue Variables CircleColorLL "[MeterInputBGGC]" "#@#\Config\Styles.inc"][!WriteKeyValue Variables CircleColorF2 "[MeterInputBGGC]" "#@#\Config\Styles.inc"]

I think you've figured out the explanation, even if you didn't really understand it.
Note beside the updated variables, the space I left between the "[MeterInputBGGC]" and the next "#@#\Config\Styles.inc" parameter. You've bound them together, left no space between their quotes. Even if strictly speaking the option can work even with no such space, it's much better to use them.

And one more: [MeterInputBGGC] is a measure, not a meter. From the point of view of Rainmeter, this has not too much importance, it can work very well even so, but for a user looking to your code (or even for you after a while), this can be extremely confusing. I recommend to use the correct syntax and rename the section as [MeasureInputBGGC].
User avatar
arcanosa84
Posts: 173
Joined: May 21st, 2023, 1:47 am

Re: Help to assemble a formula

Post by arcanosa84 »

balala wrote: September 17th, 2023, 2:40 pm The backgroundf can be dark, light or green, depending on your option. But doesn't matter which theme did you choose, you have to look for the download icon. See marked it red in the attached screenshot:
DevArt.png
I already managed to download it, I don't have access to this page from my country, as it says, but I already entered it and downloaded it. excellent work, I really liked it. :bow: :bow: :bow:
:Whistle :Whistle Learning is the most complete art of life. Just enjoy it. :bow: :bow:
User avatar
arcanosa84
Posts: 173
Joined: May 21st, 2023, 1:47 am

Re: Help to assemble a formula

Post by arcanosa84 »

balala wrote: September 17th, 2023, 3:06 pm As you figured it out, you have a problem with the $UserInput$ variables, which is used more times (seven times, to be precise) in a single Command1 option. In such cases you either have to divide the bangs of the option into different Command1 - Command7 options, or, if you want to use one single such option, all $UserInput$ variables excepting the first one, have to be replaced by the name of the measure. This way the above measure, written correctly, has to look this way:

Command1=[!WriteKeyValue Variables ColorRecycleBG "$UserInput$" "#@#\Config\Styles.inc"][!WriteKeyValue Variables ColorSpeedFanBG2 "[MeterInputBGGC]" "#@#\Config\Styles.inc"][!WriteKeyValue Variables ColorRecycledF "[MeterInputBGGC]" "#@#\Config\Styles.inc"][!WriteKeyValue Variables ColorRecycledF2 "[MeterInputBGGC]" "#@#\Config\Styles.inc"][!WriteKeyValue Variables ColorCircleF1 "[MeterInputBGGC]" "#@#\Config\Styles.inc"][!WriteKeyValue Variables CircleColorLL "[MeterInputBGGC]" "#@#\Config\Styles.inc"][!WriteKeyValue Variables CircleColorF2 "[MeterInputBGGC]" "#@#\Config\Styles.inc"]

I think you've figured out the explanation, even if you didn't really understand it.
Note beside the updated variables, the space I left between the "[MeterInputBGGC]" and the next "#@#\Config\Styles.inc" parameter. You've bound them together, left no space between their quotes. Even if strictly speaking the option can work even with no such space, it's much better to use them.

And one more: [MeterInputBGGC] is a measure, not a meter. From the point of view of Rainmeter, this has not too much importance, it can work very well even so, but for a user looking to your code (or even for you after a while), this can be extremely confusing. I recommend to use the correct syntax and rename the section as [MeasureInputBGGC].
I now completely understand, that is, I could have done several Command1 - Command7 and indicated to execute them, I think that was easier to understand, but when I tried to understand the manual I see that it could be done at once, but I did not understand how to use the measure , which I already understood perfectly.

I now completely understand, that is, I could have done several Command1 - Command7 and indicated to execute them, I think that was easier to understand, but when I tried to understand the manual I see that it could be done at once, but I did not understand how to use the measure , which I already understood perfectly.
The space that I was missing between the quotes, well, I will really take your advice and rectify that whole part since I have 2 buttons, one to restore all the colors when clicking the mouse and the other is for all the settings, and I also have it without space between the "", good information and thanks for correcting me.
Regarding the name of [MeterInputBGGC] in reality I still have my doubts about how rainmeter understands as measurement, meter and so on, but well little by little I am clarifying and rectifying myself, I imagine that in everything I have done there must be thousands of errors, perhaps minor ones. because it works to a certain point, but when I finish it I'll publish it and they'll approve it.
Your explanation is masterful, I understood it perfectly, now I will get to work and rectify everything you recommended and add the line to write the variables.
Again, thank you very much for the masterful guide. :great: :great: :thumbup: :thumbup: :bow: :bow: :bow:
:Whistle :Whistle Learning is the most complete art of life. Just enjoy it. :bow: :bow:
User avatar
balala
Rainmeter Sage
Posts: 16305
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Help to assemble a formula

Post by balala »

arcanosa84 wrote: September 17th, 2023, 5:32 pm excellent work, I really liked it.
Thanks and I'm glad. However many user out there are saying the skins are extremely - extremely complex and I agree. They indeed are and an enough powerful computer is needed to can get them running properly. On slower, older machines is hard to use those skins.
arcanosa84 wrote: September 17th, 2023, 5:56 pm I now completely understand, that is, I could have done several Command1 - Command7 and indicated to execute them, I think that was easier to understand, but when I tried to understand the manual I see that it could be done at once, but I did not understand how to use the measure , which I already understood perfectly.
Alright, I'm glad. Once again!
arcanosa84 wrote: September 17th, 2023, 5:56 pm The space that I was missing between the quotes, well, I will really take your advice and rectify that whole part since I have 2 buttons, one to restore all the colors when clicking the mouse and the other is for all the settings, and I also have it without space between the "", good information and thanks for correcting me.
You're welcome. As said, the bangs work even if that space is missed. But in my opinion it's always better to write / use them properly, especially to form you a good habit on writing them.
arcanosa84 wrote: September 17th, 2023, 5:56 pm Regarding the name of [MeterInputBGGC] in reality I still have my doubts about how rainmeter understands as measurement, meter and so on, but well little by little I am clarifying and rectifying myself, I imagine that in everything I have done there must be thousands of errors, perhaps minor ones. because it works to a certain point, but when I finish it I'll publish it and they'll approve it.
Rainmeter has no problem at all on how are you naming the sections. You can name a measure as [Meter...] or vice-versa, doesn't really matter. What matters is that if you'll want to work with your own code after a while (for instance a few years from now and if you like Rainmeter, you'll want, I assure you), those not-properly named section will mislead you. To avoid this choosing proper names is a good practice.
arcanosa84 wrote: September 17th, 2023, 5:56 pm Your explanation is masterful, I understood it perfectly, now I will get to work and rectify everything you recommended and add the line to write the variables.
Again, thank you very much for the masterful guide.
Thank you. As already said, I'm glad if you did understand what I explained.
User avatar
arcanosa84
Posts: 173
Joined: May 21st, 2023, 1:47 am

Re: Help to assemble a formula

Post by arcanosa84 »

balala wrote: September 17th, 2023, 6:38 pm Thanks and I'm glad. However many user out there are saying the skins are extremely - extremely complex and I agree. They indeed are and an enough powerful computer is needed to can get them running properly. On slower, older machines is hard to use those skins.

Alright, I'm glad. Once again!

You're welcome. As said, the bangs work even if that space is missed. But in my opinion it's always better to write / use them properly, especially to form you a good habit on writing them.

Rainmeter has no problem at all on how are you naming the sections. You can name a measure as [Meter...] or vice-versa, doesn't really matter. What matters is that if you'll want to work with your own code after a while (for instance a few years from now and if you like Rainmeter, you'll want, I assure you), those not-properly named section will mislead you. To avoid this choosing proper names is a good practice.

Thank you. As already said, I'm glad if you did understand what I explained.
Yes, it is true that your skin is quite complex, but that makes it interesting, it looks very good, and it looks phenomenal, I don't know if it is because of my PC or something I did wrong, the rotating globe has a sequence that fails, that is, it starts to turn and then it seems to stop and then it continues, it was the only thing that happened to me, the rest I was amazed. It is the most complex skin I have seen. :great: :great:
:Whistle :Whistle Learning is the most complete art of life. Just enjoy it. :bow: :bow:
User avatar
arcanosa84
Posts: 173
Joined: May 21st, 2023, 1:47 am

Re: Help to assemble a formula

Post by arcanosa84 »

balala wrote: September 17th, 2023, 6:38 pm Thanks and I'm glad. However many user out there are saying the skins are extremely - extremely complex and I agree. They indeed are and an enough powerful computer is needed to can get them running properly. On slower, older machines is hard to use those skins.

Alright, I'm glad. Once again!

You're welcome. As said, the bangs work even if that space is missed. But in my opinion it's always better to write / use them properly, especially to form you a good habit on writing them.

Rainmeter has no problem at all on how are you naming the sections. You can name a measure as [Meter...] or vice-versa, doesn't really matter. What matters is that if you'll want to work with your own code after a while (for instance a few years from now and if you like Rainmeter, you'll want, I assure you), those not-properly named section will mislead you. To avoid this choosing proper names is a good practice.

Thank you. As already said, I'm glad if you did understand what I explained.
I was checking to see if I learned anything from your code, uffff I think I will learn very little. I saw that you animated an icon in a different way than I know, but I couldn't separate that part of the code to understand it. This icon that I show attached is how I can animate it.
I have it this way, which has helped me animate the planets and some icons, where 74 is the number of images in the folder, for example Venus0 to Venus73 and it changes them, but in yours it is impossible to see what it would be like, at least for me. O.O O.O

Code: Select all

[measurebackgroundFrameCalc]
measure=Calc
formula=counter % 74
substitute=".00000":""
disabled=0
dynamicVariables=1

[meterBackgroundFrame]
meter=Image
x=-5r
y=9r
H=97
W=130
ImageTint=#ColorVenusPla#
ImageName="#@#/Images/Venus/Venus./Venus[measureBackgroundFrameCalc].png"
DynamicVariables=1
Something that I can't find how to do and perhaps it can't be done, is to form a name of one variable from another:
Example
Planet: Venus
ColorPlanet:ColorVenusPla
What I need is that when I change the Planet variable and put for example Earth, the ColorPlaneta variable becomes ColorTierraPla
Can this be achieved???


I was doing tests and I don't know why the balloon makes a strange movement, I tried yours because my images are like icons and I saw how the tape that I published in the previous comment was moving, with the balloon of your skin it looks better but since the code has an error, it is something strange to explain, that's why I publish it. sorry for using your image.
I would like to know how you give the rotation angle and adjust the rotation speed.
I think I'm asking too much, sorry. :oops: :oops: :oops:

Code: Select all

[Rainmeter]
Update=70

[MeasureRotate]
measure=Calc
formula=counter % 120
dynamicVariables=1

[MeterGlobe]
Meter=Bitmap
MeasureName=MeasureRotate
X=8
Y=8
BitmapImage=#@#Images\1.png
BitmapFrames=120
BitmapExtend=1
You do not have the required permissions to view the files attached to this post.
:Whistle :Whistle Learning is the most complete art of life. Just enjoy it. :bow: :bow:
User avatar
balala
Rainmeter Sage
Posts: 16305
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Help to assemble a formula

Post by balala »

arcanosa84 wrote: September 17th, 2023, 8:59 pm I don't know if it is because of my PC or something I did wrong, the rotating globe has a sequence that fails, that is, it starts to turn and then it seems to stop and then it continues, it was the only thing that happened to me, the rest I was amazed.
Most probably you have enabled the hardware acceleration in Rainmeter settings. Try disabling it. For this click the Rainmeter icon in the Notification Area, go to the last (fourth - Settings) tab in the opening Manage Rainmeter dialog and uncheck the Use hardware acceleration checkbox. You have to restart Rainmeter.
Does the rotation go on properly this way?
arcanosa84 wrote: September 17th, 2023, 8:59 pm It is the most complex skin I have seen.
Yep, it is quite complex. This is why most users dislike it.
User avatar
arcanosa84
Posts: 173
Joined: May 21st, 2023, 1:47 am

Re: Help to assemble a formula

Post by arcanosa84 »

balala wrote: September 18th, 2023, 4:19 pm Most probably you have enabled the hardware acceleration in Rainmeter settings. Try disabling it. For this click the Rainmeter icon in the Notification Area, go to the last (fourth - Settings) tab in the opening Manage Rainmeter dialog and uncheck the Use hardware acceleration checkbox. You have to restart Rainmeter.
Does the rotation go on properly this way?

Yep, it is quite complex. This is why most users dislike it.
I have it disabled and it continues to do it, in this example that I showed it also happens, although I was trying how to use that type of images, but it gives me the same error. How do you give angle to rotation? Do you know how to do the combining the name of the variable as I said in the other post? :confused:
:Whistle :Whistle Learning is the most complete art of life. Just enjoy it. :bow: :bow:
User avatar
balala
Rainmeter Sage
Posts: 16305
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Help to assemble a formula

Post by balala »

arcanosa84 wrote: September 17th, 2023, 10:07 pm Something that I can't find how to do and perhaps it can't be done, is to form a name of one variable from another:
Example
Planet: Venus
ColorPlanet:ColorVenusPla
What I need is that when I change the Planet variable and put for example Earth, the ColorPlaneta variable becomes ColorTierraPla
Can this be achieved???
Can. You have to use nesting variables. For instance: ImageTint=[#Color[#Planet]Pla]. Here the [#Planet] element is the variable representing the name of the planets (Venus or Earth for example). In the [#Color[#Planet]Pla] variable (yep, this is a variable) the [#Planet] element is replaced by either Venus or Earth (or any other value it can take). When this has been done, the variable will be [#ColorVenusPla] or [#ColorEarthPla], which is the same as #ColorVenusePla# or #ColorEarthPla#.
arcanosa84 wrote: September 18th, 2023, 5:05 pm How do you give angle to rotation?
arcanosa84 wrote: September 17th, 2023, 10:07 pm I would like to know how you give the rotation angle
There is no other way to rotate a Bitmap meter (what [MeterGlobe] is in the Mirage\RotatingGlobe\RotatingGlobe.ini skin), than TransformationMatrix. This is applied there as well. See the TranformationMatrix option of the [MeterGlobe] meter. Looks complicated? Might be, the math behind it is indeed not to easy. But if you are interested, you have an exceptionel description of all those stuffs here.
arcanosa84 wrote: September 17th, 2023, 10:07 pm and adjust the rotation speed.
This depends on how are you using the skin:
  • If you're using continuous rotation, you have to reduce the 75 element in the Update=((#ContinuousRotation#>=1)?75:1000) option of the [Rainmeter] section, to speed up the rotation. Take care: the lower the value is, the higher rotation speed you get.
  • If you're not using continuous rotation, you have to decrease the 25 value in the ActionList1=Repeat Rotate,25,120 option of the [MeasureSlide] measure.
arcanosa84 wrote: September 17th, 2023, 10:07 pm I think I'm asking too much, sorry.
Don't worry, you are not. This is the purpose of this forum: folks out there to can ask for help. We're replying only when have time and energy. So don't worry, just ask when questions arise. Just take into account that sometimes takes us a little bit more time to reply. That's all...
User avatar
Yincognito
Rainmeter Sage
Posts: 7430
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Help to assemble a formula

Post by Yincognito »

balala wrote: September 18th, 2023, 6:02 pm Can. You have to use nesting variables. For instance: ImageTint=[#Color[#Planet]Pla]. Here the [#Planet] element is the variable representing the name of the planets (Venus or Earth for example). In the [#Color[#Planet]Pla] variable (yep, this is a variable) the [#Planet] element is replaced by either Venus or Earth (or any other value it can take). When this has been done, the variable will be [#ColorVenusPla] or [#ColorEarthPla], which is the same as #ColorVenusePla# or #ColorEarthPla#.
Might worth to note that if the OP was instead using a ColorPlanet variable in the code (like he did before editing his post), making use of escaping variables to literal with * and declaring ColorPlanet=[#*Color[#*Planet*]Pla*] in [Variables], followed by using a standard ImageTint=#ColorPlanet#, would have achieved the same thing. This would be true in bangs as well, where setting the Planet variable wouldn't need to be followed by setting ColorPlanet to [#Color[#Planet]Pla] again, to get the desired result.

In such a case, ColorPlanet would automatically parse to the desired value even if written in its standard form in the option, since it was basically declared as a nested syntax STRING (in which variables weren't resolved aka replaced with their actual values).

P.S. The caps are for the OP here, not for you, by the way. It's far from ideal (to put it mildly) to jump to complex stuff like nesting or escaping variables (AND possibly measures, by the way), ActionTimer or TransformationMatrix, when you can't tell the difference between measures, meters and variables yet.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth