It is currently May 18th, 2024, 12:31 am

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 27th, 2023, 6:48 pm First in the LeftMouseDownAction options of the [SelectPlanetTierra], [SelectPlanetLuna] (and so on) meters, you have bangs only to write the appropriate values to the [Variables] section of the @Resources\Config\Variables.inc file. A skin never can use a just-written value of a variable unless you're refreshing the skin, or (and usually this is a much better approach) besides the !WriteKeyValue bang you add a !SetVariable bang as well. This way you do two things: you write the value to the appropriate file, to can reuse it in case of a refresh and you get the same value dynamically, for immediate use in the skin.
So, for instance, add the following, red-marked bangs to the LeftMouseDownAction option of the [SelectPlanetLuna] meter: LeftMouseDownAction = [!DisableMeasureGroup Planet][!WriteKeyValue Variables PlanetSelect Luna "#@#\Config\Variables.inc"][!SetVariable PlanetSelect "Luna"][!SetVariable Planet "[#PlanetSelect]"][!SetVariable Size "[#Size[#Planet]]"][!SetVariable Speed "[#Speed[#Planet]]"][!SetVariable Angle "[#InclinationAngle[#Planet]]"][!UpdateMeasureGroup Planet][!EnableMeasureGroup Planet][!ShowMeterGroup Planet].
Note that besides setting the new value for the PlanetSelect variable, I updated with additional !SetVariable bangs the values of the Planet, Size, Speed and Angle variables as well. We have to do this because otherwise you don't get updated the appropriate values of these variables.
Didn't check, but you have to check, to have a DynamicVariables=1 option in every measure and meter, in which you want to use the values of the set variables (Planet, Size, Speed and Angle).
With this addition you still won't see an update of the variables when you click another planet, but this is happening only because the values of the #SizeLuna# and #SizeSol#, #SpeedLuna# and #SpeedSol# (and so on) variables are coinciding, in the @Resources\Config\Variables.inc file. If you set different values for these variables, you'll get the values updated, by adding the above bangs. Obviously I described here what you have to add only to the LeftMouseDownAction option of the [SelectPlanetLuna] meter. You have to add similar bangs to all LeftMouseDownAction options of all similar meters ([SelectPlanetTierra], [SelectPlanetVenus], [SelectPlanetMercurio] and so on).

Additional notes (recommend to take this into account):
  • Make sure (absolutely sure) you've added the DynamicVariables=1 option to all meters and measure in which you are using the variables, as described above. On meters and measure on which this option is missing, you don't get updated the variable(s).
  • Recommend not to use the LeftMouseDownAction option, unless it has to be used (use it only when you have both, a LeftMouseDownAction and a LeftMouseUpAction options on a meter). Use instead LeftMouseUpAction. You find out why in the Note here.
  • The #@# variable contains the backslash, no need to manually add one more. For instance this character is not needed right after the #@# variable, in the ImageName option of the [SelectPlanetMercurio] meter. There the ImageName you've used is this: ImageName = #@#\Images\Mercurio\Mercurio\Mercurio0.png (obviously once again this is just an example, you have such characters in all places where you did use the #@# variable). This option should look this way: ImageName=#@#Images\Mercurio\Mercurio\Mercurio0.png. Finally this is not a mistake, because Rainmeter simply ignores the not-needed characters (you can add even more than one single), however, strictly speaking, it is not needed. You can find out why, in the PS of this post.
