It is currently April 19th, 2024, 8:59 pm

Help with ActionTIMER

Get help with creating, editing & fixing problems with skins
User avatar
andersonventura
Posts: 57
Joined: December 11th, 2018, 7:38 pm
Location: Brasil

Help with ActionTIMER

Post by andersonventura »

HI

My code has strange behavior

pls help me

Code: Select all


[Rainmeter]
Update=100
BackgroundMode=2

[Variables]
AlphaBG=100
WaitBG=10

AlphaICON=155
AlphaICON_MIN=155
AlphaICON_MAX=255

WaitICON=30

SizeICON=40
SizeICON_MIN=40
SizeICON_MAX=60

PositionICON_X=10
PositionICON_INI_X=10
PositionICON_FIN_X=0

PositionICON_Y=10
PositionICON_INI_Y=10
PositionICON_FIN_Y=0

[MeasureActionTimerBG]
Measure=Plugin
Plugin=ActionTimer
ActionList1=Repeat FadeOut,#WaitBG#,40
FadeIn=[!SetVariable AlphaBG "(Clamp(#AlphaBG#-2,20,100))"][!UpdateMeasure "MeasureActionTimerBG"][!UpdateMeter "MeterBG"][!Redraw]
ActionList2=Repeat FadeIn,#WaitBG#,40
FadeOut=[!SetVariable AlphaBG "(Clamp(#AlphaBG#+2,20,100))"][!UpdateMeasure "MeasureActionTimerBG"][!UpdateMeter "MeterBG"][!Redraw]
DynamicVariables=1

[MeterBG]
Meter=Shape
Shape=Ellipse 40,40,40,40 | Fill Color 0,0,0,#AlphaBG# | StrokeWidth 0
MouseOverAction=[!CommandMeasure MeasureActionTimerBG "Stop 1"][!CommandMeasure MeasureActionTimerBG "Execute 2"]
MouseLeaveAction=[!CommandMeasure MeasureActionTimerBG "Stop 2"][!CommandMeasure MeasureActionTimerBG "Execute 1"]
;RightMouseUpAction=[]
DynamicVariables=1
X=0
Y=0

[MeasureActionTimer01]
DynamicVariables=1
Measure=Plugin
Plugin=ActionTimer

ActionList1=Repeat FadeIn,#WaitICON#,20
FadeIn=[!SetVariable AlphaICON "(Clamp(#AlphaICON#+5,#AlphaICON_MIN#,#AlphaICON_MAX#))"][!SetVariable SizeICON "(Clamp(#SizeICON#+2,#SizeICON_MIN#,#SizeICON_MAX#))"][!SetVariable PositionICON_X "(Clamp(#PositionICON_X#+1,#PositionICON_INI_X#,#PositionICON_FIN_X#))"][!SetVariable PositionICON_Y "(Clamp(#PositionICON_Y#+1,#PositionICON_INI_Y#,#PositionICON_FIN_Y#))"][!UpdateMeasure "MeasureActionTimer01"][!UpdateMeter "Meter01"][!Redraw]

ActionList2=Repeat FadeOut,#WaitICON#,20
FadeOut=[!SetVariable AlphaICON "(Clamp(#AlphaICON#-5,#AlphaICON_MIN#,#AlphaICON_MAX#))"][!SetVariable SizeICON "(Clamp(#SizeICON#-2,#SizeICON_MIN#,#SizeICON_MAX#))"][!SetVariable PositionICON_X "(Clamp(#PositionICON_X#-1,#PositionICON_INI_X#,#PositionICON_FIN_X#))"][!SetVariable PositionICON_Y "(Clamp(#PositionICON_Y#-1,#PositionICON_INI_Y#,#PositionICON_FIN_Y#))"][!UpdateMeasure "MeasureActionTimer01"][!UpdateMeter "Meter01"][!Redraw]

[Meter01]
Meter=Image
ImageName=#@#ICON.png
ImageAlpha=#AlphaICON#
MouseOverAction=[!CommandMeasure MeasureActionTimer01 "Stop 2"][!CommandMeasure MeasureActionTimer01 "Execute 1"]
MouseLeaveAction=[!CommandMeasure MeasureActionTimer01 "Stop 1"][!CommandMeasure MeasureActionTimer01 "Execute 2"]
LeftMouseUpAction=!Execute ["#@#Chrome"]
RightMouseUpAction=[]
DynamicVariables=1
X=#PositionICON_X#
Y=#PositionICON_Y#
W=#SizeICON#
H=#SizeICON#





