It is currently September 14th, 2024, 10:19 pm

Help to assemble a formula

Get help with creating, editing & fixing problems with skins
User avatar
arcanosa84
Posts: 173
Joined: May 21st, 2023, 1:47 am

Re: Help to assemble a formula

Post by arcanosa84 »

balala wrote: September 15th, 2023, 4:32 pm After getting Yincognito's images and adding them to the right place, I got it working, accordingly to how the code is written (at least as far as I can tell).
The [MeasureActive1] measure for instance is returning the state of skin of the @Al\Planetas\Luna config. The IfTrueAction / IfFalseAction are executed accordingly. If I change the page, the measure is still returning the proper case and executing the appropriate option, from IfTrueAction and IfFalseAction.
Maybe I'm still missing something, but I think these measures are working well.
The fundamental problem is that when I am on page 1 and go to page 2, and the moon is not active, the moon color buttons on page 2 should be hidden, that is, it shows them and this should not be, and when You go from 2 to 1 and return to 2, it still shows the same, [MeasureActive1] is not updated at the time of the change.
Also, being on page 2 if I open and close the window it works perfectly, but when I turn the page it stops working again.
I am attaching the images that you were missing, if I added those later when I started changing the page.
I see that they have said a lot but I am following the answers in order. Greetings :great: :great:
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
arcanosa84
Posts: 173
Joined: May 21st, 2023, 1:47 am

Re: Help to assemble a formula

Post by arcanosa84 »

balala wrote: September 15th, 2023, 5:51 pm Ok, I did. Here is the other solution, which doesn't require the IfConditionMode=1 option (which even if in some cases can be a good solution, many times should be avoided).
Using the original (not-altered) measure, add the following bangs to the LeftMouseUpAction options of the [CambiodePaginaSig] and [CambiodePaginaAnt] meters: [!DisableMeasure "MeasureActive1"][!UpdateMeasure "MeasureActive1"][!EnableMeasure "MeasureActive1"].
Something like this:

Code: Select all

[CambiodePaginaSig]
...
LeftMouseUpAction=[!DisableMeasure "MeasureActive1"][!UpdateMeasure "MeasureActive1"][!EnableMeasure "MeasureActive1"][!HideMeterGroup Pag1][!ShowMeterGroup Pag2][!ShowMeter "CambiodePaginaAnt"][!HideMeter "CambiodePaginaSig"][!SetVariable Pagina 2][!UpdateMeasureGroup Comp][!UpdateMeter *][!Redraw]
...

