It is currently February 29th, 2024, 7:27 pm

IfBelow/Equal/AboveValue's conflicting.

Get help with creating, editing & fixing problems with skins
User avatar
JpsCrazy
Posts: 667
Joined: April 18th, 2010, 2:16 pm
Location: NY, USA

IfBelow/Equal/AboveValue's conflicting.

Post by JpsCrazy »

So, I'm trying to make a skin where if it's 0% image1 appears, 1-50% image2 appears, and 51-100% image3 appears.
What my idea was (With appropiate actions):
IfBelowValue=51
IfEqualValue=0
IfAboveValue=50

The problem is, the skin reads the 0 as an option of IfBelow, therefore the IfBelowAction is picked over the IfEqualAction, whether or not IfEqualAction is after or before the IfBelowAction. (Values as well.)

Is there any way around this?

Somehow, for one meter+measure this works fine, but two others it doesn't.
I edited out unnecessary variables and codes and such, that's why it skips from 1,4,5.

Code: Select all

[Rainmeter]
	Author=JpsCrazy
	Update=1000
	MiddleMouseDownAction=!RainmeterRefresh

;------------------------------------------------------

[Variables]
;--Measures------------------------
	1=CPU
 	2=FreeDiskSpace
	3=Memory
	4=NetIn
	5=NetOut
	6=NetTotal
	7=Perfmon
	8=PhysicalMemory
	9=Plugin
	10=SwapMemory

	Bar=#9#
	Heart1=#2#
	Heart4=#1#
	Heart5=#8#

	InvertMeasure_Bar=0
	InvertMeasure_Heart1=0
	InvertMeasure_Heart4=0
	InvertMeasure_Heart5=0

	UpdateDivider_Bar=1
	UpdateDivider_Heart1=2
	UpdateDivider_Heart4=1
	UpdateDivider_Heart5=1

	MinValue_Bar=0
	MinValue_Heart1a=0
	MinValue_Heart1b=29903709799
	MinValue_Heart4a=0
	MinValue_Heart4b=50
	MinValue_Heart5a=0
	MinValue_Heart5b=536870912
	
	MaxValue_Bar=100
	MaxValue_Heart1a=29903709799
	MaxValue_Heart1b=59807419596
	MaxValue_Heart4a=50
	MaxValue_Heart4b=100
	MaxValue_Heart5a=536870912
	MaxValue_Heart5b=1073741824

;--Plugins-------------------------
	Power=Plugins\PowerPlugin.dll

	Plugin_Bar=#Power#

;--Measure Options-----------------
;----Free Disk Space---------------
	Drive_Bar=H:\
	Drive_Heart1=C:\
	Drive_Heart4=F:\
	Drive_Heart5=G:\

	IgnoreRemovable_Bar=0
	IgnoreRemovable_Heart1=0
	IgnoreRemovable_Heart4=0
	IgnoreRemovable_Heart5=0

;--Colors--------------------------
	ColorBackground=00000000
	ColorMagic=00C402FF
	ColorHeart=850F0FFF

;------------------------------------------------------

[MeterHeartFill_2/4_Heart1a]
Meter=Image
ImageName=HalfofHeart.png
ImageTint=140,5,9,250
Antialias=1
x=6
y=5

[MeterHeartFill_1/4_Heart1a]
Meter=Image
ImageName=FourthofHeart.png
ImageTint=140,5,9,250
Antialias=1
x=6
y=5

[MeterHeartFill_0/4_Heart1a]
Meter=Image
ImageName=NoneofHeart.png
ImageTint=140,5,9,250
Antialias=1
x=6
y=5

[MeterHeartFill_2/4_Heart1b]
Meter=Image
ImageName=HalfofHeart.png
ImageTint=140,5,9,250
Antialias=1
x=15
y=5

[MeterHeartFill_1/4_Heart1b]
Meter=Image
ImageName=FourthofHeart.png
ImageTint=140,5,9,250
Antialias=1
x=15
y=5

[MeterHeartFill_0/4_Heart1b]
Meter=Image
ImageName=NoneofHeart.png
ImageTint=140,5,9,250
Antialias=1
x=15
y=5

[MeterHeartFill_2/4_Heart4a]
Meter=Image
ImageName=HalfofHeart.png
ImageTint=140,5,9,250
Antialias=1
x=93
y=5

[MeterHeartFill_1/4_Heart4a]
Meter=Image
ImageName=FourthofHeart.png
ImageTint=140,5,9,250
Antialias=1
x=93
y=5

[MeterHeartFill_0/4_Heart4a]
Meter=Image
ImageName=NoneofHeart.png
ImageTint=140,5,9,250
Antialias=1
x=93
y=5

