I read all of this. And decided, I'm gonna copy the equation and test it myself.
I figured it out, and was about to confirm with you what I discovered.
...and then realized you spelled it all out for me 3 lines down.
How would I do the minimum equal to 0?
Min=0 seems a bit too simple...
[Edit] Similar problem I'd imagine.
The up direction has no limit, so the bar can go off the screen...
[Editx2]Alright. I fixed the limit for the meter, but the virtual placement of the meter is still there.
Like, the bar stops at the top, but if you keep clicking up it #var# gets bigger which controls the bar position. So, it'll be maxed out, but you have click down a bunch of times to make it actually come down.
Code: Select all
[Rainmeter]
Author=JpsCrazy, scroll bar code by Smurfier
Update=200
BackgroundMode=2
SolidColor=50,50,50,100
[Variables]
;Path to NirCmd (uneccesary to change if in \Windows directory)
NirCmdPath=NirCmd.exe
;How many pixels the bar moves by
line.amount=9
;Variable for volume
var=15
;Maximum var
mult=15
;Starting Y value for strings
S.H=0
;Starting Y value for bar
start.value=143
;Don't mess with these ones
Num=1
Move=0
Max=10
Tot=10
;Calculate the Volume=========================================
[msVolume]
Measure=Calc
Formula=#var#*(65535/#mult#)
;Scrollbar and Buttons =======================================
[mtUp]
Meter=Image
ImageName=Arrow.png
ImageFlip=Vertical
AntiAlias=1
LeftMouseUpAction=!Execute [!RainmeterSetVariable Move 0]["#NirCmdPath#" changesysvolume [msVolume]][!RainmeterSetVariable Var [msVarUp]]
[msVarUp]
Measure=Calc
Formula=#Var#+1
DynamicVariables=1
[msMaxVar]
Measure=Calc
Formula=#Var# > 15
[msBarPlace]
Measure=Calc
Formula=(#start.value#+((-#var#)*#line.amount#) > 8) ? #start.value#+((-#var#)*#line.amount#) : 8
DynamicVariables=1
[mtBar]
Meter=Image
ImageName=Circle.png
W=10
H=10
Y=[msBarPlace]
X=3
DynamicVariables=1
[mtDown]
Meter=Image
ImageName=Arrow.png
Y=((#Max#*15)+25+(#S.H#-20))
LeftMouseUpAction=!Execute [!RainmeterSetVariable Move 0]["#NirCmdPath#" changesysvolume -[msVolume]][!RainmeterSetVariable Var [msVarDown]]
AntiAlias=1
DynamicVariables=1
[msVarDown]
Measure=Calc
Formula=#Var#-1
DynamicVariables=1