[CambiodePaginaAnt]
...
LeftMouseUpAction=[!DisableMeasure "MeasureActive1"][!UpdateMeasure "MeasureActive1"][!EnableMeasure "MeasureActive1"][!HideMeterGroup Pag2][!ShowMeterGroup Pag1][!ShowMeter "CambiodePaginaSig"][!HideMeter "CambiodePaginaAnt"][!SetVariable Pagina 1][!UpdateMeasureGroup Comp][!UpdateMeter *][!Redraw]
...
With these bangs, when you change the "page", the [MeasureActive1] measure is disabled, updated, then immediately re-enabled, which leads to get executing the appropriate option from the IfTrueAction or IfFalseAction.
Sometimes I can't stay to say what I see, when I put the option to disable and enable that didn't happen, I already understand why, with the masterful explanation given by Yincognito of Ifcondition and in this debate of minutes reading, (I apologize for both Today I couldn't keep up to date (I was working and got home late) I learned more than in hours trying to understand the manual. :thumbup:
: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 »

Yincognito wrote: September 15th, 2023, 6:20 pm I already hinted at that with the link I mentioned before your reply - the idea was to let the OP figure out the obvious by looking at that page. :D
Anyway, you saying this directly will probably save time avoiding any likely confusion, so it's ok.



Thanks for providing it, it makes sense. I was thinking at breaking the condition into multiple ones, but I believe your choice is way better. :thumbup:
Now it's up for the OP to test these advices.
My friend, do not reserve the solutions too much, after hours of testing the possible options, I used the disabled again in the checks and I see that it was activated, but well, I did not use it with the idea of balala, which makes sense, and I see easier to understand the option he proposed, don't leave all the scientific analysis to me, you two who are more advanced had a hard time coming up with an idea, it would only take months, and I'm not against the manual, I don't want you to keep thinking In that, I read and did not use before the comparison that I showed in the formula for this:

The syntax allows for a single IfCondition to embed logical AND && and OR || comparisons in the formula. Unlike IfEqualValue for instance, which allows for a single comparison, you could use IfCondition=(MeasureName = 5) || (MeasureName = 10), to check if the value of MeasureName is "5" OR "10". You can also use the full range of logical operators, so rather than being limited to "equal", "above" or "below", you can use any of <> = < > <= >= && ||.

This is an excerpt from the manual, and what I understand there, except when translating, is that it allows a single comparison for the measurement of the example, I thought I could not compare 2 at a time, that is a mistake of reading or translation?
I ask to know whether or not it is an error when translating to take precautions and avoid bad practices. :confused:
: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 15th, 2023, 8:03 pm Sorry, didn't realize. My bad...

I'm glad if you think so.
I think it is not a bad choice to give myself options, I learn even though my friend Yincognito wants to bring me to the conclusion myself, I don't see it as bad, but there are times when I don't know what else to do, I was close but no as much as the explanation you gave. I don't have many elements, which I still have to learn. and I really appreciate the help that both of you give me. It is a pleasure for me to learn from you. :thumbup:
: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 »

Yincognito wrote: September 15th, 2023, 9:17 pm No worries, it's not like this approach has been as successful as I wished it was - extensive guidance is still needed, and you're better suited to offer it at this time. ;-)
For me, both have provided exemplary help, I learn a lot even from their debates. :great: :great: :thumbup: :thumbup:
: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 15th, 2023, 5:51 pm Ok, I did. Here is the other solution, which doesn't require the IfConditionMode=1 option (which even if in some cases can be a good solution, many times should be avoided).
Using the original (not-altered) measure, add the following bangs to the LeftMouseUpAction options of the [CambiodePaginaSig] and [CambiodePaginaAnt] meters: [!DisableMeasure "MeasureActive1"][!UpdateMeasure "MeasureActive1"][!EnableMeasure "MeasureActive1"].
Something like this:

Code: Select all

[CambiodePaginaSig]
...
LeftMouseUpAction=[!DisableMeasure "MeasureActive1"][!UpdateMeasure "MeasureActive1"][!EnableMeasure "MeasureActive1"][!HideMeterGroup Pag1][!ShowMeterGroup Pag2][!ShowMeter "CambiodePaginaAnt"][!HideMeter "CambiodePaginaSig"][!SetVariable Pagina 2][!UpdateMeasureGroup Comp][!UpdateMeter *][!Redraw]
...

[CambiodePaginaAnt]
...
LeftMouseUpAction=[!DisableMeasure "MeasureActive1"][!UpdateMeasure "MeasureActive1"][!EnableMeasure "MeasureActive1"][!HideMeterGroup Pag2][!ShowMeterGroup Pag1][!ShowMeter "CambiodePaginaSig"][!HideMeter "CambiodePaginaAnt"][!SetVariable Pagina 1][!UpdateMeasureGroup Comp][!UpdateMeter *][!Redraw]
...
With these bangs, when you change the "page", the [MeasureActive1] measure is disabled, updated, then immediately re-enabled, which leads to get executing the appropriate option from the IfTrueAction or IfFalseAction.
I tried this option directly, since I like it better, to make the work easier, and indeed, it works perfectly.
For the next page

Code: Select all