User avatar
Yincognito
Rainmeter Sage
Posts: 7128
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Help with ActionTIMER

Post by Yincognito »

Just a wild guess based on your little to no info about what you find strange in the code's behavior, but maybe stopping both actions before executing one of them could help?
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
andersonventura
Posts: 57
Joined: December 11th, 2018, 7:38 pm
Location: Brasil

Re: Help with ActionTIMER

Post by andersonventura »

im triyng to move the ICON of X,Y=10 position to X,Y=0 position using clamp. i think it cant be done because in rainmeter manual i found this:

function Clamp(num, lower, upper)

and i tring to do something like this:

function Clamp(num, upper, lower)

my intention is maintain centralizated the icon when it sametime he increase the size.
User avatar
Yincognito
Rainmeter Sage
Posts: 7128
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Help with ActionTIMER

Post by Yincognito »

andersonventura wrote: September 14th, 2020, 10:03 am im triyng to move the ICON of X,Y=10 position to X,Y=0 position using clamp. i think it cant be done because in rainmeter manual i found this:

function Clamp(num, lower, upper)

and i tring to do something like this:

function Clamp(num, upper, lower)

my intention is maintain centralizated the icon when it sametime he increase the size.
Yes, that's your first mistake, trying Clamp(num, upper, lower) instead of Clamp(num, lower, upper). The second is that you didnt's set the icon position correctly at start (aka didn't calculate the values properly). The third is that you must subtract in your first action and add in the second to generate the desired effect, instead of doing the opposite like you do now. Will post the code shortly.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
andersonventura
Posts: 57
Joined: December 11th, 2018, 7:38 pm
Location: Brasil

Re: Help with ActionTIMER

Post by andersonventura »

SUPPER!

Solved!!!!!!!!!!


Thanks man!!!

i just subtract and voila!!!!
User avatar
andersonventura
Posts: 57
Joined: December 11th, 2018, 7:38 pm
Location: Brasil

Re: Help with ActionTIMER

Post by andersonventura »

Final result:
icon_1.rmskin

Code: Select all

[Rainmeter]
Update=-1
BackgroundMode=1

[Variables]
AlphaBG=100
WaitBG=10
AlphaICON=155
AlphaICON_MIN=155
AlphaICON_MAX=255
WaitICON=30
SizeICON=30
SizeICON_MIN=30
SizeICON_MAX=50
PositionICON_X=15
PositionICON_INI_X=5
PositionICON_FIN_X=15
PositionICON_Y=15
PositionICON_INI_Y=5
PositionICON_FIN_Y=15

[MeasureActionTimerBG]
Measure=Plugin
Plugin=ActionTimer
ActionList1=Repeat FadeOut,#WaitBG#,40
FadeIn=[!SetVariable AlphaBG "(Clamp(#AlphaBG#-2,20,100))"][!UpdateMeasure "MeasureActionTimerBG"][!UpdateMeter "MeterBG"][!Redraw]
ActionList2=Repeat FadeIn,#WaitBG#,40
FadeOut=[!SetVariable AlphaBG "(Clamp(#AlphaBG#+2,20,100))"][!UpdateMeasure "MeasureActionTimerBG"][!UpdateMeter "MeterBG"][!Redraw]
DynamicVariables=1

[MeterBG]
Meter=Shape
Shape=Ellipse 30,30,30,30 | Fill Color 0,0,0,#AlphaBG# | StrokeWidth 0
MouseOverAction=[!CommandMeasure MeasureActionTimerBG "Stop 1"][!CommandMeasure MeasureActionTimerBG "Execute 2"]
MouseLeaveAction=[!CommandMeasure MeasureActionTimerBG "Stop 2"][!CommandMeasure MeasureActionTimerBG "Execute 1"]
RightMouseUpAction=[]
DynamicVariables=1
X=0
Y=0

[MeasureActionTimer01]
DynamicVariables=1
Measure=Plugin
Plugin=ActionTimer
ActionList1=Repeat FadeIn,#WaitICON#,20
FadeIn=[!SetVariable AlphaICON "(Clamp(#AlphaICON#+5,#AlphaICON_MIN#,#AlphaICON_MAX#))"][!SetVariable SizeICON "(Clamp(#SizeICON#+2,#SizeICON_MIN#,#SizeICON_MAX#))"][!SetVariable PositionICON_X "(Clamp(#PositionICON_X#-1,#PositionICON_INI_X#,#PositionICON_FIN_X#))"][!SetVariable PositionICON_Y "(Clamp(#PositionICON_Y#-1,#PositionICON_INI_Y#,#PositionICON_FIN_Y#))"][!UpdateMeasure "MeasureActionTimer01"][!UpdateMeter "Meter01"][!Redraw]
ActionList2=Repeat FadeOut,#WaitICON#,20
FadeOut=[!SetVariable AlphaICON "(Clamp(#AlphaICON#-5,#AlphaICON_MIN#,#AlphaICON_MAX#))"][!SetVariable SizeICON "(Clamp(#SizeICON#-2,#SizeICON_MIN#,#SizeICON_MAX#))"][!SetVariable PositionICON_X "(Clamp(#PositionICON_X#+1,#PositionICON_INI_X#,#PositionICON_FIN_X#))"][!SetVariable PositionICON_Y "(Clamp(#PositionICON_Y#+1,#PositionICON_INI_Y#,#PositionICON_FIN_Y#))"][!UpdateMeasure "MeasureActionTimer01"][!UpdateMeter "Meter01"][!Redraw]

[Meter01]
Meter=Image
ImageName=#@#ICON.png
ImageAlpha=#AlphaICON#
MouseOverAction=[!CommandMeasure MeasureActionTimer01 "Stop 2"][!CommandMeasure MeasureActionTimer01 "Execute 1"]
MouseLeaveAction=[!CommandMeasure MeasureActionTimer01 "Stop 1"][!CommandMeasure MeasureActionTimer01 "Execute 2"]
LeftMouseUpAction=!Execute ["#@#Chrome"]
RightMouseUpAction=[]
DynamicVariables=1
X=#PositionICON_X#
Y=#PositionICON_Y#
W=#SizeICON#
H=#SizeICON#
You do not have the required permissions to view the files attached to this post.
User avatar
Yincognito
Rainmeter Sage
Posts: 7128
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Help with ActionTIMER

Post by Yincognito »

andersonventura wrote: September 14th, 2020, 10:18 am SUPPER!

Solved!!!!!!!!!!


Thanks man!!!

i just subtract and voila!!!!
andersonventura wrote: September 14th, 2020, 10:23 am Final result: [...]
Excellent - glad you sorted it out! Looks and behaves great now. :thumbup:
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
andersonventura
Posts: 57
Joined: December 11th, 2018, 7:38 pm
Location: Brasil

Re: Help with ActionTIMER

Post by andersonventura »

Another help here!!!! :D

How to add a delay of 1000 miliseconds before the icon back to the original state when the mouse is out?

Code: Select all

[Rainmeter]
Update=-1
BackgroundMode=1
[Variables]

;Customization----------------------------------------

;Size
Size=1.0

;Background Color.
R=150
G=80
B=150

;Icon file name (file must be inside @Resources folder).
File=VALORANT.png

;Shortcut file name to execute on mouse click (shortcut file must be inside @Resources folder).
Shortcut=VALORANT

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

;Code
AlphaBG=100
AlphaBG_01=20
AlphaBG_02=100
WaitBG=10
SizeBG=(#Size#)*30
AlphaICON=155
AlphaICON_01=155
AlphaICON_02=255
WaitICON=30
SizeICON=(#Size#)*30
SizeICON_01=(#Size#)*30
SizeICON_02=(#Size#)*50
PositionICON=(#Size#)*15
PositionICON_INI=(#Size#)*5
PositionICON_FIN=(#Size#)*15
RotateICON=0
RotateICON_INI=0
RotateICON_FIN=30
U=[!UpdateMeasure "MeasureBG"]

[MeasureBG]
DynamicVariables=1
Measure=Plugin
Plugin=ActionTimer
ActionList1=Repeat Action_01,#WaitBG#,40
Action_01=[!SetVariable AlphaBG "(Clamp(#AlphaBG#+2,#AlphaBG_01#,#AlphaBG_02#))"]#U#[!UpdateMeter "MeterBG"][!Redraw]
ActionList2=Repeat Action_02,#WaitBG#,40
Action_02=[!SetVariable AlphaBG "(Clamp(#AlphaBG#-2,#AlphaBG_01#,#AlphaBG_02#))"]#U#[!UpdateMeter "MeterBG"][!Redraw]
ActionList3=Repeat Action_03,#WaitICON#,20
Action_03=[!SetVariable AlphaICON "(Clamp(#AlphaICON#-5,#AlphaICON_01#,#AlphaICON_02#))"][!SetVariable SizeICON "(Clamp(#SizeICON#-2,#SizeICON_01#,#SizeICON_02#))"][!SetVariable PositionICON "(Clamp(#PositionICON#+1,#PositionICON_INI#,#PositionICON_FIN#))"][!SetVariable RotateICON "(Clamp(#RotateICON#-3,#RotateICON_INI#,#RotateICON_FIN#))"]#U#[!UpdateMeter "MeterICON"][!Redraw]
ActionList4=Repeat Action_04,#WaitICON#,20
Action_04=[!SetVariable AlphaICON "(Clamp(#AlphaICON#+5,#AlphaICON_01#,#AlphaICON_02#))"][!SetVariable SizeICON "(Clamp(#SizeICON#+2,#SizeICON_01#,#SizeICON_02#))"][!SetVariable PositionICON "(Clamp(#PositionICON#-1,#PositionICON_INI#,#PositionICON_FIN#))"][!SetVariable RotateICON "(Clamp(#RotateICON#+3,#RotateICON_INI#,#RotateICON_FIN#))"]#U#[!UpdateMeter "MeterICON"][!Redraw]

[MeterBG]
DynamicVariables=1
Meter=Shape
Shape=Ellipse #SizeBG#,#SizeBG#,#SizeBG# | Fill Color #R#,#G#,#B#,#AlphaBG# | StrokeWidth 0
MouseOverAction=[!CommandMeasure MeasureBG "Stop 1"][!CommandMeasure MeasureBG "Execute 2"][!CommandMeasure MeasureBG "Stop 3"][!CommandMeasure MeasureBG "Execute 4"]
MouseLeaveAction=[!CommandMeasure MeasureBG "Stop 2"][!CommandMeasure MeasureBG "Execute 1"][!CommandMeasure MeasureBG "Stop 4"][!CommandMeasure MeasureBG "Execute 3"]
LeftMouseUpAction=!Execute ["#@##Shortcut#"]
RightMouseUpAction=[]
X=0
Y=0

[MeterICON]
DynamicVariables=1
Meter=Image
ImageName=#@##File#
ImageAlpha=#AlphaICON#
ImageRotate=#RotateICON#
RightMouseUpAction=[]
X=#PositionICON#
Y=#PositionICON#
W=#SizeICON#
H=#SizeICON#
User avatar
Yincognito
Rainmeter Sage
Posts: 7128
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Help with ActionTIMER

Post by Yincognito »

andersonventura wrote: September 15th, 2020, 12:47 am Another help here!!!! :D

How to add a delay of 1000 miliseconds before the icon back to the original state when the mouse is out?
Simple: add a [!Delay 1000] at the start of the MouseLeaveAction. See more here.

Very nice effects there, by the way. ;-)

EDIT: Or, you can consider adding Wait NumberOfMilliseconds at the start of ActionList 1 and 3 as well, like:

Code: Select all

ActionList1=Wait 1000 | Repeat Action_01,#WaitBG#,40
...
ActionList3=Wait 1000 | Repeat Action_03,#WaitICON#,20
...
See about that here.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
andersonventura
Posts: 57
Joined: December 11th, 2018, 7:38 pm
Location: Brasil

Re: Help with ActionTIMER

Post by andersonventura »

Niceeee!!!

i put delay between too

Code: Select all

MouseLeaveAction=[!Delay 350][!CommandMeasure MeasureBG "Stop 2"][!CommandMeasure MeasureBG "Execute 1"][!Delay 200][!CommandMeasure MeasureBG "Stop 4"][!CommandMeasure MeasureBG "Execute 3"]
but now im with a trouble:

when I mouseover and quickly mouseleave, it seems that the action is not completely completed. I would like the action to always be completed.
is there any way to do this?