Please post the code you have so far, to can take a look.Resike wrote:To be honest even i don't know what i want yet, i'm just bouncing ideas and i will decide based on the results.
The main idea would be for the user to see if the price-percentage went up or down since the last update. And relatively how big was that value change.
I can point you to this little graph:
http://addgadgets.com/image/currency_meter.png
It is currently April 28th, 2024, 6:53 pm
Trailing Zeros
-
- Rainmeter Sage
- Posts: 16185
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
Re: Trailing Zeros
-
- Posts: 33
- Joined: May 1st, 2015, 1:25 am
Re: Trailing Zeros
Not sure where could i upload it?
-
- Rainmeter Sage
- Posts: 16185
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
Re: Trailing Zeros
Pack it to a zip or rmskin format (last one can be created using the Create rmskin package... button on the Skins tab of the Manage Rainmeter window). Then attach the created file, using the Upload attachement section here, where you post reply.
Maybe alternatively you coud upload just the code (use the Code button above), but use this only if you don't have needed resources (images, inc files and so on).
Maybe alternatively you coud upload just the code (use the Code button above), but use this only if you don't have needed resources (images, inc files and so on).
-
- Posts: 33
- Joined: May 1st, 2015, 1:25 am
Re: Trailing Zeros
Here is it.
You do not have the required permissions to view the files attached to this post.
-
- Developer
- Posts: 22631
- Joined: April 19th, 2009, 11:02 pm
- Location: Fort Hunt, Virginia, USA
Re: Trailing Zeros
I'd be tempted with something like this. I use a little Lua to save the "old" price for comparison with the "new" price, and then had the skin take some actions based on rising or falling values.
No change: Lower: Higher: LineCompare.ini:
LineCompare.lua:
Example.html:
You can test by simply opening Example.html, changing the value, and saving it. I have UpdateRate=10 on the WebParser measure, just for testing. Do NOT leave a value that low when hitting an actual site.
No change: Lower: Higher: LineCompare.ini:
Code: Select all
[Rainmeter]
Update=1000
AccurateText=1
DynamicWindowSize=1
[Variables]
OldValue=1.3
[MeasureValue]
Measure=Plugin
Plugin=WebParser
URL=file://#CURRENTPATH#Example.html
RegExp=(?siU)<price>(.*)</price>
UpdateRate=10
StringIndex=1
FinishAction=[!UpdateMeasure MeasureNumValue][!EnableMeasure MeasureCompareScript][!UpdateMeasure MeasureCompareScript][!UpdateMeter MeterLine]
[MeasureNumValue]
Measure=Calc
Formula=[MeasureValue]
MinValue=0
MaxValue=4
DynamicVariables=1
[MeasureCompareScript]
Measure=Script
ScriptFile=#CURRENTPATH#LineCompare.lua
Disabled=1
UpdateDivider=-1
[MeterLine]
Meter=Line
MeasureName=MeasureNumValue
W=300
H=100
LineColor=230,245,252,255
SolidColor=23,77,105,255
AntiAlias=1
UpdateDivider=-1
[MeterOldValue]
Meter=String
X=10
Y=5R
FontSize=11
FontColor=255,255,255,255
AntiAlias=1
NumOfDecimals=4
Text=1.1000
[MeterChangeValue]
Meter=String
MeasureName=MeasureNumValue
X=150
Y=0r
StringAlign=Center
FontSize=11
FontColor=255,255,255,255
AntiAlias=1
NumOfDecimals=4
Text=+ 0.1000
[MeterNewValue]
Meter=String
MeasureName=MeasureNumValue
X=290
Y=0r
StringAlign=Right
FontSize=11
FontColor=255,255,255,255
AntiAlias=1
NumOfDecimals=4
Text=%1
Code: Select all
function Initialize()
measureValue = SKIN:GetMeasure('MeasureNumValue')
end
function Update()
oldValue = tonumber(SKIN:GetVariable('OldValue'))
newValue = tonumber(measureValue:GetValue())
SKIN:Bang('!SetOption', 'MeterOldValue', 'Text', PadZero(oldValue))
if newValue < oldValue then
SKIN:Bang('!SetOption', 'MeterChangeValue', 'Text', '- '..PadZero(oldValue - newValue))
SKIN:Bang('!SetOption', 'MeterChangeValue', 'FontColor', '237,159,159,255')
end
if newValue > oldValue then
SKIN:Bang('!SetOption', 'MeterChangeValue', 'Text', '+ '..PadZero(newValue - oldValue))
SKIN:Bang('!SetOption', 'MeterChangeValue', 'FontColor', '159,237,164,255')
end
if newValue == oldValue then
SKIN:Bang('!SetOption', 'MeterChangeValue', 'Text', '+/- '..PadZero('0'))
SKIN:Bang('!SetOption', 'MeterChangeValue', 'FontColor', '200,200,200,255')
end
SKIN:Bang('!SetVariable', 'OldValue', newValue)
SKIN:Bang('!WriteKeyValue', 'Variables', 'OldValue', newValue)
return newValue
end
function PadZero(arg)
return string.format("%.4f", arg)
end
Code: Select all
<price>1.3000</price>
You do not have the required permissions to view the files attached to this post.
-
- Developer
- Posts: 22631
- Joined: April 19th, 2009, 11:02 pm
- Location: Fort Hunt, Virginia, USA
Re: Trailing Zeros
Just one last example, which also touches on the the "broken range functionality" in the Line meter balala and I were discussing:
Does much the same thing with "temperatures" from a weather site, while properly dealing with the fact that for Fahrenheit, the range can likely be from -20 to 110 some places in the world. Tracks the temperature over time in the Line meter, showing the relative "change" every 10 minutes.
Ok, if it is ever -20 or 110 degrees in Virginia, I'm moving...
Code: Select all
[Rainmeter]
Update=1000
AccurateText=1
DynamicWindowSize=1
[Variables]
Location=23418210
Unit=f
OldValue=83
RangeLow=-20
RangeHigh=110
[MeasureValue]
Measure=Plugin
Plugin=WebParser
URL=http://weather.yahooapis.com/forecastrss?w=#Location#&u=#Unit#
RegExp=(?siU)<yweather:condition.*temp="(.*)"
UpdateRate=600
StringIndex=1
FinishAction=[!UpdateMeasure MeasureNumValue][!UpdateMeasure MeasurePercent][!EnableMeasure MeasureCompareScript][!UpdateMeasure MeasureCompareScript][!ShowMeterGroup AllMeters][!UpdateMeter MeterLine]
[MeasureNumValue]
Measure=Calc
Formula=[MeasureValue]
MinValue=#RangeLow#
MaxValue=#RangeHigh#
DynamicVariables=1
[MeasurePercent]
Measure=Calc
Formula=[MeasureNumValue:%]
MinValue=0
MaxValue=100
DynamicVariables=1
[MeasureCompareScript]
Measure=Script
ScriptFile=#CURRENTPATH#TempLine.lua
Disabled=1
UpdateDivider=-1
[MeterLine]
Meter=Line
Group=AllMeters
MeasureName=MeasurePercent
W=300
H=100
LineColor=230,245,252,255
SolidColor=23,77,105,255
AntiAlias=1
UpdateDivider=-1
Hidden=1
[MeterOldValue]
Meter=String
Group=AllMeters
X=10
Y=5R
FontSize=11
FontColor=255,255,255,255
AntiAlias=1
Hidden=1
[MeterChangeValue]
Meter=String
Group=AllMeters
X=150
Y=0r
StringAlign=Center
FontSize=11
FontColor=255,255,255,255
AntiAlias=1
Hidden=1
[MeterNewValue]
Meter=String
Group=AllMeters
MeasureName=MeasureNumValue
X=290
Y=0r
StringAlign=Right
FontSize=11
FontColor=255,255,255,255
AntiAlias=1
Text=%1°F
Hidden=1
Ok, if it is ever -20 or 110 degrees in Virginia, I'm moving...
You do not have the required permissions to view the files attached to this post.
-
- Posts: 33
- Joined: May 1st, 2015, 1:25 am
Re: Trailing Zeros
Thats pretty neat, i made a smaller change to allow the line to dyamically strech it's maxvalue, however it's still not really working for the minus values. Would be awsome if it could handle thoose values too.jsmorley wrote:Just one last example, which also touches on the the "broken range functionality" in the Line meter balala and I were discussing:
Does much the same thing with "temperatures" from a weather site, while properly dealing with the fact that for Fahrenheit, the range can likely be from -20 to 110 some places in the world. Tracks the temperature over time in the Line meter, showing the relative "change" every 10 minutes.Code: Select all
[Rainmeter] Update=1000 AccurateText=1 DynamicWindowSize=1 [Variables] Location=23418210 Unit=f OldValue=83 RangeLow=-20 RangeHigh=110 [MeasureValue] Measure=Plugin Plugin=WebParser URL=http://weather.yahooapis.com/forecastrss?w=#Location#&u=#Unit# RegExp=(?siU)<yweather:condition.*temp="(.*)" UpdateRate=600 StringIndex=1 FinishAction=[!UpdateMeasure MeasureNumValue][!UpdateMeasure MeasurePercent][!EnableMeasure MeasureCompareScript][!UpdateMeasure MeasureCompareScript][!ShowMeterGroup AllMeters][!UpdateMeter MeterLine] [MeasureNumValue] Measure=Calc Formula=[MeasureValue] MinValue=#RangeLow# MaxValue=#RangeHigh# DynamicVariables=1 [MeasurePercent] Measure=Calc Formula=[MeasureNumValue:%] MinValue=0 MaxValue=100 DynamicVariables=1 [MeasureCompareScript] Measure=Script ScriptFile=#CURRENTPATH#TempLine.lua Disabled=1 UpdateDivider=-1 [MeterLine] Meter=Line Group=AllMeters MeasureName=MeasurePercent W=300 H=100 LineColor=230,245,252,255 SolidColor=23,77,105,255 AntiAlias=1 UpdateDivider=-1 Hidden=1 [MeterOldValue] Meter=String Group=AllMeters X=10 Y=5R FontSize=11 FontColor=255,255,255,255 AntiAlias=1 Hidden=1 [MeterChangeValue] Meter=String Group=AllMeters X=150 Y=0r StringAlign=Center FontSize=11 FontColor=255,255,255,255 AntiAlias=1 Hidden=1 [MeterNewValue] Meter=String Group=AllMeters MeasureName=MeasureNumValue X=290 Y=0r StringAlign=Right FontSize=11 FontColor=255,255,255,255 AntiAlias=1 Text=%1°F Hidden=1
Ok, if it is ever -20 or 110 degrees in Virginia, I'm moving...
You do not have the required permissions to view the files attached to this post.
-
- Posts: 33
- Joined: May 1st, 2015, 1:25 am
Re: Trailing Zeros
Is it possbile to show an image like this one in rainmeter?
http://chart.finance.yahoo.com/b?s=USDHUF=X&lang=en-US®ion=US
http://chart.finance.yahoo.com/b?s=USDHUF=X&lang=en-US®ion=US
Last edited by Resike on May 23rd, 2015, 10:58 am, edited 1 time in total.
-
- Posts: 1740
- Joined: November 13th, 2012, 9:53 pm
-
- Posts: 33
- Joined: May 1st, 2015, 1:25 am
Re: Trailing Zeros
Sexy, thanks.moshi wrote:http://customize.org/rainmeter/skins/65673774