LeftMouseUpAction=[!DisableMeasureGroup Comp][!UpdateMeasureGroup Comp][!EnableMeasureGroup Comp][!HideMeterGroup Pag1][!ShowMeterGroup Pag2][!ShowMeter "CambiodePaginaAnt"][!HideMeter "CambiodePaginaSig"][!SetVariable Pagina 2][!UpdateMeter *][!Redraw]
For the previous page
LeftMouseUpAction=[!DisableMeasureGroup Comp][!UpdateMeasureGroup Comp][!EnableMeasureGroup Comp][!HideMeterGroup Pag2][!ShowMeterGroup Pag1][!ShowMeter "CambiodePaginaSig"][!HideMeter "CambiodePaginaAnt"][!SetVariable Pagina 1][!UpdateMeter *][!Redraw]

I did it for the group since I don't have to add the checks one by one, and there are several so it's easier for me, but I already tested the various errors I had and it worked perfectly. :great: :great: :great: :thumbup: :thumbup: :thumbup: :D :D
:Whistle :Whistle Learning is the most complete art of life. Just enjoy it. :bow: :bow:
User avatar
Yincognito
Rainmeter Sage
Posts: 8127
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Help to assemble a formula

Post by Yincognito »

arcanosa84 wrote: September 16th, 2023, 2:15 am My friend, do not reserve the solutions too much, after hours of testing the possible options, I used the disabled again in the checks and I see that it was activated, but well, I did not use it with the idea of balala, which makes sense, and I see easier to understand the option he proposed, don't leave all the scientific analysis to me, you two who are more advanced had a hard time coming up with an idea, it would only take months, and I'm not against the manual, I don't want you to keep thinking In that, I read and did not use before the comparison that I showed in the formula for this:

The syntax allows for a single IfCondition to embed logical AND && and OR || comparisons in the formula. Unlike IfEqualValue for instance, which allows for a single comparison, you could use IfCondition=(MeasureName = 5) || (MeasureName = 10), to check if the value of MeasureName is "5" OR "10". You can also use the full range of logical operators, so rather than being limited to "equal", "above" or "below", you can use any of <> = < > <= >= && ||.

This is an excerpt from the manual, and what I understand there, except when translating, is that it allows a single comparison for the measurement of the example, I thought I could not compare 2 at a time, that is a mistake of reading or translation?
I ask to know whether or not it is an error when translating to take precautions and avoid bad practices. :confused:
I don't reserve solutions, but yeah, I don't like to always serve them on a plate, and that will not change. It's not only that it's easier for us to use a brief explanation and a link and let you figure out the obvious, but it's more efficient for you as well, considering that you're not an absolute beginner anymore. If you keep asking for final solutions for every little thing out there, you will end up not knowing how to do those yourself, when you need it. Experiencing difficulties and managing to solve them yourself is the most effective way to learn, just like in your example with the baby learning to walk - at some point, he has to do it himself, even if he would prefer to still be aided.

By the way, we didn't have a hard time coming up with an idea here, we just didn't want to bother much coming up with an "unnatural" alternative to it like disabling and enabling again in quick succession. IfConditionMode is the natural way to do it in this case and many others and you'll need it in the future, it's just that here it added an extra redraw when not changing pages, that could have been avoided for performance reasons.

Regarding the translation or understanding it, we can't help if you have trouble doing that yourself, that's your job, there are plenty of tools doing that online. We won't be always here or willing to explain what's already written or implied on the docs at every basic step along the way, that's absurd. If I have absolutely zero trouble translating online and properly understanding the translation in my native language which is way less used compared to Spanish, why should you? This has nothing to do with being proficient in Rainmeter. Other than that, just curious, don't they teach English in primary school in Latin America (just guessing here)? I mean, it's not like they use words that you don't encounter in your everyday life, in the news, in a musical piece, in a movie, on your computer, on your phone, and so on.

The excerpt is about being able to have multiple comparisons (the word is at the plural) in a single IfCondition (at singular). Even without deducting this, since AND and OR between comparisons are mentioned in code snippets, it doesn't take much thought to realize what this is all about. Basic reading comprehension, nothing "scientific" about it, if you ask me. :confused:
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
balala
Rainmeter Sage
Posts: 16539
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Help to assemble a formula

Post by balala »