Please let me know if the above things helped.
Hello, thank you very much for your time, first of all, I now understand what you explained, I was trying to use the variable directly from the Variables.inc file, and that was my mistake, I now understand how it can be solved, in addition to the correction in the options LeftMouseDownAction, I had to apply the same logic on the options like this ButtonCommand=[!SetVariable InclinationAngle[#Planet] "#Angle#"][!WriteKeyValue Variables "InclinationAngle[#Planet]" "#Angle#" "#@#Config \Variables.inc"][!Refresh "@AL\Planets\#Planet#"][!HideMeterGroup Planet] in the variable modification options, so that when changing and accepting the new value it is also available, and is now complete, and working perfectly as expected, thanks to that guide. It is true that no matter how much I read, I have to think a little more as a program and not as mathematics, to understand how to manage the variables, of course, that every time you guide me to solve a problem I become more nourished by these alternatives. The possibilities are many, and it is true that every time I take a step new concerns appear, but I am very happy with everything I have learned here with you. :rosegift: :rosegift: :rosegift: :great: :great: :great:

I already applied all the corrections that you recommended, and I studied the link you sent me, and all the LeftMouseDownAction options were rectified to LeftMouseUpAction.
And in all the skins I used #@#/ they also looked like this #@#.
I understand what you suggested I study. I already fixed this skin, now I will do it on all that I have made in the same way so that they are rectified as they should be. :bow: :bow: :bow:

The Options DynamicVariables=1 were missing in some measurements as you mentioned, I already reviewed them and wherever these variables are used I already added them. and the most important:
I already tested it and it works correctly, perfectly I would say. I can't stop thanking you for helping me. :rosegift: :rosegift: :rosegift:

And now, putting aside the past problem and not to make an extra publication, I continue right here.
Since you suggested that it be one thing at a time, here's the next one: :oops: :oops:

Regarding the adjustment of the size of the Balloon in bitmap I am having a small problem, although I read that in the [Rainmeter] section the dynamic variables do not work, there I am controlling the speed and it works perfectly, but I also want the length and width measurements of The skin adjusts according to the size you give the balloon. Since I have to handle the measurements differently, as you see in the code, I created a formula to vary the adjustment value of the variable Size=0.15 up to 2.25, which coincides with the size that I gave to the others, adjusting from 1 to 15 .
Problem:
SkinWidth=(170*#Size#) values are not updated
SkinHeight=(170*#Size#) I already tried manually indicating the value corresponding to the multiplication, that is, 170*1.05, directly and it works fine. It is worth adding that the planet does increase in size correctly according to the calculations, what I cannot get to work is the size of the skin as adjusted in the [Rainmeter] section.
I have attached the test mask to see if we can fix this. :confused: :confused:

Code: Select all

[Rainmeter]
Update=#Speed#
Author=AlexSoft
SkinWidth=(170*#Size#)
SkinHeight=(170*#Size#)

[Variables]

Planet=Globe

SizePlanet=5

FolderAtm=#@#Images/#Planet#/
FolderPla=#FolderAtm#/#Planet#
ColorPlanet=255,255,255
ColorAtm=255,255,255
Speed=75
InclinationAngle=0

[MeasureSize]
Measure=Calc
Formula=#SizePlanet#
IfCondition=(#CURRENTSECTION# = 1)
IfTrueAction=[!SetVariable Size 0.15]
IfCondition2=(#CURRENTSECTION# = 2)
IfTrueAction2=[!SetVariable Size 0.30] 
IfCondition3=(#CURRENTSECTION# = 3)
IfTrueAction3=[!SetVariable Size 0.45] 
IfCondition4=(#CURRENTSECTION# = 4)
IfTrueAction4=[!SetVariable Size 0.60] 
IfCondition5=(#CURRENTSECTION# = 5)
IfTrueAction5=[!SetVariable Size 0.75] 
IfCondition6=(#CURRENTSECTION# = 6)
IfTrueAction6=[!SetVariable Size 0.90] 
IfCondition7=(#CURRENTSECTION# = 7)
IfTrueAction7=[!SetVariable Size 1.05] 
IfCondition8=(#CURRENTSECTION# = 8)
IfTrueAction8=[!SetVariable Size 1.20] 
IfCondition9=(#CURRENTSECTION# = 9)
IfTrueAction9=[!SetVariable Size 1.35] 
IfCondition10=(#CURRENTSECTION# = 10)
IfTrueAction10=[!SetVariable Size 1.50] 
IfCondition11=(#CURRENTSECTION# = 11)
IfTrueAction11=[!SetVariable Size 1.65] 
IfCondition12=(#CURRENTSECTION# = 12)
IfTrueAction12=[!SetVariable Size 1.80] 
IfCondition13=(#CURRENTSECTION# = 13)
IfTrueAction13=[!SetVariable Size 1.95] 
IfCondition14=(#CURRENTSECTION# = 14)
IfTrueAction14=[!SetVariable Size 2.10] 
IfCondition15=(#CURRENTSECTION# = 15)
IfTrueAction15=[!SetVariable Size 2.25] 
DynamicVariables=1

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

[Atm]
Meter=Image
X=1
Y=0
TransformationMatrix=#Size#;0;0;#Size#;0;0
ImageTint=#ColorAtm#
ImageName=#FolderAtm#/atmospher.png
DynamicVariables=1

[MeterGlobe]
Meter=Bitmap
MeasureName=MeasureFrameCalc
X=10
Y=10
ImageTint=#ColorPlanet#
BitmapImage=#@#Images\#Planet#\#Planet#\#Planet#.png
BitmapFrames=120
BitmapExtend=1
TransformationMatrix=(#Size#*Cos(Rad(#InclinationAngle#)));(-1*#Size#*Sin(Rad(#InclinationAngle#)));(#Size#*Sin(Rad(#InclinationAngle#)));(#Size#*Cos(Rad(#InclinationAngle#)));(#Size#*(([#CURRENTSECTION#:X]+[#CURRENTSECTION#:W]/2)-(([#CURRENTSECTION#:X]+[#CURRENTSECTION#:W]/2)*Cos(Rad(#InclinationAngle#)))-(([#CURRENTSECTION#:Y]+[#CURRENTSECTION#:H]/2)*Sin(Rad(#InclinationAngle#)))));(#Size#*(([#CURRENTSECTION#:Y]+[#CURRENTSECTION#:H]/2)+(([#CURRENTSECTION#:X]+[#CURRENTSECTION#:W]/2)*Sin(Rad(#InclinationAngle#)))-(([#CURRENTSECTION#:Y]+[#CURRENTSECTION#:H]/2)*Cos(Rad(#InclinationAngle#)))))
DynamicVariables=1
: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 27th, 2023, 7:49 pm Actually, none of you would be required to do this if those variables besides PlanetSelect were declared using the escaped nested syntax in [Variables], like I was suggesting here. In that case, setting only PlanetSelect (in a shorter bang chain as well) would have been enough, since the other variables depending on it would have been automatically parsed to the proper corresponding values. :D

Anyway, now it's too late for such adjustments and they could have potentially led to more complex multiple escaping in rare cases. I'm just saying this for the record, please carry on with the discussion. ;-)
Hello hello, it's been a while since you commented here, and as I explained to Balala at one point, I no longer had any tests left to do, since I tried everything, and as I always say I'm trying to learn and every time they help me solve a problem I accumulate experiences that are the basis of all learning. That's why I would like you to give me an example of how you would solve using this way since I had done tests and I didn't achieve much, I was frozen in the process.
On the other hand, I am complying with what they both recommended to me, to go little by little.
and when I clarify what is happening to me with the options that Balala gave me in the configuration of that bitmap I want to discuss an option that I have that at the time you helped me fix, but now I found a totally definitive option for my network:
I'll explain it to you since you know what it's about. in the Pings skin when I am evaluating the internet connection by ping, and I disconnect the telephone cable, all the skins freeze, and on the router there is an option that gives me information about when the router is connected to the telephone line or not .
The options it gives me are Link Up for when it is connected and Link Down when it is disconnected, and through several options I managed to create a variable file.

Code: Select all

[Variables]
Tp-Link=Link Up
This is generated in an .inc file in the folder where the other variable files are.
I would like to know how to make sure that when that variable is Link Down, I deactivate that check, not so much for the pings that we did, but for a graph that shows the check against the 2 networks that I have access to browse the Internet. At this moment, when the line is disconnected, this graph is the one that freezes the image. I ask you, since you know from the beginning how to configure all this, help me with Balala to adjust this.
This graph is published in the file I recently published.
Image
but this is your code, and since that variable is written externally in that file, I can't get the skin to recognize it if I don't update it manually.
what do you think. Because no matter how much I read, I couldn't see how to make that file read continuously so that when the cable is disconnected from the router the graphics are disabled.
Greetings, and it is a pleasure to have your criteria here. :great: :great: :thumbup:

The location is @Al/Graficos/Ping

Code: Select all

[Rainmeter]

Author=AlexSoft
Update=500

[Variables]
@Include=#@#Config\Variables.inc
@Include2=#@#Config\Styles.inc
@Include3=#@#Config\Links.inc
@Include4=#@#Config\Tp-Link.inc

Rate=10

HeaderName=PING 

GraphStart=0
GraphEnd=300

;////////////////////////////////////////

FontName=hooge 05_53
FontHeight=6
FontColor=206,231,249,255
FontColor1=206,231,249,255
FontColor2=206,231,249,255
BlueBorder=Border
BlueColor=0, 148, 255, 128
Horizontal=HORIZONTAL
AntiAlias=1
NoAntiAlias=0

;////////////////////////////////////////
;  BACKGROUND
;////////////////////////////////////////

[Background]
Meter=Image
ImageName=#@#Images\Grafic\Grafic.png
ImageTint=#BackgColor#

;////////////////////////////////////////
;  MEASURES
;////////////////////////////////////////

[MeasurePing1]
Group=Pings
Measure=Plugin
Plugin=PingPlugin
DestAddress=www.Etecsa.cu
UpdateRate=#Rate#
DynamicVariables=1
IfCondition=(MeasurePing1 >= (#CompInter# - 50))
IfTrueAction=[!SetVariable FontColor1 255,0,0,255][!UpdateMeter *][!Redraw]
IfFalseAction=[!SetVariable FontColor1 206,231,249,255][!UpdateMeter *][!Redraw]

[Measure1C]
Group=Pings
Measure=Calc
Formula=(MeasurePing1<#CompInter#?MeasurePing1:0)
MinValue=0
MaxValue=#GraphEnd#

[MeasurePing2]
Group=Pings
Measure=Plugin
Plugin=PingPlugin
DestAddress=#Ping2#
UpdateRate=#Rate#
DynamicVariables=1
IfCondition=(MeasurePing2 >= (#CompInter# - 50))
IfTrueAction=[!SetVariable FontColor2 255,0,0,255][!UpdateMeter *][!Redraw]
IfFalseAction=[!SetVariable FontColor2 206,231,249,255][!UpdateMeter *][!Redraw]

[Measure2C]
Group=Pings
Measure=Calc
Formula=(MeasurePing2<#CompInter#?MeasurePing2:0)
MinValue=0
MaxValue=#GraphEnd#

;////////////////////////////////////////
; TEXT
;////////////////////////////////////////

[PingHeader]
Meter=STRING
X=15
Y=4
FontColor=#FontColor#
FontSize=#FontHeight#
FontFace=#FontName#
StringEffect=#BlueBorder#
FontEffectColor=#BlueColor#
AntiAlias=#NoAntiAlias#
Text=" #HeaderName#"

[PingEtecsa]
Meter=STRING
MeasureName=Measure1C
X=60
Y=4
FontColor=#FontColor1#
FontSize=#FontHeight#
FontFace=#FontName#
StringEffect=#BlueBorder#
FontEffectColor=#BlueColor#
AntiAlias=#NoAntiAlias#
Postfix=  ms
NumOfDecimals=0
DynamicVariables=1

[PingComp]
Meter=STRING
MeasureName=Measure2C
X=99
Y=4
FontColor=#FontColor2#
FontSize=#FontHeight#
FontFace=#FontName#
StringEffect=#BlueBorder#
FontEffectColor=#BlueColor#
AntiAlias=#NoAntiAlias#
Postfix=  ms
NumOfDecimals=0
DynamicVariables=1

;////////////////////////////////////////
;  GRAPH
;////////////////////////////////////////

[EtecsaGraph]
Meter=Line
MeasureName=Measure1C
X=15
Y=5
H=41
W=115
LineCount=1
LineColor=#ColorLine1#
AntiAlias=#NoAntiAlias#

[InternetGraph]
Meter=Line
MeasureName=Measure2C
X=15
Y=5
H=41
W=115
LineCount=1
LineColor=#ColorLine2#
AntiAlias=#NoAntiAlias#
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
Yincognito
Rainmeter Sage
Posts: 7266
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Help to assemble a formula

Post by Yincognito »

arcanosa84 wrote: September 28th, 2023, 1:56 am Hello hello, [...]
If the example you mentioned is about the escaped nested syntax, you already managed to try it here, though you decided to continue without escaping. If the example is about how to read and use the router's link status in Rainmeter, there's no example to give, because that's not possible unless someone makes a plugin for such interoperability, or that status can be returned via a command line whose result can then be used by Rainmeter.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
arcanosa84
Posts: 173
Joined: May 21st, 2023, 1:47 am

Re: Help to assemble a formula

Post by arcanosa84 »

Yincognito wrote: September 28th, 2023, 10:41 am If the example you mentioned is about the escaped nested syntax, you already managed to try it here, though you decided to continue without escaping. If the example is about how to read and use the router's link status in Rainmeter, there's no example to give, because that's not possible unless someone makes a plugin for such interoperability, or that status can be returned via a command line whose result can then be used by Rainmeter.
without considering what the state of the router is, since a variable is written directly, so I considered that it could be used. Another alternative, if the log generated by the router page is saved, can webparser be used to know this status?, since it declares it verbatim
9/26/2023 20:22:19> bridge only stop
9/26/2023 20:22:19> SNMP TRAP 3: link up
9/26/2023 20:22:19> netMakeChannDial: err=-3000

That is an example of the lines that it shows when it is connected, and when it is disconnected it says Link Down. I have been looking at how to use webparser to extract that information but I have not been able to do it. Guide me along this path, I think that maybe it can be achieved if the log is used, what do you think? On the other hand, about escaping with the variables, even though I understood what you explained to me, I tried to use that route, and it didn't work, that's why I asked you for a little more elements to use. Thanks for responding once again. :thumbup: :thumbup:
:Whistle :Whistle Learning is the most complete art of life. Just enjoy it. :bow: :bow:
User avatar
balala
Rainmeter Sage
Posts: 16229
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Help to assemble a formula

Post by balala »

arcanosa84 wrote: September 28th, 2023, 1:38 am I already tested it and it works correctly, perfectly I would say. I can't stop thanking you for helping me. :rosegift: :rosegift: :rosegift:
Don't thank. I'm glad it helped. :thumbup:
arcanosa84 wrote: September 28th, 2023, 1:38 am Problem:
SkinWidth=(170*#Size#) values are not updated
SkinHeight=(170*#Size#) I already tried manually indicating the value corresponding to the multiplication, that is, 170*1.05, directly and it works fine. It is worth adding that the planet does increase in size correctly according to the calculations, what I cannot get to work is the size of the skin as adjusted in the [Rainmeter] section.
Unfortunately as you figured out by yourself, the [Rainmeter] section is not dynamic. Due to this, you can't alter the size of the skin with !SetVariable bangs. For every modification you have to write the value of the Size variable into a file and have to refresh the skin.
User avatar
arcanosa84
Posts: 173
Joined: May 21st, 2023, 1:47 am

Re: Help to assemble a formula

Post by arcanosa84 »

balala wrote: September 28th, 2023, 6:27 pm Don't thank. I'm glad it helped. :thumbup:

Unfortunately as you figured out by yourself, the [Rainmeter] section is not dynamic. Due to this, you can't alter the size of the skin with !SetVariable bangs. For every modification you have to write the value of the Size variable into a file and have to refresh the skin.
I'll do the same thing I did with speed, write it to the variables file and update the skin so it loads correctly then. using the ways I have learned. Question: I cannot apply the !Refresh option due to an ifcondition, that is, I made a loop that counts from 1 to 10 and I want it to update a skin when it reaches 5, but it does not work, it only does it with !ActivateConfig and !DeactivateConfig. Afterwards I will write to you what I told my friend Yincognito that I want to do with a variable that is generated by an external application. or do it through web parser. if you can check it. I just wrote it to you. Please let me know your opinion too. greetings and thanks. :thumbup: :thumbup: :thumbup:
:Whistle :Whistle Learning is the most complete art of life. Just enjoy it. :bow: :bow:
User avatar
Yincognito
Rainmeter Sage
Posts: 7266
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Help to assemble a formula

Post by Yincognito »

arcanosa84 wrote: September 28th, 2023, 1:46 pm without considering what the state of the router is, since a variable is written directly, so I considered that it could be used. Another alternative, if the log generated by the router page is saved, can webparser be used to know this status?, since it declares it verbatim
9/26/2023 20:22:19> bridge only stop
9/26/2023 20:22:19> SNMP TRAP 3: link up
9/26/2023 20:22:19> netMakeChannDial: err=-3000

That is an example of the lines that it shows when it is connected, and when it is disconnected it says Link Down. I have been looking at how to use webparser to extract that information but I have not been able to do it. Guide me along this path, I think that maybe it can be achieved if the log is used, what do you think? On the other hand, about escaping with the variables, even though I understood what you explained to me, I tried to use that route, and it didn't work, that's why I asked you for a little more elements to use. Thanks for responding once again. :thumbup: :thumbup:
A variable written directly can be used, obviously, but it won't mean anything if it's not determined by the actual router status. However, if you can set the router to save its log file automatically AND it doesn't do it in a write exclusive mode, then yes, as you correctly suspected, WebParser can be used to grab the status on that line and use it further. As for the guidance, you need to:

- create a simple WebParser measure retrieving your LOCAL log file
- add RegExp=(?siU)SNMP TRAP \d+: link (\S+)\R and StringIndex=1 to it
- add a Substitute to convert its "up" and "down" to "1" and "0"
- add an IfCondition to do what you want based on its value
- add a FinishAction=[!UpdateMeasure ThisMeasure] to force running the condition when the measure gets its value

The rest is entirely up to you and what you want to do with that value.

Regarding escaping variables, if your code in what I linked to in my previous reply worked (as in tinting the images to Venus
colors, or to Tierra colors if you set your planet to it, updated the meters and redrew) - and i don't see a reason why it didn't work, then so should any similar approaches, if you do them correctly (which you did in that code, as far as the syntax was concerned).

By the way, if you were using a Shape meter to create your skin background and you were defining the dimensions of that shape using similar variables (that is, not involving the [Rainmeter] section in all this), then you would be able to set your "skin size" dynamically (and without refreshing, just updating meters and redrawing). Again, it's up to you to put this info to good use.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
balala
Rainmeter Sage
Posts: 16229
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Help to assemble a formula

Post by balala »

arcanosa84 wrote: September 28th, 2023, 7:21 pm I'll do the same thing I did with speed, write it to the variables file and update the skin so it loads correctly then. using the ways I have learned. Question: I cannot apply the !Refresh option due to an ifcondition, that is, I made a loop that counts from 1 to 10 and I want it to update a skin when it reaches 5, but it does not work, it only does it with !ActivateConfig and !DeactivateConfig. Afterwards I will write to you what I told my friend Yincognito that I want to do with a variable that is generated by an external application. or do it through web parser. if you can check it. I just wrote it to you. Please let me know your opinion too. greetings and thanks. :thumbup: :thumbup: :thumbup:
Sorry, but can't follow you. You are confusing again the refresh and update operations, which are completely different things. What I think is that you want to refresh the skin when the counter you're talking about reaches 5. If I1m right, and you've followed Yincognito's recommendation, the COUNT function once the skin is loaded, starts counting. This goes on even if you refresh the skin and even if you activates another skin from the same config (obviously assuming there are more skins). To get it restarting from 0 you have to unload the skin, then have to reactivate it. These operations are done by the !DeactivateConfig then !ActivateConfig bangs (in this order, not as you wrote in you reply).
How and for what do you want to use the WebParser measure is completely not clear to me at this moment. So, some additional information are expected here.
User avatar
Yincognito
Rainmeter Sage
Posts: 7266
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Help to assemble a formula

Post by Yincognito »

balala wrote: September 28th, 2023, 8:50 pm If I1m right, and you've followed Yincognito's recommendation, the COUNT function once the skin is loaded, starts counting.
I have given many recommendations in various places, but I have only once recommended someone to use the Counter function (and it wasn't here or to the OP), precisely for the reason you mentioned. In typical practice, that function is only suited for simple testing in a continuously incrementing fashion or to do things only once at skin load time disregarding refresh, it's rarely useful otherwise.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
arcanosa84
Posts: 173
Joined: May 21st, 2023, 1:47 am

Re: Help to assemble a formula

Post by arcanosa84 »

Yincognito wrote: September 28th, 2023, 8:28 pm A variable written directly can be used, obviously, but it won't mean anything if it's not determined by the actual router status. However, if you can set the router to save its log file automatically AND it doesn't do it in a write exclusive mode, then yes, as you correctly suspected, WebParser can be used to grab the status on that line and use it further. As for the guidance, you need to:

- create a simple WebParser measure retrieving your LOCAL log file
- add RegExp=(?siU)SNMP TRAP \d+: link (\S+)\R and StringIndex=1 to it
- add a Substitute to convert its "up" and "down" to "1" and "0"
- add an IfCondition to do what you want based on its value
- add a FinishAction=[!UpdateMeasure ThisMeasure] to force running the condition when the measure gets its value

The rest is entirely up to you and what you want to do with that value.

Regarding escaping variables, if your code in what I linked to in my previous reply worked (as in tinting the images to Venus
colors, or to Tierra colors if you set your planet to it, updated the meters and redrew) - and i don't see a reason why it didn't work, then so should any similar approaches, if you do them correctly (which you did in that code, as far as the syntax was concerned).

By the way, if you were using a Shape meter to create your skin background and you were defining the dimensions of that shape using similar variables (that is, not involving the [Rainmeter] section in all this), then you would be able to set your "skin size" dynamically (and without refreshing, just updating meters and redrawing). Again, it's up to you to put this info to good use.
I'm going to try what you recommend later, the variable that I mentioned that would change depending on the state of the router, is using an external application that would write said variable as the case may be.
But if you can use the webparser better, so I don't use anything more than that.
On the other hand, I think I have understood what you explained about creating a Shape meter to make the background of my image, I am going to try everything and then comment on the results.
Thanks for answering. I get to work :great: :great: :great:
:Whistle :Whistle Learning is the most complete art of life. Just enjoy it. :bow: :bow: