It is currently September 20th, 2019, 8:26 am

SOLVED: This doesn't seem to work...

Help with creating, editing & fixing problems with skins
RedBrain144
Posts: 2
Joined: August 2nd, 2019, 9:16 pm

SOLVED: This doesn't seem to work...

RedBrain144 » August 2nd, 2019, 9:32 pm

THIS ISSUE IS NOW CLOSED!


Hi, I am a novice starting to use WebParser in Rainmeter. In this script based off of Jarvis, I try to display my IP address.

Here is the code. The code is also below:

Code: Select all

[Rainmeter]
Update=50

[Styling]
FontColor=FFFFFFFF
FontFace=Ubuntu
FontSize=8
AntiAlias=1

[MeasureIp]
Measure=WebParser
URL=http://checkip.dyndns.org/%22
RegExp="(?siU)<body>(.+)address: (.+)</body>"
StringIndex=2
UpdateRate=600

[Display]
Meter=String
MeterStyle=Styling
MeasureName=MeasureIp
By the way, testing [OUTPUT] with dummy text does display text.

Any help is appreciated, thanks in advance. You may reply either to the Gist linked above or to this forum post.
Last edited by RedBrain144 on August 2nd, 2019, 10:28 pm, edited 1 time in total.
mak_kawa
Posts: 244
Joined: December 30th, 2015, 9:47 am

Re: This doesn't seem to work...

mak_kawa » August 2nd, 2019, 9:45 pm

This works fine, when I added W= and H= options to the string meter, like W=100 and H=20.
User avatar
eclectic-tech
Rainmeter Sage
Posts: 3543
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: This doesn't seem to work...

eclectic-tech » August 2nd, 2019, 9:58 pm

Yes, mak_kawa is right. When the skin loads the string meter driven by [MeasureIP] has a width and height of zero, because the webparser measure that drive it has no value.

Once the webparser finishes, you need to either update the associated meters with a FinishAction added to the webparser measure
FinishAction=[!UpdateMeter *][!Redraw] or add
DynamicWindowSize=1 to the [Rainmeter] section.

Either of these will update the skin and show your IP.
RedBrain144
Posts: 2
Joined: August 2nd, 2019, 9:16 pm

Re: This doesn't seem to work...

RedBrain144 » August 2nd, 2019, 10:27 pm

Thank you both for your help, I will close this issue. The Forum was as great as expected, and my skin is now working, A great discreet IP :thumbup:
User avatar
eclectic-tech
Rainmeter Sage
Posts: 3543
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: SOLVED: This doesn't seem to work...

eclectic-tech » August 3rd, 2019, 1:16 am

Happy to help!
User avatar
balala
Rainmeter Sage
Posts: 8626
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: SOLVED: This doesn't seem to work...

balala » August 3rd, 2019, 6:27 am

Just a few (late) comments:
  • In my opinion, in such cases, eclectic-tech's solution using the DynamicWindowSize option is the best one. The size of the string which will be needed to be shown can vary, but if you set the dynamic window size, the skin will always exactly match the size of this string. Much better...
  • Update=50? Why? It's too low. Using the default Update=1000 is completely ok, doesn't worth to update the skin so frequently as with Update=50. Especially that if you set the Update to 50, the WebParser measure is updated every 50 milliseconds x 600 (the UpdateRate value) = 30 000 milliseconds = 30 seconds. So, twice a minute. Too frequent (last paragraph here)! In the above Update Guide description, the UpdateRate=600 was referring to the case when the Update was set to the default 1000, but if you use Update=50, the UpdateRate should be increased, or even better, the default Update should be used.
  • Don't quote the values of the options (I'm talking about the RegExp option of the [measureip] measure). This is not needed.
Even if the problem is fixed, take into account these comments.
User avatar
Vx_Lotus
Posts: 34
Joined: July 30th, 2019, 7:37 am

Re: SOLVED: This doesn't seem to work...

Vx_Lotus » August 10th, 2019, 11:56 pm

So for pc-CPU-Usage: What is the best rate of

Code: Select all

[Rainmeter] !Update= ????
for multiple skins that use it? Thus it may vary depending on skin complexity, How would you know exactly if your trying to keep CPU usage low?
User avatar
eclectic-tech
Rainmeter Sage
Posts: 3543
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: SOLVED: This doesn't seem to work...

eclectic-tech » August 11th, 2019, 3:36 am

Vx_Lotus wrote:
August 10th, 2019, 11:56 pm
So for pc-CPU-Usage: What is the best rate of

Code: Select all

[Rainmeter] !Update= ????
for multiple skins that use it? Thus it may vary depending on skin complexity, How would you know exactly if your trying to keep CPU usage low?
Update Guide contains some good info. For the majority of skins you can leave the default update speed of 1000ms (once per second). The guide suggests way to optimize measures and meters in your skin using an UpdateDivider.

Update with bangs provides additional methods for optimizing skins.

And you can also ask about specific code cases here on the forum.
User avatar
balala
Rainmeter Sage
Posts: 8626
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: SOLVED: This doesn't seem to work...

balala » August 11th, 2019, 11:50 am

Vx_Lotus wrote:
August 10th, 2019, 11:56 pm
What is the best rate of

Code: Select all

[Rainmeter] !Update= ????
for multiple skins that use it?
In addition to what eclectic-tech said, note that if there are more skins, each of them uses its own Update value, into its own [Rainmeter] section. Unfortunately this section can't be shared, as for instance the variables can (using the @Include options), so you have to add it one by one to each skin. And in each of them, you have to use a value which is best for the code of the skin.