It is currently May 1st, 2024, 8:19 am

Write WebParse to Variable file

Get help with creating, editing & fixing problems with skins
Klypto
Posts: 8
Joined: December 20th, 2010, 12:25 am

Write WebParse to Variable file

Post by Klypto »

I'm trying ot get this to write what it returns. But it just writes in [MeasurePlayerInputClan] or MeasurePlayerInputClan depending on what I set. Is it impossible to write it's own info or did I miss something once again?

I've also tried it with/without quotes.
[MeasurePlayerInputClan]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url="http://player.thecbl.net/#LastPlayer#.html"
RegExp="(?siU)http://clan.thecbl.net/(.*).html">.*"
StringIndex=1
DynamicVariables=1
UpdateRate=999999999999999999999999999999999999999999
FinishAction=!RainmeterWriteKeyValue Variables IsPlayerSameClan "[MeasurePlayerInputClan]" "#CURRENTPATH#My_Variables.inc"
User avatar
jsmorley
Developer
Posts: 22631
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Write WebParse to Variable file

Post by jsmorley »

Not sure, while I can't test your skin as such, as I don't have the include file, nor feel like figuring out that website, this skin works for me and is doing much the same thing:

Created Text.txt and in it just put:

<name>JSMorley</name>

Then created Variables.txt and in it put:

[Variables]
MyName=None

Then this skin:

Code: Select all

[Rainmeter]
Update=1000
DynamicWindowSize=1

[MeasureText]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=file://#CURRENTPATH#Test.txt
RegExp="(?siU)<name>(.*)</name>"
StringIndex=1
UpdateRate=86400
FinishAction=!Execute [!RainmeterWriteKeyValue Variables MyName "[MeasureText]" "#CURRENTPATH#Variables.inc"]

[Meter1]
Meter=String
MeasureName=MeasureText
FontSize=14
FontColor=255,255,255,255
Text=Hello %1
When run the skin both changes MyName=None to MyName=JSMorley in Variables.inc and displays "Hello JSMorley" on the screen.

Having said that, you can NOT use DynamicVariables in any plugin in Rainmeter. If what you are trying to do here is have WebParser go get a value, put it in an include file and then use that value as the URL= in the same WebParser measure, that will never, ever work. Only if you refresh the skin so it re-reads the .ini and .inc files. Trouble with that in this instance is that if you add a !RainmeterRefresh to the "FinishAction", you will get into an endless loop and drill all the way to China. You could use a Calc measure with a Counter to refresh the skin every xx seconds, and that might allow this to work in a fashion, if I even understand correctly what you are trying to do.