I'd probably attack it something like this:
Code: Select all
[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1
[Variables]
PrevValue=0
DirIcon=●
[MeasureTemp]
Measure=WebParser
URL=file://#CURRENTPATH#Test.html
RegExp=(?siU)<temp>(.*)</temp>
StringIndex=1
UpdateRate=5
FinishAction=[!EnableMeasure MeasurePrev][!UpdateMeasure MeasurePrev]
[MeasurePrev]
Measure=Calc
Formula=[MeasureTemp]
DynamicVariables=1
Disabled=1
UpdateDivider=-1
IfCondition=#PrevValue# > [MeasureTemp]
IfTrueAction=[!SetVariable DirIcon "▼"][!SetVariable PrevValue "[MeasureTemp]"][!WriteKeyValue Variables PrevValue "[MeasureTemp]"][!UpdateMeter *][!Redraw]
IfCondition2=#PrevValue# < [MeasureTemp]
IfTrueAction2=[!SetVariable DirIcon "▲"][!SetVariable PrevValue "[MeasureTemp]"][!WriteKeyValue Variables PrevValue "[MeasureTemp]"][!UpdateMeter *][!Redraw]
IfCondition3=#PrevValue# = [MeasureTemp]
IfTrueAction3=[!SetVariable DirIcon "▬"][!SetVariable PrevValue "[MeasureTemp]"][!WriteKeyValue Variables PrevValue "[MeasureTemp]"][!UpdateMeter *][!Redraw]
[MeterTemp]
Meter=String
FontSize=11
FontWeight=400
FontColor=255,255,255,255
SolidColor=47,47,47,255
Padding=5,5,5,5
AntiAlias=1
Text=Temperature: [MeasureTemp] (#DirIcon#)
DynamicVariables=1
So basically when the WebParser measure gets the value, it is compared to the variable #PrevValue#. If #PrevValue# is "greater", than the current temperature is "lower", and the string "▼" is set for a variable #DirIcon#, and used in the string meter. Same thing for "lower" and "equal".
Then the current value from WebParser is set as the value for #PrevValue#, ready for the comparison the next time WebParser goes out and gets a value. At the same time, we are physically writing the value of #PrevValue#, so it will be "persistent", and survive a refresh or restart of the skin.
This test skin just uses a local file to simulate getting the temperature from some weather site, and can be tested by opening Test.html, changing the value in it, and saving. I have it set to read the file every 5 seconds, just for testing purposes.
Test.html:
If you are going to directly use the Unicode characters in your skin .ini code, be sure the file is encoded as UTF-16 LE. You can also use
Inline Character Variables instead if you want.