[MeterHeartFill_2/4_Heart4b]
Meter=Image
ImageName=HalfofHeart.png
ImageTint=140,5,9,250
Antialias=1
x=102
y=5

[MeterHeartFill_1/4_Heart4b]
Meter=Image
ImageName=FourthofHeart.png
ImageTint=140,5,9,250
Antialias=1
x=102
y=5

[MeterHeartFill_0/4_Heart4b]
Meter=Image
ImageName=NoneofHeart.png
ImageTint=140,5,9,250
Antialias=1
x=102
y=5

[MeterHeartFill_2/4_Heart5a]
Meter=Image
ImageName=HalfofHeart.png
ImageTint=140,5,9,250
Antialias=1
x=122
y=5

[MeterHeartFill_1/4_Heart5a]
Meter=Image
ImageName=FourthofHeart.png
ImageTint=140,5,9,250
Antialias=1
x=122
y=5

[MeterHeartFill_0/4_Heart5a]
Meter=Image
ImageName=NoneofHeart.png
ImageTint=140,5,9,250
Antialias=1
x=122
y=5

[MeterHeartFill_2/4_Heart5b]
Meter=Image
ImageName=HalfofHeart.png
ImageTint=140,5,9,250
Antialias=1
x=131
y=5

[MeterHeartFill_1/4_Heart5b]
Meter=Image
ImageName=FourthofHeart.png
ImageTint=140,5,9,250
Antialias=1
x=131
y=5

[MeterHeartFill_0/4_Heart5b]
Meter=Image
ImageName=NoneofHeart.png
ImageTint=140,5,9,250
Antialias=1
x=131
y=5

;------------------------------------------------------

[MeasureHeart1a]
	Measure=#Heart1#
	InvertMeasure=#InvertMeasure_Heart1#
	UpdateDivider=#UpdateDivider_Heart1#
	Drive=#Drive_Heart1#
	IgnoreRemovable=#IgnoreRemovable_Heart1#
	MinValue=#MinValue_Heart1a#
	MaxValue=#MaxValue_Heart1a#
	IfBelowValue=14951854899
	IfBelowAction=!execute [!RainmeterHideMeter MeterHeartFill_0/4_Heart1a] [!RainmeterShowMeter MeterHeartFill_1/4_Heart1a] [!RainmeterHideMeter MeterHeartFill_2/4_Heart1a]
	IfEqualValue=#MinValue_Heart1a#
	IfEqualAction=!execute [!RainmeterShowMeter MeterHeartFill_0/4_Heart1a] [!RainmeterHideMeter MeterHeartFill_1/4_Heart1a] [!RainmeterHideMeter MeterHeartFill_2/4_Heart1a]
	IfAboveValue=14951854899
	IfAboveAction=!execute [!RainmeterHideMeter MeterHeartFill_0/4_Heart1a] [!RainmeterHideMeter MeterHeartFill_1/4_Heart1a] [!RainmeterShowMeter MeterHeartFill_2/4_Heart1a]

[MeasureHeart1b]
	Measure=#Heart1#
	InvertMeasure=#InvertMeasure_Heart1#
	UpdateDivider=#UpdateDivider_Heart1#
	Drive=#Drive_Heart1#
	IgnoreRemovable=#IgnoreRemovable_Heart1#
	MinValue=#MinValue_Heart1b#
	MaxValue=#MaxValue_Heart1b#
	IfBelowValue=44855564697
	IfBelowAction=!execute [!RainmeterHideMeter MeterHeartFill_0/4_Heart1b] [!RainmeterShowMeter MeterHeartFill_1/4_Heart1b] [!RainmeterHideMeter MeterHeartFill_2/4_Heart1b]
	IfEqualValue=29903709799
	IfEqualAction=!execute [!RainmeterShowMeter MeterHeartFill_0/4_Heart1b] [!RainmeterHideMeter MeterHeartFill_1/4_Heart1b] [!RainmeterHideMeter MeterHeartFill_2/4_Heart1b]
	IfAboveValue=44855564697
	IfAboveAction=!execute [!RainmeterHideMeter MeterHeartFill_0/4_Heart1b] [!RainmeterHideMeter MeterHeartFill_1/4_Heart1b] [!RainmeterShowMeter MeterHeartFill_2/4_Heart1b]

[MeterHeart1a]
	Meter=Bar
	MeasureName=MeasureHeart1a
	X=6
	Y=3
	W=9
	H=15
	SolidColor=#ColorBackground#
	BarColor=#ColorHeart#
	BarOrientation=VERTICAL

