It is currently August 10th, 2020, 4:20 pm

Little help

Help with creating, editing & fixing problems with skins
User avatar
JamX
Posts: 179
Joined: October 4th, 2019, 2:46 pm

Re: Little help

Post by JamX »

balala wrote: July 24th, 2020, 10:38 am I'd add the following option to the [Rainmeter] section: OnRefreshAction=[!CommandMeasure "MeasureSlide" "Execute 1"][!CommandMeasure "MeasureSlide" "Stop 2"].
Thinks for this tip.

This works

If Yincognito's solution does not work this is a good option. :thumbup:
User avatar
JamX
Posts: 179
Joined: October 4th, 2019, 2:46 pm

Re: Little help

Post by JamX »

Yincognito wrote: July 24th, 2020, 11:02 am I believe I corrected all issues, let me know if I didn't:

I removed the unneeded refresh and replaced it with updating things and sliding out, added the needed update meter and redraw bangs in [UpDownSteady1], and moved a measure lost between meters back to where it should have been (sorry, but had to improve clarity).
I've copied it and let you know the outcome. :thumbup:
User avatar
Yincognito
Posts: 2223
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Little help

Post by Yincognito »

JamX wrote: July 24th, 2020, 11:13 am I've copied it and let you know the outcome. :thumbup:
Okeydokey. Just to be clear, this doesn't start the skin with the thing sliden out - if by any chance you actually wanted that. From your post it seemed that you simply wanted for things to work properly (e.g. update, slide out) on middle click, not start with the skin sliden out from the start.
User avatar
JamX
Posts: 179
Joined: October 4th, 2019, 2:46 pm

Re: Little help

Post by JamX »

No, I did not wanted to start the skin slided out.

I saw if I used balala's code this happens when starting the skin
User avatar
balala
Rainmeter Sage
Posts: 11192
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Little help

Post by balala »

JamX wrote: July 24th, 2020, 11:12 am This works

If Yincognito's solution does not work this is a good option. :thumbup:
Ok. I'm glad if you got it working as wanted.
User avatar
JamX
Posts: 179
Joined: October 4th, 2019, 2:46 pm

Re: Little help

Post by JamX »

Yincognito,

Adjusting the code did not help.
The Up/Down indicator is set to "-" despite the negative values of the stock and percentuele change and are now again WHITE.
Capture.JPG
Here are the measured values
Capture1.JPG
Here is the log:
Capture2.JPG

Once they are white they stay white. Maybe that's a clue what is wrong

Using the MiddleMouseUpAction you added to the metertitlebox does NOTHING!

Code: Select all

[meterTitleBox]
Meter=Shape
X=0
Y=492
Shape=Rectangle 0,0,30,25,5 | Fill Color #Backgroundcolor# | StrokeWidth 1.5 | Stroke Color #Backgroundcolor2#
LeftMouseUpAction=[!CommandMeasure "MeasureSlide" "Stop 2"][!CommandMeasure "MeasureSlide" "Execute 1"]
RightMouseUpAction=[!CommandMeasure "MeasureSlide" "Stop 1"][!CommandMeasure "MeasureSlide" "Execute 2"]
MiddleMouseUpAction=[!CommandMeasure InfoIndex1 "Update"][!UpdateMeasure *][!UpdateMeter *][!Redraw][!CommandMeasure "MeasureSlide" "Stop 2"][!CommandMeasure "MeasureSlide" "Execute 1"]
DynamicVariables=1
You do not have the required permissions to view the files attached to this post.
User avatar
Yincognito
Posts: 2223
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Little help

Post by Yincognito »

JamX wrote: July 24th, 2020, 2:11 pm Yincognito,

Adjusting the code did not help.
The Up/Down indicator is set to "-" despite the negative values of the stock and percentuele change and are now again WHITE.
Capture.JPG

Here are the measured values
Capture1.JPG

Here is the log:
Capture2.JPG


Once they are white they stay white. Maybe that's a clue what is wrong

Using the MiddleMouseUpAction you added to the metertitlebox does NOTHING!

Code: Select all

