It is currently December 15th, 2019, 6:35 am

Repeat function?

Help with creating, editing & fixing problems with skins
ItsJustRyan
Posts: 37
Joined: October 25th, 2019, 1:20 am

Repeat function?

ItsJustRyan » November 9th, 2019, 2:17 pm

Hi! I'm back again lmao.

I used to have sliders not only for the volume, but fr brightness. the problem with this brightness plugin is that i dont know how to make it go up or down in 5s. I didnt mind in the past because i made it so i can click where the bar to set it to that value, but i dont know how to here. How can i make it do the function 5 times? Or is there another way? Also if possible how would i have it so i can click some place on the skin and have it set to that angle?

Thanks in advance!

Code: Select all

[Rainmeter]
Update=1

[Metadata]
Author=Ryan

[Variables]
UsedColor=FF8800

[mBrightness]
 Measure=Plugin
 Plugin=ScreenBrightness.dll

[mBrightness2]
 Measure=Calc
 Formula=mBrightness
 IfCondition=(mBrightness2 = -1)
 IfTrueAction=[!SetOption "Text2.Brightness" "Text" "0"][!Update]
 IfFalseAction=[!SetOption "Text2.Brightness" "Text" "%1%"][!Update]


[MeterVol]
Meter=Roundline
MeasureName=mBrightness
X=10
Y=0
W=120
H=120
StartAngle=-4.712
RotationAngle=6.283
LineLength=20
LineColor=#UsedColor#
Solid=1
AntiAlias=1
MouseScrollDownAction=[!CommandMeasure "mBrightness" "Lower"][!Update]
MouseScrollUpAction=[!CommandMeasure "mBrightness" "raise"][!Update]


[MeterEllipse]
Meter=Shape
Shape=Ellipse 70,60,16 | Stroke Color 255,255,255,0

[Perc]
Meter=String
MeasureName=mBrightness2
x=70
y=49
StringAlign=Center
FontFace=Century Gothic
FontWeight=500
FontColor=#UsedColor#
Text=%1
FontSize=12
AntiAlias=1

[code]
User avatar
jsmorley
Developer
Posts: 19870
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Repeat function?

jsmorley » November 9th, 2019, 2:44 pm

I don't have and won't use that screen brightness plugin, but in general...

Code: Select all

[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1

[Variables]
U=[!UpdateMeasure MeasureInc][!UpdateMeter *][!Redraw]
Current=100
Delay=100
NumOfTimes=5

[MeasureInc]
Measure=Plugin
Plugin=ActionTimer
ActionList1=Repeat AddTo, #Delay#, #NumOfTimes#
AddTo=[!SetVariable Current "(Clamp(#Current#+1,0,100))"]#U#
ActionList2=Repeat SubFrom, #Delay#, #NumOfTimes#
SubFrom=[!SetVariable Current "(Clamp(#Current#-1,0,100))"]#U#
DynamicVariables=1

[MeterUp]
Meter=String
FontSize=20
FontWeight=400
FontColor=255,255,255,255
SolidColor=47,47,47,255
Padding=5,5,5,5
AntiAlias=1
Text=[\x2b61]
LeftMouseUpAction=[!CommandMeasure MeasureInc "Execute 1"]

[MeterDown]
Meter=String
X=10R
FontSize=20
FontWeight=400
FontColor=255,255,255,255
SolidColor=47,47,47,255
Padding=5,5,5,5
AntiAlias=1
Text=[\x2b63]
LeftMouseUpAction=[!CommandMeasure MeasureInc "Execute 2"]

[MeterCurrent]
Meter=String
X=30
StringAlign=Center
Y=5R
FontSize=20
FontWeight=400
FontColor=255,255,255,255
SolidColor=47,47,47,255
Padding=5,5,5,5
AntiAlias=1
DynamicVariables=1
Text=#Current#

GIF.gif


https://docs.rainmeter.net/manual/plugins/actiontimer/

The idea is to use !SetVariable some number of times, with a delay in between each increment, to either add or subtract from the value of the variable. Then you can use that variable dynamically anywhere you need it, to control pretty much anything you want.


Let me know if you have any questions, I can explain as much or as little as you need.
You do not have the required permissions to view the files attached to this post.
User avatar
jsmorley
Developer
Posts: 19870
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Repeat function?

jsmorley » November 9th, 2019, 3:08 pm

Here is another example, that explicitly controls a plugin measure, rather than using a variable:

Code: Select all

[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1

[Variables]
U=[!UpdateMeasure MeasureInc][!UpdateMeasure MeasureWin7Audio][!UpdateMeter *][!Redraw]
Delay=100
NumOfTimes=5

[MeasureWin7Audio]
Measure=Plugin
Plugin=Win7AudioPlugin

[MeasureInc]
Measure=Plugin
Plugin=ActionTimer
ActionList1=Repeat AddTo, #Delay#, #NumOfTimes#
AddTo=[!CommandMeasure MeasureWin7Audio "ChangeVolume +1"]#U#
ActionList2=Repeat SubFrom, #Delay#, #NumOfTimes#
SubFrom=[!CommandMeasure MeasureWin7Audio "ChangeVolume -1"]#U#
DynamicVariables=1

[MeterUp]
Meter=String
X=5
FontSize=20
FontWeight=400
FontColor=255,255,255,255
SolidColor=47,47,47,255
Padding=5,5,5,5
AntiAlias=1
Text=[\x2b61]
LeftMouseUpAction=[!CommandMeasure MeasureInc "Execute 1"]

[MeterDown]
Meter=String
X=13R
FontSize=20
FontWeight=400
FontColor=255,255,255,255
SolidColor=47,47,47,255
Padding=5,5,5,5
AntiAlias=1
Text=[\x2b63]
LeftMouseUpAction=[!CommandMeasure MeasureInc "Execute 2"]

[MeterCurrent]
Meter=String
X=37
StringAlign=Center
Y=5R
FontSize=20
FontWeight=400
FontColor=255,255,255,255
SolidColor=47,47,47,255
Padding=5,5,5,5
AntiAlias=1
DynamicVariables=1
Text=[MeasureWin7Audio:]%

GIF.gif
You do not have the required permissions to view the files attached to this post.