[MeterHeart1b]
	Meter=Bar
	MeasureName=MeasureHeart1b
	X=15
	Y=3
	W=9
	H=15
	SolidColor=#ColorBackground#
	BarColor=#ColorHeart#
	BarOrientation=VERTICAL

;------------------------------------------------------
[MeasureHeart4a]
	Measure=#Heart4#
	InvertMeasure=#InvertMeasure_Heart4#
	UpdateDivider=#UpdateDivider_Heart4#
	Processor=#Processor_Heart4#
	Drive=#Drive_Heart4#
	IgnoreRemovable=#IgnoreRemovable_Heart4#
	PowerState=Percent
	Plugin=#Plugin_Heart4#
	CPUInclude=#CPUInclude_Heart4#
	CPUExclude=#CPUExclude_Heart4#
	PerfMonObject=#PerfMonObject_Heart4#
	PerfMonCounter=#PerfMonCounter_Heart4#
	PerfMonInstance=#PerfMonInstance_Heart4#
	PerfMonDifference=#PerfMonDifference_Heart4#
	ResCountType=#ResCountType_Heart4#
	ProcessName=#ProcessName_Heart4#
	MinValue=#MinValue_Heart4a#
	MaxValue=#MaxValue_Heart4a#
	IfBelowValue=26
	IfBelowAction=!execute [!RainmeterHideMeter MeterHeartFill_0/4_Heart4a] [!RainmeterShowMeter MeterHeartFill_1/4_Heart4a] [!RainmeterHideMeter MeterHeartFill_2/4_Heart4a]
	IfEqualValue=0
	IfEqualAction=!execute [!RainmeterShowMeter MeterHeartFill_0/4_Heart4a] [!RainmeterHideMeter MeterHeartFill_1/4_Heart4a] [!RainmeterHideMeter MeterHeartFill_2/4_Heart4a]
	IfAboveValue=25
	IfAboveAction=!execute [!RainmeterHideMeter MeterHeartFill_0/4_Heart4a] [!RainmeterHideMeter MeterHeartFill_1/4_Heart4a] [!RainmeterShowMeter MeterHeartFill_2/4_Heart4a]

[MeasureHeart4b]
	Measure=#Heart4#
	InvertMeasure=#InvertMeasure_Heart4#
	UpdateDivider=#UpdateDivider_Heart4#
	Processor=#Processor_Heart4#
	Drive=#Drive_Heart4#
	IgnoreRemovable=#IgnoreRemovable_Heart4#
	PowerState=Percent
	Plugin=#Plugin_Heart4#
	CPUInclude=#CPUInclude_Heart4#
	CPUExclude=#CPUExclude_Heart4#
	PerfMonObject=#PerfMonObject_Heart4#
	PerfMonCounter=#PerfMonCounter_Heart4#
	PerfMonInstance=#PerfMonInstance_Heart4#
	PerfMonDifference=#PerfMonDifference_Heart4#
	ResCountType=#ResCountType_Heart4#
	ProcessName=#ProcessName_Heart4#
	MinValue=#MinValue_Heart4b#
	MaxValue=#MaxValue_Heart4b#
	IfBelowValue=76
	IfBelowAction=!execute [!RainmeterHideMeter MeterHeartFill_0/4_Heart4b] [!RainmeterShowMeter MeterHeartFill_1/4_Heart4b] [!RainmeterHideMeter MeterHeartFill_2/4_Heart4b]
	IfEqualValue=50
	IfEqualAction=!execute [!RainmeterShowMeter MeterHeartFill_0/4_Heart4b] [!RainmeterHideMeter MeterHeartFill_1/4_Heart4b] [!RainmeterHideMeter MeterHeartFill_2/4_Heart4b]
	IfAboveValue=75
	IfAboveAction=!execute [!RainmeterHideMeter MeterHeartFill_0/4_Heart4b] [!RainmeterShowMeter MeterHeartFill_1/4_Heart4b] [!RainmeterHideMeter MeterHeartFill_2/4_Heart4b]

[MeterHeart4a]
	Meter=Bar
	MeasureName=MeasureHeart4a
	X=93
	Y=3
	W=9
	H=15
	SolidColor=#ColorBackground#
	BarColor=#ColorHeart#
	BarOrientation=VERTICAL

[MeterHeart4b]
	Meter=Bar
	MeasureName=MeasureHeart4b
	X=102
	Y=3
	W=9
	H=15
	SolidColor=#ColorBackground#
	BarColor=#ColorHeart#
	BarOrientation=VERTICAL