[meterTitleBox]
Meter=Shape
X=0
Y=492
Shape=Rectangle 0,0,30,25,5 | Fill Color #Backgroundcolor# | StrokeWidth 1.5 | Stroke Color #Backgroundcolor2#
LeftMouseUpAction=[!CommandMeasure "MeasureSlide" "Stop 2"][!CommandMeasure "MeasureSlide" "Execute 1"]
RightMouseUpAction=[!CommandMeasure "MeasureSlide" "Stop 1"][!CommandMeasure "MeasureSlide" "Execute 2"]
MiddleMouseUpAction=[!CommandMeasure InfoIndex1 "Update"][!UpdateMeasure *][!UpdateMeter *][!Redraw][!CommandMeasure "MeasureSlide" "Stop 2"][!CommandMeasure "MeasureSlide" "Execute 1"]
DynamicVariables=1
Well, the white color didn't happen for me while working on your skin earlier, and doesn't happen (at least not yet) at the time of posting this screenshot either. Who knows, maybe I didn't wait long enough or there are some other circumstances that cause this and that I'm not aware of:
Stocks.jpg
Using the middle mouse does the right thing, which is update the WebParser and slide out the skin. The log shows that there was a regexp error in the WebParser measure, which means the measure did try to update (which was what I added to the code) but failed ... because of the regex you already had in the skin (and which I didn't touch, since you never mentioned it and it appeared to work fine for me). So, you should be a bit more cautious in placing the "blame" for things not working out, since, again:
- I never touched the regex you had in the WebParser, I assumed it was correct since it yielded (and still does) the correct data for me, as you can see in my screenshot
- your log screenshot proves that the measure tries to update itself, meaning I apparently got that right
- the color becoming white never happened for me, so I couldn't fix something that I didn't experience. I do admit that on this one I didn't wait for like an hour to maybe see the color turning white, so probably my mistake here, but otherwise, one cannot fix what he can't see

That being said, I'll take a closer look at your code, but later on today - maybe it pays off.

EDIT: I only noticed this now ... you didn't set an Update in the [Rainmeter] section, which means the general update is set to the default 1 second ... but you set the UpdateRate of the WebParser measure to the value of UpdateQuotes variable, which is 15. This means the skin updates once every 15 seconds (15*1000 milliseconds). :jawdrop Are you sure you need such a fast update rate? I mean, here's how the update formula is calculated for a WebParser measure in the manual. And one more proof that for me it all works as expected:
Stocks 2.jpg
You do not have the required permissions to view the files attached to this post.
User avatar
JamX
Posts: 179
Joined: October 4th, 2019, 2:46 pm

Re: Little help

Post by JamX »

Seems there is a bit of miscommunication

It's not my intension to "blame" someone or something. I just tried to emphasize that mouse action didn't do anything to my skin.
If it offended you, I'm sorry for that. :great:

After restarting rainmeter it did what it should do. Rainmeter got stuck or something like that, I think.

Strange thing is that even after multiple automatic webparser updates the values were still WHITE.
You would assume after the parser updates, like you say, every 15 seconds the color assigning is also updated:

Code: Select all

[UpDownSteady1]
Measure=Calc
Formula=mIndex1_UpDown
IfAboveValue=0
IfAboveAction=[!SetOption "LabelIndex1_Change" "FontColor" "#ColorUp#"] [!SetOption "LabelIndex1_ChangePer" "FontColor" "#ColorUp#"] [!SetOption "UpDownImage_1" "ImageName" "Up.png"][!UpdateMeter *][!Redraw]
IfEqualValue=0
IfEqualAction=[!SetOption "LabelIndex1_Change" "FontColor" "#ColorSteady#"] [!SetOption "LabelIndex1_ChangePer" "FontColor" "#ColorSteady#"][!SetOption "UpDownImage_1" "ImageName" "Steady.png"][!UpdateMeter *][!Redraw]
IfBelowValue=0
IfBelowAction=[!SetOption "LabelIndex1_Change" "FontColor" "#ColorDown#"] [!SetOption "LabelIndex1_ChangePer" "FontColor" "#ColorDown#"] [!SetOption "UpDownImage_1" "ImageName" "Down.png"][!UpdateMeter *][!Redraw]
User avatar
Yincognito
Posts: 2223
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Little help

Post by Yincognito »

JamX wrote: July 24th, 2020, 4:01 pm Seems there is a bit of miscommunication

It's not my intension to "blame" someone or something. I just tried to emphasize that mouse action didn't do anything to my skin.
If it offended you, I'm sorry for that. :great:

After restarting rainmeter it did what it should do. Rainmeter got stuck or something like that, I think.

Strange thing is that even after multiple automatic webparser updates the values were still WHITE.
You would assume after the parser updates, like you say, every 15 seconds the color assigning is also updated:

Code: Select all

[UpDownSteady1]
Measure=Calc
Formula=mIndex1_UpDown
IfAboveValue=0
IfAboveAction=[!SetOption "LabelIndex1_Change" "FontColor" "#ColorUp#"] [!SetOption "LabelIndex1_ChangePer" "FontColor" "#ColorUp#"] [!SetOption "UpDownImage_1" "ImageName" "Up.png"][!UpdateMeter *][!Redraw]
IfEqualValue=0
IfEqualAction=[!SetOption "LabelIndex1_Change" "FontColor" "#ColorSteady#"] [!SetOption "LabelIndex1_ChangePer" "FontColor" "#ColorSteady#"][!SetOption "UpDownImage_1" "ImageName" "Steady.png"][!UpdateMeter *][!Redraw]
IfBelowValue=0
IfBelowAction=[!SetOption "LabelIndex1_Change" "FontColor" "#ColorDown#"] [!SetOption "LabelIndex1_ChangePer" "FontColor" "#ColorDown#"] [!SetOption "UpDownImage_1" "ImageName" "Down.png"][!UpdateMeter *][!Redraw]
Yeah, it happens sometimes, miscommunication. Probably my mistake as well, but all clear now. ;-)
To be clear, I do believe you that it happens for you to get the white color when you shouldn't, that was not the issue. The "issue" is that so far it doesn't happen for me so I can have at least a shot at "fixing" it (as you can see, I added a !Log to see when it updates, and tested with the middle mouse click as well without any problems whatsoever):
Multiple Stock Updates.jpg
Regarding the update, I believe 15 seconds is too fast, but then, it's your skin, you do as you wish. And yes, I agree that by the look at the code there shouldn't be an issue and things should work out smoothly. To be sure of that, I not only added those bangs in the measure you posted above, but I also added DynamicVariables=1 to the corresponding meters, just to be on the safe side (I don't know if you noticed). So, considering the circumstances (i.e. the problem never happening for me), I still took additional precautionary measures to prevent it from happening. Just a small note though: I let the code as it was since it seemed to work fine (by the way, even without the [!UpdateMeter *][!Redraw] in my case), but I would personally get rid of the IfActions and use instead IfConditions. They're more versatile, more recent, can test other measures than the current one, etc. In other words, they top IfActions on basically everything. Now this is not to say the code is wrong - it's just what I would do, that's all.

If you have other info that might help find the reason why the color turns white for you, feel free to share it, maybe it somehow helps. After all, we solved more difficult things in the past (but curiously, also related to updating things online), right? So far, it's been 30 minutes of continuous 1 minute updates of the skin and all works well here. I would still try using equivalent IfConditions (and maybe even change the formula to Formula=[mIndex1_UpDown], adding DynamicVariables=1 to the measure and possibly use IfConditionMode=1 to see if it changes things for the better), but that's just me...

P.S. The regex works fine, just tested with the source code, so I have no idea why you got regexp parsing errors in your log earlier... :???:
You do not have the required permissions to view the files attached to this post.
User avatar
JamX
Posts: 179
Joined: October 4th, 2019, 2:46 pm

Re: Little help

Post by JamX »

it seems the regexp error has nothing to do with the "white" values
Capture3.JPG
Now, at 20:03, I had an error and the values are till now OK, but I made some changes...

I've taken a look at the original code from the Author Mordasius where het states:
; --- # UserAgent string # ---
;You MUST check and assign a UserAgent string or the skins will not work. To find out the UserAgent string for your internet browser, you can connect to WhatIsMyBrowser ( https://www.whatismybrowser.com/detect/what-is-my-user-agent ) and then paste the string it returns below: -------------------------------

MyUserAgent = Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:59.0) Gecko/20100101 Firefox/59.0
So I added my useragent: MyUserAgent=Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.89 Safari/537.36 Edg/84.0.522.40

and added it into the code like:

Code: Select all

[InfoIndex1]
Measure=WebParser
URL=https://www.cnbc.com/quotes/#Symbol1#
UserAgent=#MyUserAgent#
RegExp=#ExpQuote#
StringIndex=1
UpdateRate=#UpdateQuotes#
FinishAction=[!Log "Quote Update Finished"]
I also changes #UpdateQuotes# to 60 in stead of 15

Question:
What does the useragent actually do?
Before I had NO agent and sometimes the values turned white but most of the time (>95%) values were displayed OK
Now I have an agent and til now (knok on wood) the values are displayed OK
You do not have the required permissions to view the files attached to this post.