Re: Monitor a (part of) the website
Posted: January 15th, 2017, 7:57 pm
Maybe better later, than never. I finally found a solution, but had to test it. But this one is not a solution using just simple Rainmeter code, I had to add a small lua script
So, if you're interested, here is what to do: first create a Change.lua file into the @Resources folder of your config and add the following content:
On first step, this file will read twice the value of the [GeoMeasure] measure (once in the Initialize() and once in the Update() function) and will add these values to the Geo and GeoPrev variables. Then will determine the difference of these variables and will return this difference to the skin, through the GeoChange variable. The skin will react to the sign of this returned value (immediately I tell how). When this is done, the value of the GeoPrev variable will be updated to the value of the Geo variable.
Now, if the returned GeoChange variable is positive, means that the value of the [GeoMeasure] measure grew, if it's negative, the value of the measure decreased. The last thing you have to do is to execute the appropriate actions (bangs) according to the sign of the returned variable: if this variable is positive, the playing of the wav file should start and the color of the [GeoMeter] meter should be set.
To do all this, first you have to add a Script and a Calc measure to the code of the skin. Add the followings:
Then remove the FinishAction option of the [GeoMeasure] measure.
You don't need any more the [MeasureMax] and [Timer] measure. Remove them.
The only disadvantage of this modifications is that immediately after the refresh, the sound will start to play, you'll have to click to stop it. I hope you can live with this inconvenience.
So, if you're interested, here is what to do: first create a Change.lua file into the @Resources folder of your config and add the following content:
Code: Select all
function Initialize()
GeoPrev = SKIN:GetMeasure('GeoMeasure'):GetValue()
end
function Update()
Geo = SKIN:GetMeasure('GeoMeasure'):GetValue()
GeoChange = Geo - GeoPrev
SKIN:Bang('!SetVariable', 'GeoChange', GeoChange)
GeoPrev = Geo
end
Now, if the returned GeoChange variable is positive, means that the value of the [GeoMeasure] measure grew, if it's negative, the value of the measure decreased. The last thing you have to do is to execute the appropriate actions (bangs) according to the sign of the returned variable: if this variable is positive, the playing of the wav file should start and the color of the [GeoMeter] meter should be set.
To do all this, first you have to add a Script and a Calc measure to the code of the skin. Add the followings:
Code: Select all
[MeasureLuaScript]
Measure=Script
ScriptFile=#@#Change.lua
[MeasureGeoChange]
Measure=Calc
Formula=#GeoChange#
IfCondition=(MeasureGeoChange>0)
IfTrueAction=[!SetOption GeoMeter FontColor "247,202,24,255"]
DynamicVariables=1
You don't need any more the [MeasureMax] and [Timer] measure. Remove them.
The only disadvantage of this modifications is that immediately after the refresh, the sound will start to play, you'll have to click to stop it. I hope you can live with this inconvenience.