;------------------------------------------------------
[MeasureHeart5a]
	Measure=#Heart5#
	InvertMeasure=#InvertMeasure_Heart5#
	UpdateDivider=#UpdateDivider_Heart5#
	MinValue=#MinValue_Heart5a#
	MaxValue=#MaxValue_Heart5a#
	IfEqualValue=#MinValue_Heart5a#
	IfEqualAction=!execute [!RainmeterShowMeter MeterHeartFill_0/4_Heart5a] [!RainmeterHideMeter MeterHeartFill_1/4_Heart5a] [!RainmeterHideMeter MeterHeartFill_2/4_Heart5a]
	IfAboveValue=268435456
	IfAboveAction=!execute [!RainmeterHideMeter MeterHeartFill_0/4_Heart5a] [!RainmeterHideMeter MeterHeartFill_1/4_Heart5a] [!RainmeterShowMeter MeterHeartFill_2/4_Heart5a]
	IfBelowValue=268435457
	IfBelowAction=!execute [!RainmeterHideMeter MeterHeartFill_0/4_Heart5a] [!RainmeterShowMeter MeterHeartFill_1/4_Heart5a] [!RainmeterHideMeter MeterHeartFill_2/4_Heart5a]

[MeasureHeart5b]
	Measure=#Heart5#
	InvertMeasure=#InvertMeasure_Heart5#
	UpdateDivider=#UpdateDivider_Heart5#
	MinValue=#MinValue_Heart5b#
	MaxValue=#MaxValue_Heart5b#
	IfBelowValue=805306369
	IfBelowAction=!execute [!RainmeterHideMeter MeterHeartFill_0/4_Heart5b] [!RainmeterShowMeter MeterHeartFill_1/4_Heart5b] [!RainmeterHideMeter MeterHeartFill_2/4_Heart5b]
	IfEqualValue=#MinValue_Heart5b#
	IfEqualAction=!execute [!RainmeterShowMeter MeterHeartFill_0/4_Heart5b] [!RainmeterHideMeter MeterHeartFill_1/4_Heart5b] [!RainmeterHideMeter MeterHeartFill_2/4_Heart5b]
	IfAboveValue=805306368
	IfAboveAction=!execute [!RainmeterHideMeter MeterHeartFill_0/4_Heart5b] [!RainmeterHideMeter MeterHeartFill_1/4_Heart5b] [!RainmeterShowMeter MeterHeartFill_2/4_Heart5b]

[MeterHeart5a]
	Meter=Bar
	MeasureName=MeasureHeart5a
	X=122
	Y=3
	W=9
	H=15
	SolidColor=#ColorBackground#
	BarColor=#ColorHeart#
	BarOrientation=VERTICAL

[MeterHeart5b]
	Meter=Bar
	MeasureName=MeasureHeart5b
	X=131
	Y=3
	W=9
	H=15
	SolidColor=#ColorBackground#
	BarColor=#ColorHeart#
	BarOrientation=VERTICAL
dragonmage
Developer
Posts: 1270
Joined: April 3rd, 2009, 4:31 am
Location: NC, US

Re: IfBelow/Equal/AboveValue's conflicting.

Post by dragonmage »

I'm not positive, but I think you are making this way harder than it needs to be.
User avatar
kenz0
Developer
Posts: 263
Joined: July 31st, 2009, 2:23 pm
Location: Tokyo, JPN

Re: IfBelow/Equal/AboveValue's conflicting.

Post by kenz0 »

There is no contradiction.
"IfBelowValue" is not a statement that defines the range. i.e. 1-50%
So in this case, 0 is certainly included in "IfBelowValue". 0 is a value defined as both "IfEqualValue" and "IfBelowValue", and both of actions are executed at 0.

To solve this problem, you should convert the range value into a specific value by using Calc measure.
The following is the example assuming the values from 0 to 100 like CPU measure.

-------------------------------

[MeasureAction]
Measure=Calc
Formula=Value > 50 ? 2 : (Value > 0 ? 1 : 0)
IfEqualValue=1
IfEqualAction=!Execute [Action A]
IfAboveValue=1
IfAboveAction=!Execute [Action B]
IfBelowValue=1
IfBelowAction=!Execute [Action C]

-------------------------------

A. If the value is between from 1 to 50, 1 is returned.
B. If the value exceeds 50, 2 is returned.
C. If the value is others, 0 is returned.
.
Image
User avatar
JpsCrazy
Posts: 667
Joined: April 18th, 2010, 2:16 pm
Location: NY, USA

Re: IfBelow/Equal/AboveValue's conflicting.

Post by JpsCrazy »

Yeah, I tend to make things overly complicated...

And thanks Kenzo!
I never think of stuff like that...
Even if I read about it days before.