arcanosa84 wrote: September 16th, 2023, 3:26 am I did it for the group since I don't have to add the checks one by one, and there are several so it's easier for me, but I already tested the various errors I had and it worked perfectly.
Extremely good solution, congratulations you figured it out. It seems slowly - slowly you're starting to get the idea of Rainmeter codes. When I wrote my reply, I didn't realize the same operation could be done for all ConfigActive plugin measures, so posted only for the [MeasureActive1] measure, but using the already created group makes thing much more easier.
User avatar
arcanosa84
Posts: 173
Joined: May 21st, 2023, 1:47 am

Re: Help to assemble a formula

Post by arcanosa84 »

Yincognito wrote: September 16th, 2023, 10:13 am I don't reserve solutions, but yeah, I don't like to always serve them on a plate, and that will not change. It's not only that it's easier for us to use a brief explanation and a link and let you figure out the obvious, but it's more efficient for you as well, considering that you're not an absolute beginner anymore. If you keep asking for final solutions for every little thing out there, you will end up not knowing how to do those yourself, when you need it. Experiencing difficulties and managing to solve them yourself is the most effective way to learn, just like in your example with the baby learning to walk - at some point, he has to do it himself, even if he would prefer to still be aided.

By the way, we didn't have a hard time coming up with an idea here, we just didn't want to bother much coming up with an "unnatural" alternative to it like disabling and enabling again in quick succession. IfConditionMode is the natural way to do it in this case and many others and you'll need it in the future, it's just that here it added an extra redraw when not changing pages, that could have been avoided for performance reasons.

Regarding the translation or understanding it, we can't help if you have trouble doing that yourself, that's your job, there are plenty of tools doing that online. We won't be always here or willing to explain what's already written or implied on the docs at every basic step along the way, that's absurd. If I have absolutely zero trouble translating online and properly understanding the translation in my native language which is way less used compared to Spanish, why should you? This has nothing to do with being proficient in Rainmeter. Other than that, just curious, don't they teach English in primary school in Latin America (just guessing here)? I mean, it's not like they use words that you don't encounter in your everyday life, in the news, in a musical piece, in a movie, on your computer, on your phone, and so on.

The excerpt is about being able to have multiple comparisons (the word is at the plural) in a single IfCondition (at singular). Even without deducting this, since AND and OR between comparisons are mentioned in code snippets, it doesn't take much thought to realize what this is all about. Basic reading comprehension, nothing "scientific" about it, if you ask me. :confused:
You definitely don't want to understand me, I don't want the written code, but an example is not giving the solution, in any case the idea that Balala gave I modified and adapted it to my needs, and I understood that there are cases that with a simple update It is not enough, with the disable option that I was using it worked in part, but obviously it was missing, and with the update option it did not work, that is why reading alone does not help me, that is what the experience that you share is for , I know I'm not starting anymore but I'm not a professional yet, guide me and little by little I will reach the top. I know that giving me the written code is not a solution, that was always clear, last night I was working on the configuration skin, and I had to adapt as you told me, a few things to achieve the effect I want, after I progress a little I will publish it and You tell me, maybe there are shorter routes for the same path I already traveled. :great: :thumbup: :great: :thumbup: :welcome:
: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 16th, 2023, 11:22 am Extremely good solution, congratulations you figured it out. It seems slowly - slowly you're starting to get the idea of Rainmeter codes. When I wrote my reply, I didn't realize the same operation could be done for all ConfigActive plugin measures, so posted only for the [MeasureActive1] measure, but using the already created group makes thing much more easier.
That is the idea that I tell my friend Yincognito all the time, not everything they give me will be used in the same way, I was really trying several options and I didn't achieve the effect, but yes, little by little I am making progress, last night I had three challenges and well I found a solution based on the criteria that I had already seen before, when I advance the idea a little I share the code so that they can tell me how they see the steps I am taking. Thanks again. :thumbup: :great: :thumbup: :great: :welcome:
:Whistle :Whistle Learning is the most complete art of life. Just enjoy it. :bow: :bow: