It is currently April 16th, 2024, 11:07 pm

HELP: ActionTimer. Is it possible to STOP the completion of the ActionList1 on a second mouseover action?

Get help with creating, editing & fixing problems with skins
User avatar
strawberryshortcake
Posts: 79
Joined: August 27th, 2016, 12:49 am

HELP: ActionTimer. Is it possible to STOP the completion of the ActionList1 on a second mouseover action?

Post by strawberryshortcake »

HELP: ActionTimer. Is it possible to STOP the completion of an active ActionList1 on a second mouseover action .... so a second ActionList1 can be triggered by the second mouseover action without throwing an error?


I know the literature on this site says you can't -- all ActionList must run its course first before another action can take place. My question is ... is there a work around to what I want to do other than than decreasing the number of animation frames to a low amount.

Error Message; 'ActionList1' is currently running

Think about double jumps in a game. In real life, a person jumps once. He/she must come to a stop (hitting the floor) before jumping again. In video games, characters can be programmed to execute a second jump in the middle of a jump so they can reach higher up. The double jumps.


Preface: I have an actiontimer animation skin (just found various codes on this forum and other places that I thought would be interesting). It uses mouseoveraction and mouseleaveaction. Multiple errors will eventually lock up Rainmeter especially if I am ultra aggressive and purposely hovering over the object quickly. I am hoping that it simply has something to do with me not putting the code together properly (mostly copy and paste job). What got me thinking that there could possibly be a solution was JSmorley's actiontimer dock ( https://forum.rainmeter.net/viewtopic.php?t=21112 ).

Yes, there's obviously one major difference. JSmorley's code uses a single image while the code I have found (that I would like to customize) uses multiple images forming an animation. If it ultimately requires me to shorten the animation, that's perfectly acceptable. But ... is there a solution without having to do so?

JSMORLEY'S Actiontimer dock:
https://forum.rainmeter.net/viewtopic.php?t=21112

balala (forum expert)'s butterfly code:
https://forum.rainmeter.net/viewtopic.php?f=5&t=23864

LiquidBubbles 3.0:
https://www.deviantart.com/thatrainmeterperson/art/LiquidBubbles-3-0-773553567

I haven't figured out how to create a skin, so I'm going to upload the files instead as both winrar and 7zip. Doesn't matter which one, they're both the same.



ActionTimer skin ((Created by forum expert balala)

Code: Select all

:

[Rainmeter]
Update=1000
BackgroundMode=2
SolidColor=0,0,0,1
DynamicWindowSize=1
OnRefreshAction=[!CommandMeasure MeasureSlider "Execute 1"][!ShowMeter "MeterButterflies"][!Redraw]

[Variables]
Frame=0
Speed=50
U=[!UpdateMeasure "MeasureSlider"][!UpdateMeasure "MeasureEnd"][!UpdateMeter "MeterButterflies"][!UpdateMeter "MeterFrame"][!Redraw]


[Timer]
Measure=Calc
Formula=( Timer + 1 )
IfCondition=((Timer=30)||(Timer=120)||(Timer=150))
IfTrueAction=[!CommandMeasure MeasureSlider "Execute 1"][!ShowMeter "MeterButterflies"][!Redraw]

[MeasureSlider]
Measure=Plugin
Plugin=ActionTimer
ActionList1=Repeat One,#Speed#,100
One=[!SetVariable Frame "(#Frame#+1)"]#U#
DynamicVariables=1

[MeasureEnd]
Measure=Calc
Formula=#Frame#
IfCondition=(MeasureEnd=100)
IfTrueAction=[!CommandMeasure MeasureSlider "Stop 1"][!SetVariable Frame "0"][!UpdateMeasure "MeasureSlider"][!UpdateMeasure "MeasureEnd"][!HideMeter "MeterButterflies"][!Redraw]
DynamicVariables=1
UpdateDivider=-1

[MeterButterflies]
Meter=Image
ImageName=#@#tmp-#Frame#.png
X=0
Y=0
DynamicVariables=1

[MeterFrame]
Meter=STRING
MEasureName=Timer
X=0
Y=0
Padding=15,5,15,5
FontColor=220,220,220
SolidColor=0,0,0,150
FontSize=8
FontFace=Segoe UI
StringStyle=BOLD
StringAlign=LEFT
AntiAlias=1
Text=%1#CRLF##Frame#
DynamicVariables=1
Hidden=1

I decided to remove the extra times because I realize when I requested the code years ago that looped animation using actiontimer eventually crashes. But I'm not sure if I did it correctly. And not sure if I need to replace the word Repeat for something such as playonce or whatever. Also changed the number of frame from 100 to 12. Might have to go even lower for actiontimer animations.


Original

Code: Select all

Measure=Calc
Formula=( Timer + 1 )
IfCondition=((Timer=30)||(Timer=120)||(Timer=150))
IfTrueAction=[!CommandMeasure MeasureSlider "Execute 1"][!ShowMeter "MeterButterflies"][!Redraw]

[MeasureSlider]
Measure=Plugin
Plugin=ActionTimer
ActionList1=Repeat One,#Speed#,100
One=[!SetVariable Frame "(#Frame#+1)"]#U#
DynamicVariables=1

Modified

Code: Select all

Measure=Calc
Formula=Timer
IfCondition=Timer
IfTrueAction=[!CommandMeasure MeasureSlider "Execute 1"][!ShowMeter "MeterButterflies"][!Redraw]

[MeasureSlider]
Measure=Plugin
Plugin=ActionTimer
ActionList1=Repeat One,#Speed#,12
One=[!SetVariable Frame "(#Frame#+1)"]#U#
DynamicVariables=1
template.ini

Code: Select all

;=============================
;
;	GREEN BUBBLE
;
;=============================


;=========================================================
;
;	ACTION TIMER BUTTERFLY ANIMATION
;	V	V	V	V
;=========================================================
[Timer]
Measure=Calc
Formula=Timer
IfCondition=Timer
IfTrueAction=[!CommandMeasure MeasureSlider "Execute 1"][!ShowMeter "MeterButterflies"][!Redraw]


;------------------------------------------------------------ 	
;	36 is the number of animation frames. Unfortuntely, this is part of the
;	problem causing the Actionlist1 still currenty running error IF I decide to 
;	mouseover the same icon multiple times. 
;	Using 35 or 36 frames of an actiontimer animation easily triggers the 
;	[ActionnList1 is currently active]  error message.
;
;	There are two locations (immediately below) for the the number 36
; 	This ActionTimer plugin is causing the error message, and 
;	I'm not quite sure how to fix it other than just decreasing the amount of animation 
;	frames.. Originally The action was written to to repeat three times. I had to remove it
; 	so the animation only plays once through. Not sure if the "repeat" 
;	word is causing any issue. I think "repeat" is a built in keyword for actiontimer.
;------------------------------------------------------------

[MeasureSlider]
Measure=Plugin
Plugin=ActionTimer
ActionList1=Repeat One,#Speed#,36
One=[!SetVariable Frame "(#Frame#+1)"]#U#
DynamicVariables=1


[MeasureEnd]
Measure=Calc
Formula=#Frame#
IfCondition=(MeasureEnd=36)
IfTrueAction=[!CommandMeasure MeasureSlider "Stop 1"][!SetVariable Frame "0"][!UpdateMeasure "MeasureSlider"][!UpdateMeasure "MeasureEnd"][!HideMeter "MeterButterflies"][!Redraw]
DynamicVariables=1
UpdateDivider=-1


[MeterButterflies]
Meter=Image
ImageName=#@#tmp-#Frame#.png
X=-200
Y=0
DynamicVariables=1


[MeterFrame]
Meter=STRING
MEasureName=Timer
X=0
Y=0
Padding=15,5,15,5
FontColor=220,220,220
SolidColor=0,0,0,150
FontSize=8
FontFace=Segoe UI
StringStyle=BOLD
StringAlign=LEFT
AntiAlias=1
Text=%1#CRLF##Frame#
DynamicVariables=1
Hidden=1


;=========================================================
;	^	^	^	^
;	ACTION TIMER BUTTERFLY ANIMATION
;
;=========================================================







;=========================================================
;
;	A third method would run the once started animation 
;	until its end, no matter when you leave the image
;		V	V	V	V
;=========================================================


;[MeasureNumberCalc]
;Measure=Calc
;Formula=(( MeasureNumberCalc + 1 ) % 30)
;IfCondition=(MeasureNumberCalc=0)
;IfTrueAction=[!PauseMeasure "MeasureNumberCalc"]
;Paused=1


;[MeterBG]
;Meter=Image
;ImageName=#@#tmp-[MeasureNumberCalc].png
;X=-200
;Y=0
;DynamicVariables=1
;MouseOverAction=[!UnpauseMeasure "MeasureNumberCalc"]

;=========================================================
;		^	^	^	^
;	A third method would run the once started animation 
;	until its end, no matter when you leave the image
;
;=========================================================



[measureSTYLE]
Measure=String
String=#CURRENTFILE#
Substitute=".ini":"","Style ":""
UpdateDivider=-1

[measureNUMBER]
Measure=String
String=#CURRENTCONFIG#
Substitute="LiquidBubbles\":"","Bubble ":""
UpdateDivider=-1

[measurePROCESS]
Measure=Plugin
Plugin=Process
ProcessName=[#process[&measureSTYLE]]




;========================================================
;
;	Hover On / Off 
;=========================================================

;ORIGINAL
;====== OFF =======

IfBelowValue=1
IfBelowAction=[!SetOption animation ImageTint "#c_animation1#"][!HideMeter glow][!ShowMeter shadow]

;====== ON ========

IfAboveValue=0
IfAboveAction=[!SetOption animation ImageTint "#c_animation2#"][!ShowMeter glow][!HideMeter shadow]
UpdateDivider=10

;========================================================
;
;	Hover On / Off 
;=========================================================







;=============================================
;
;	FORMULA - START
;
;=============================================


[measureINCREASE]
Measure=Calc
Formula=measureINCREASE + (measureINCREASE < #max_frames#)
IfEqualValue=#max_frames#
IfEqualAction=[!DisableMeasure measureINCREASE]
Disabled=1
UpdateDivider=1

[measureDECREASE]
Measure=Calc
Formula=(measureDECREASE + (#max_frames# + 1) - 1) % (#max_frames# + 1)
IfEqualValue=0
IfEqualAction=[!DisableMeasure measureDECREASE]
Disabled=1
UpdateDivider=1

[measureSUM]
Measure=Calc
Formula=measureINCREASE + measureDECREASE
UpdateDivider=1


;=============================================
;
;	FORMULA - END
;
;=============================================







;=============================================
;
;	BUBBLE AESTHETICS - START
;
;=============================================
[styleSHADOW]
DynamicVariables=1
ImageName=shadow.png
ImagePath=#@#
ImageTint=#c_shadow#
PreserveAspectRatio=1
SolidColor=#c_trigger#
W=([button:W]+6)
X=([button:X]+5)
Y=([button:Y]+5)

[styleGLOW]
DynamicVariables=1
Hidden=1
ImageName=glow.png
ImagePath=#@#
ImageTint=#c_animation2#,125
PreserveAspectRatio=1
SolidColor=#c_trigger#
W=([button:W]+10)
X=0
Y=0
;=============================================
;
;	BUBBLE AESTHETICS - END
;
;=============================================






;=======================================================================================================================================
;=======================================================================================================================================
;=======================================================================================================================================
;			
;				[styleBUTTON]
	
;		STYELBUTTON SECTION 	STYELBUTTON SECTION	STYELBUTTON SECTION	STYELBUTTON SECTION	STYELBUTTON SECTION
;	v	v	v	v
;
;
;=============================================
;
;	ORIGINAL STYLEBUTTON'S MOUSE ACTIONS
;	v	v	v	v
;=============================================

[styleBUTTON]
;MouseOverAction=[!ShowMeter text][!EnableMeasure measureINCREASE][!DisableMeasure measureDECREASE][!SetOption button X "3"][!SetOption button Y "3"][!SetOption button W "([#w_[&measureSTYLE]]+6)"][Play "#@#select.wav"][!UpdateMeter button][!UpdateMeter animation][!UpdateMeter icon][!Redraw][!Delay 20][!UpdateMeter shadow][!UpdateMeter glow][!Redraw]
;MouseLeaveAction=[!HideMeter text][!DisableMeasure measureINCREASE][!EnableMeasure measureDECREASE][!SetOption button X "5"][!SetOption button Y "5"][!SetOption button W "[#w_[&measureSTYLE]]"][!UpdateMeter button][!UpdateMeter animation][!UpdateMeter icon][!Redraw][!Delay 20][!UpdateMeter shadow][!UpdateMeter glow][!Redraw]
;LeftMouseUpAction=["[#path[&measureNUMBER]]"][!EnableMeasure measureINCREASE][!DisableMeasure measureDECREASE][!SetOption animation ImageTint "#c_animation2#"][!ShowMeter glow][!HideMeter shadow][!UpdateMeter animation][!UpdateMeter glow][!UpdateMeter shadow][!Redraw]
;ImageName=bubble.png

;=============================================
;	^	^	^	^
;	ORIGINAL STYLEBUTTON'S MOUSE ACTIONS
;
;=============================================





;=============================================
;
;	MOUSE OVER ACTION - TESTING 
;	V	V	V	V
;=============================================

;-----------------------------------------------
;	THESE ARE CURRENTLY IN USE AND ACTIVE
;	v	v	v	v


MouseOverAction=[!CommandMeasure MeasureSlider "Execute 1"][!ShowMeter "MeterButterflies"][!Redraw][!ShowMeter text][!EnableMeasure measureINCREASE][!DisableMeasure measureDECREASE][!SetOption button X "3"][!SetOption button Y "3"][!SetOption button W "([#w_[&measureSTYLE]]+6)"][Play "#@#select.wav"][!UpdateMeter button][!UpdateMeter animation][!UpdateMeter icon][!Redraw][!Delay 20][!UpdateMeter shadow][!UpdateMeter glow][!Redraw]
MouseLeaveAction=[!HideMeter text][!DisableMeasure measureINCREASE][!EnableMeasure measureDECREASE][!SetOption button X "5"][!SetOption button Y "5"][!SetOption button W "[#w_[&measureSTYLE]]"][!UpdateMeter button][!UpdateMeter animation][!UpdateMeter icon][!Redraw][!Delay 20][!UpdateMeter shadow][!UpdateMeter glow][!Redraw]
LeftMouseUpAction=["[#path[&measureNUMBER]]"][!EnableMeasure measureINCREASE][!DisableMeasure measureDECREASE][!SetOption animation ImageTint "#c_animation2#"][!ShowMeter glow][!HideMeter shadow][!UpdateMeter animation][!UpdateMeter glow][!UpdateMeter shadow][!Redraw]


;	^	^	^	^
;	THESE ARE CURRENTLY IN USE AND ACTIVE
;-----------------------------------------------



;-----------------------------------------------
;=============================================
;	^	^	^	^
;	MOUSE OVER ACTION - TESTING
;
;=============================================

ImageName=bubble.png
ImagePath=#@#
PreserveAspectRatio=1
SolidColor=#c_trigger#
W=[#w_[&measureSTYLE]]
X=5
Y=5


;=============================================

;	^	^	^	^
;
;		STYELBUTTON SECTION 	STYELBUTTON SECTION 	STYELBUTTON SECTION 	STYELBUTTON SECTION 
;
;=======================================================================================================================================
;=======================================================================================================================================
;=======================================================================================================================================
;	




[styleTEXT]
AntiAlias=1
DynamicVariables=1
FontColor=#f_color#
FontFace=#f_face#
FontSize=#f_size#
Hidden=1
StringAlign=LeftCenter
Text=[#text[&measureNUMBER]]
X=([button:X]+[button:W]+15)
Y=(([#w_[&measureSTYLE]]/2)+5)


[styleANIMATION]
AntiAlias=1
DynamicVariables=1
GreyScale=1
ImageName=frame ([measureSUM]).png
ImagePath=#@#Frames\
ImageTint=#c_animation1#
PreserveAspectRatio=1
UpdateDivider=1
W=([button:W])
X=([button:X]+1)
Y=([button:Y]+1)

[styleICON]
AntiAlias=1
DynamicVariables=1
ImageName=icon[measureNUMBER].png
ImagePath=#@#Icons\
PreserveAspectRatio=1
SolidColor=#c_trigger#
W=([button:W]-34)
X=([button:X]+(([button:W]-([button:W]-34))/2))
Y=([button:Y]+(([button:W]-([button:W]-34))/2))

variables.ini

Code: Select all

;=============================
;
;	GREEN BUBBLE
;
;=============================


[Variables]


;=======================================
;
; from ACTIONTIMER BUTTERFLY START
;	V	V	V	V
;=======================================

Frame=0
Speed=50
U=[!UpdateMeasure "MeasureSlider"][!UpdateMeasure "MeasureEnd"][!UpdateMeter "MeterButterflies"][!UpdateMeter "MeterFrame"][!Redraw]

;=======================================
;	^	^	^	^
; from ACTIONTIMER BUTTERFLY END
;
;=======================================






;============FONT COLOR=============
;original color
f_color=255,255,255
f_size=12
f_face=Segoe UI
c_trigger=0,0,0,1 
; ----- c_trigger is an aesthetic property for mouseover hover
; ----- transparency (c_trigger is barely visible)

;========SHADOW COLOR===============

;shadow color
c_shadow=0,0,0,150

;==========ANIMATION COLOR==============
;ORIGINAL colors for animation types
;c_animation1=50,50,255
;c_animation2=255,50,50

; c1 = clockwise animation
; c2 = counterclockwise animation
; c1 = blue + c2 = yellow == GREEN SPHERE

;TEST color for animation types 
c_animation1=255,255,255,255
c_animation2=255,255,255,255 (SPHERE COLOR)


;============ANIMATION FRAMES=============
;	max number of frames for animation
max_frames=60
;	frequency of animation (x frames per second); default is 20, highest is ~50
frequency=40


;change these if desired; can add more if desired
w_1=74
w_2=70
w_3=66
w_4=62
w_5=58

w_6=44
w_7=50
w_8=35
w_9=40
w_10=42
;----------
;change these
text1=Chrome
text2=Chrome
text3=Chrome
text4=Chrome
text5=Chrome

path1="chrome.exe"
path2="chrome.exe"
path3="chrome.exe"
path4="chrome.exe"
path5="chrome.exe"

process1=chrome.exe
process2=chrome.exe
process3=chrome.exe
process4=chrome.exe
process5=chrome.exe

style1.ini

Code: Select all

;=============================
;
;	GREEN BUBBLE
;
;=============================



[Rainmeter]
Update=(1000/#frequency#)
DefaultUpdateDivider=(1000/(1000/#frequency#))
DynamicWindowSize=1

@Include=#@#variables.ini
@Include2=#@#template.ini


;=======================================
;
; from ACTIONTIMER BUTTERFLY START
;
;=======================================

BackgroundMode=2
SolidColor=0,0,0,1
;OnRefreshAction=[!CommandMeasure MeasureSlider "Stop 1"][!SetVariable Frame "0"][!UpdateMeasure "MeasureSlider"][!UpdateMeasure "MeasureEnd"][!HideMeter "MeterButterflies"][!Redraw][!CommandMeasure MeasureSlider "Execute 1"][!ShowMeter "MeterButterflies"][!Redraw]
OnRefreshAction=[!CommandMeasure MeasureSlider "Stop 1"][!SetVariable Frame "0"][!UpdateMeasure "MeasureSlider"][!UpdateMeasure "MeasureEnd"][!HideMeter "MeterButterflies"][!CommandMeasure MeasureSlider "Execute 1"][!ShowMeter "MeterButterflies"][!Redraw]


;=======================================
;
; from ACTIONTIMER BUTTERFLY START
;
;=======================================

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

[shadow]
Meter=Image
MeterStyle=styleSHADOW

[glow]
Meter=Image
MeterStyle=styleGLOW

[button]
Meter=Image
MeterStyle=styleBUTTON

[text]
Meter=String
MeterStyle=styleTEXT

[animation]
Meter=Image
MeterStyle=styleANIMATION

[icon]
Meter=Image
MeterStyle=styleICON
You do not have the required permissions to view the files attached to this post.
User avatar
Yincognito
Rainmeter Sage
Posts: 7119
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: HELP: ActionTimer. Is it possible to STOP the completion of the ActionList1 on a second mouseover action?

Post by Yincognito »

strawberryshortcake wrote: October 11th, 2020, 3:53 am HELP: ActionTimer. Is it possible to STOP the completion of an active ActionList1 on a second mouseover action .... so a second ActionList1 can be triggered by the second mouseover action without throwing an error?
I'm on mobile now so can't elaborate this more, but generally, yes, it's possible. All you need to do, assuming very simple code, is something like this in your triggering meter:

Code: Select all

MouseOverAction=[!CommandMeasure ActionTimerMeasure "Stop 1"][!CommandMeasure ActionTimerMeasure "Execute 1"]
Obviously, if your process involves other things besides triggering ActionTimer, you need to simulate stopping them as well, e.g. a !HideMeter before using !ShowMeter again, that kind of stuff.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
balala
Rainmeter Sage
Posts: 16142
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: HELP: ActionTimer. Is it possible to STOP the completion of the ActionList1 on a second mouseover action?

Post by balala »

strawberryshortcake wrote: October 11th, 2020, 3:53 am HELP: ActionTimer. Is it possible to STOP the completion of an active ActionList1 on a second mouseover action .... so a second ActionList1 can be triggered by the second mouseover action without throwing an error?


I know the literature on this site says you can't -- all ActionList must run its course first before another action can take place. My question is ... is there a work around to what I want to do other than than decreasing the number of animation frames to a low amount.
I doubt anywhere Rainmeter's "literature" would say something like this, because it's not true. An ActionList can be stopped with a Stop N parameter used into a !CommandMeasure bang. For instance a [!CommandMeasure "ActionTimerMeasure" "Stop N"] stops the running of the ActionListN action list.
For instance here is the following code:

Code: Select all

[Rainmeter]
Update=1000
DynamicWindowSize=1

[Variables]
MyVar=0
Action=0
U=[!UpdateMeasure "MeasureSlide"][!UpdateMeter "MeterData""][!Redraw]

[MeasureSlide]
Measure=Plugin
Plugin=ActionTimer
Group=Sliders
ActionList1=Repeat MyList1,100,10000
MyList1=[!SetVariable MyVar "(#MyVar#+1)"]#U#
ActionList2=Repeat MyList2,100,10000
MyList2=[!SetVariable MyVar "(#MyVar#-1)"]#U#
DynamicVariables=1

[MeasureAction]
Measure=Calc
Formula=#Action#
IfCondition=(#CURRENTSECTION#=0)
IfTrueAction=[!CommandMeasure "MeasureSlide" "Stop 1"][!CommandMeasure "MeasureSlide" "Stop 2"]
IfCondition2=(#CURRENTSECTION#=1)
IfTrueAction2=[!CommandMeasure "MeasureSlide" "Execute 1"][!CommandMeasure "MeasureSlide" "Stop 2"]
IfCondition3=(#CURRENTSECTION#=2)
IfTrueAction3=[!CommandMeasure "MeasureSlide" "Stop 1"][!CommandMeasure "MeasureSlide" "Execute 2"]
DynamicVariables=1

[MeterData]
Meter=STRING
X=0
Y=0
Padding=15,5,15,5
FontColor=220,220,220
FontEffectColor=0,0,0
StringEffect=Shadow
SolidColor=0,0,0,150
FontSize=12
FontFace=Segoe UI
StringStyle=BOLD
StringAlign=LEFT
AntiAlias=1
DynamicVariables=1
Text=My variable:#CRLF##MyVar##CRLF##Action#
MouseOverAction=[!SetVariable Action "((#Action#+1)%3)"][!UpdateMeasure "MeasureAction"][!UpdateMeter "MeterData"][!Redraw]
When you're hovering your mouse over the skin for the first time, the variable gets start increasing. On second hovering, it gets start decreasing, while on third hovering, it stops. In first two case an action list is started and the other stoped, while in third case both are stoped.
The above behavior is achieved with a variable (I named it Action), which is increased by one, each time the mouse is placed over the skin (meter). On third hovering, the variable is "reset" to 0 (see the first !SetVariable bang of the MouseOverAction option of the [MeterData] meter).
User avatar
strawberryshortcake
Posts: 79
Joined: August 27th, 2016, 12:49 am

Re: HELP: ActionTimer. Is it possible to STOP the completion of the ActionList1 on a second mouseover action?

Post by strawberryshortcake »

Yincognito wrote: October 11th, 2020, 9:50 am I'm on mobile now so can't elaborate this more, but generally, yes, it's possible. All you need to do, assuming very simple code, is something like this in your triggering meter:

Code: Select all

MouseOverAction=[!CommandMeasure ActionTimerMeasure "Stop 1"][!CommandMeasure ActionTimerMeasure "Execute 1"]
Obviously, if your process involves other things besides triggering ActionTimer, you need to simulate stopping them as well, e.g. a !HideMeter before using !ShowMeter again, that kind of stuff.
Super. I think that may have solved the issue.

I'll have to look at balala's post a little bit further in depth after this post. I think it may have worked using the Stop 1 measure before the execute 1 as you suggested. Just wanted to get this out first. Don't know how 'syntax efficient' my code is though.

The other issue that I've encountered is that my raindrop animation is getting cut off on the left side of the screen. The bubble itself is already positioned at x=0,y=0, but because the creator used some complicated W,X,Y, Button:X,, Button:Y, (ButtonY/2), etc etc type of mathmatically formula, I'm going to have to either resize my raindrop animation or figure out how to fiddle with those W, X, Y values.

MouseOverAction=[!CommandMeasure MeasureSlider "Stop 1"][!CommandMeasure MeasureSlider "Execute 1"][!ShowMeter "MeterButterflies"][!Redraw]

Code: Select all

MouseOverAction=[!CommandMeasure MeasureSlider "Stop 1"][!CommandMeasure MeasureSlider "Execute 1"][!ShowMeter "MeterButterflies"][!Redraw][!ShowMeter text][!EnableMeasure measureINCREASE][!DisableMeasure measureDECREASE][!SetOption button X "3"][!SetOption button Y "3"][!SetOption button W "([#w_[&measureSTYLE]]+6)"][Play "#@#select.wav"][!UpdateMeter button][!UpdateMeter animation][!UpdateMeter icon][!Redraw][!Delay 20][!UpdateMeter shadow][!UpdateMeter glow][!Redraw]
MouseLeaveAction=[!HideMeter text][!DisableMeasure measureINCREASE][!EnableMeasure measureDECREASE][!SetOption button X "5"][!SetOption button Y "5"][!SetOption button W "[#w_[&measureSTYLE]]"][!UpdateMeter button][!UpdateMeter animation][!UpdateMeter icon][!Redraw][!Delay 20][!UpdateMeter shadow][!UpdateMeter glow][!Redraw]
LeftMouseUpAction=["[#path[&measureNUMBER]]"][!EnableMeasure measureINCREASE][!DisableMeasure measureDECREASE][!SetOption animation ImageTint "#c_animation2#"][!ShowMeter glow][!HideMeter shadow][!UpdateMeter animation][!UpdateMeter glow][!UpdateMeter shadow][!Redraw]
User avatar
strawberryshortcake
Posts: 79
Joined: August 27th, 2016, 12:49 am

Re: HELP: ActionTimer. Is it possible to STOP the completion of the ActionList1 on a second mouseover action?

Post by strawberryshortcake »

balala wrote: October 11th, 2020, 11:52 am

I doubt anywhere Rainmeter's "literature" would say something like this, because it's not true. An ActionList can be stopped with a Stop N parameter used into a !CommandMeasure bang. For instance a [!CommandMeasure "ActionTimerMeasure" "Stop N"] stops the running of the ActionListN action list.
For instance here is the following code:

Code: Select all

[Rainmeter]
Update=1000
DynamicWindowSize=1

[Variables]
MyVar=0
Action=0
U=[!UpdateMeasure "MeasureSlide"][!UpdateMeter "MeterData""][!Redraw]

[MeasureSlide]
Measure=Plugin
Plugin=ActionTimer
Group=Sliders
ActionList1=Repeat MyList1,100,10000
MyList1=[!SetVariable MyVar "(#MyVar#+1)"]#U#
ActionList2=Repeat MyList2,100,10000
MyList2=[!SetVariable MyVar "(#MyVar#-1)"]#U#
DynamicVariables=1

[MeasureAction]
Measure=Calc
Formula=#Action#
IfCondition=(#CURRENTSECTION#=0)
IfTrueAction=[!CommandMeasure "MeasureSlide" "Stop 1"][!CommandMeasure "MeasureSlide" "Stop 2"]
IfCondition2=(#CURRENTSECTION#=1)
IfTrueAction2=[!CommandMeasure "MeasureSlide" "Execute 1"][!CommandMeasure "MeasureSlide" "Stop 2"]
IfCondition3=(#CURRENTSECTION#=2)
IfTrueAction3=[!CommandMeasure "MeasureSlide" "Stop 1"][!CommandMeasure "MeasureSlide" "Execute 2"]
DynamicVariables=1

[MeterData]
Meter=STRING
X=0
Y=0
Padding=15,5,15,5
FontColor=220,220,220
FontEffectColor=0,0,0
StringEffect=Shadow
SolidColor=0,0,0,150
FontSize=12
FontFace=Segoe UI
StringStyle=BOLD
StringAlign=LEFT
AntiAlias=1
DynamicVariables=1
Text=My variable:#CRLF##MyVar##CRLF##Action#
MouseOverAction=[!SetVariable Action "((#Action#+1)%3)"][!UpdateMeasure "MeasureAction"][!UpdateMeter "MeterData"][!Redraw]
When you're hovering your mouse over the skin for the first time, the variable gets start increasing. On second hovering, it gets start decreasing, while on third hovering, it stops. In first two case an action list is started and the other stoped, while in third case both are stoped.
The above behavior is achieved with a variable (I named it Action), which is increased by one, each time the mouse is placed over the skin (meter). On third hovering, the variable is "reset" to 0 (see the first !SetVariable bang of the MouseOverAction option of the [MeterData] meter).
I'll have to dive deeper into the code later on when I get a chance, but firstly wanted to address your immediate point -- and you're absolutely right about being able to stop an ActionList.

What caused me to think it was not possible was because of the following. I'm not sure what the purpose of having an ignore warning embedded in the code would be if it doesn't really prevent any issues (i.e. rainmeter locking up if actiontimer is looped forever).

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

Any ActionListN must completely finish all actions in the list before it can be executed again. Any command to execute the list while it is still performing actions will be ignored, and a warning message will be generated in the log. There may be occasions where this is in fact desired behavior, and the log error messages can be suppressed.

0 - Warnings in the log are produced. (default)
1 - Warnings in the log are suppressed.
==============================================================

I completely overlooked what came next, which was the following. Didn't even see the following until now (now it makes sense):


==============================================================
https://docs.rainmeter.net/manual/plugins/actiontimer/
Stop ActionList number
Stop the correspondingly numbered ActionListN.

As noted above, Any ActionListN must completely finish all actions in the list before it can be executed again. Any command to execute the list while it is still performing actions will be ignored, and a warning message will be generated in the log.

The Stop N command will immediately terminate and reset the corresponding running ActionListN, so it may be executed again.

Example:

LeftMouseUpAction=[!CommandMeasure SomeMeasure "Stop 1"][!CommandMeasure SomeMeasure "Execute 1"]

==============================================================
User avatar
strawberryshortcake
Posts: 79
Joined: August 27th, 2016, 12:49 am

Re: HELP: ActionTimer. Is it possible to STOP the completion of the ActionList1 on a second mouseover action?

Post by strawberryshortcake »

One quick thing ... can someone explain what the the word Repeat means in the following. 100 is the number of frames in the animation. But if I were to ever only want this actiontimer sequence to execute only one time, why the word Repeat. I tried replacing the word repeat with something made up, but nothing happens (the code didn't run). When I was reading the literature, the explanation used the words "Do something".

Code: Select all

[MeasureSlider]
Measure=Plugin
Plugin=ActionTimer
ActionList1=Repeat One,#Speed#,100
One=[!SetVariable Frame "(#Frame#+1)"]#U#
DynamicVariables=1

Code: Select all

[Rainmeter]
Update=1000
BackgroundMode=2
SolidColor=0,0,0,1
DynamicWindowSize=1
OnRefreshAction=[!CommandMeasure MeasureSlider "Execute 1"][!ShowMeter "MeterButterflies"][!Redraw]

[Variables]
Frame=0
Speed=50
U=[!UpdateMeasure "MeasureSlider"][!UpdateMeasure "MeasureEnd"][!UpdateMeter "MeterButterflies"][!UpdateMeter "MeterFrame"][!Redraw]

[Timer]
Measure=Calc
Formula=Timer
IfCondition=Timer
IfTrueAction=[!CommandMeasure MeasureSlider "Execute 1"][!ShowMeter "MeterButterflies"][!Redraw]

;[Timer]
;Measure=Calc
;Formula=( Timer + 1 )
;IfCondition=((Timer=30)||(Timer=120)||(Timer=150))
;IfTrueAction=[!CommandMeasure MeasureSlider "Execute 1"][!ShowMeter "MeterButterflies"][!Redraw]



[MeasureSlider]
Measure=Plugin
Plugin=ActionTimer
ActionList1=Repeat One,#Speed#,100
One=[!SetVariable Frame "(#Frame#+1)"]#U#
DynamicVariables=1


[MeasureEnd]
Measure=Calc
Formula=#Frame#
IfCondition=(MeasureEnd=50)
IfTrueAction=[!CommandMeasure MeasureSlider "Stop 1"][!SetVariable Frame "0"][!UpdateMeasure "MeasureSlider"][!UpdateMeasure "MeasureEnd"][!HideMeter "MeterButterflies"][!Redraw]
DynamicVariables=1
UpdateDivider=-1


[MeterButterflies]
Meter=Image
ImageName=#@#tmp-#Frame#.png
X=100
Y=100
DynamicVariables=1

[MeterFrame]
Meter=STRING
MEasureName=Timer
X=0
Y=0
Padding=15,5,15,5
FontColor=220,220,220
SolidColor=0,0,0,150
FontSize=8
FontFace=Segoe UI
StringStyle=BOLD
StringAlign=LEFT
AntiAlias=1
Text=%1#CRLF##Frame#
DynamicVariables=1
Hidden=1
User avatar
Yincognito
Rainmeter Sage
Posts: 7119
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: HELP: ActionTimer. Is it possible to STOP the completion of the ActionList1 on a second mouseover action?

Post by Yincognito »

strawberryshortcake wrote: October 11th, 2020, 12:05 pmSuper. I think that may have solved the issue.
Nice. :great:


strawberryshortcake wrote: October 11th, 2020, 12:05 pm I'll have to look at balala's post a little bit further in depth after this post. I think it may have worked using the Stop 1 measure before the execute 1 as you suggested. Just wanted to get this out first. Don't know how 'syntax efficient' my code is though.

The other issue that I've encountered is that my raindrop animation is getting cut off on the left side of the screen. The bubble itself is already positioned at x=0,y=0, but because the creator used some complicated W,X,Y, Button:X,, Button:Y, (ButtonY/2), etc etc type of mathmatically formula, I'm going to have to either resize my raindrop animation or figure out how to fiddle with those W, X, Y values.
Well, if you think balala's formulas are complicated, then you didn't see mine, LOL. Joking aside, a bit of math is necessary to make something happening or be a certain way without having to run through a TON of extra steps otherwise. It's true that deconstructing or "reverse engineering" a formula can be a bit difficult if it's longer and one isn't its author, but that's a small price to pay for its usefulness.

That being said, the animation works fine for me (1366x768 resolution) without being cut off on the left side of the screen. Maybe balala can provide some answers on that, but just for reference: are you using this on a single monitor or on multiple monitors?
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
strawberryshortcake
Posts: 79
Joined: August 27th, 2016, 12:49 am

Re: HELP: ActionTimer. Is it possible to STOP the completion of the ActionList1 on a second mouseover action?

Post by strawberryshortcake »

Yincognito wrote: October 11th, 2020, 12:50 pm Nice. :great:





Well, if you think balala's formulas are complicated, then you didn't see mine, LOL. Joking aside, a bit of math is necessary to make something happening or be a certain way without having to run through a TON of extra steps otherwise. It's true that deconstructing or "reverse engineering" a formula can be a bit difficult if it's longer and one isn't its author, but that's a small price to pay for its usefulness.

That being said, the animation works fine for me (1366x768 resolution) without being cut off on the left side of the screen. Maybe balala can provide some answers on that, but just for reference: are you using this on a single monitor or on multiple monitors?
If you look at the puddle of water (especially if you create a black background), a sliver of the puddle on the left is cut off. The OCD in me is on a mission to fix it either scaling down the raindrop with gimp or figuring out how to mathematically scoot the Bubble away from the left screen a bit.

I meant the liquid bubble mathematics.

Code: Select all

W=([button:W]-34)
X=([button:X]+(([button:W]-([button:W]-34))/2))
Y=([button:Y]+(([button:W]-([button:W]-34))/2))

W=([button:W])
X=([button:X]+1)
Y=([button:Y]+1)

W=([button:W]+6)
X=([button:X]+5)
Y=([button:Y]+5)

W=[#w_[&measureSTYLE]]
X=5
Y=5

X=([button:X]+[button:W]+15)
Y=(([#w_[&measureSTYLE]]/2)+5)
etc. there's a few other in the code that just looks different than usual.


Code: Select all

[measureSTYLE]
Measure=String
String=#CURRENTFILE#
Substitute=".ini":"","Style ":""
UpdateDivider=-1

[measureNUMBER]
Measure=String
String=#CURRENTCONFIG#
Substitute="LiquidBubbles\":"","Bubble ":""
UpdateDivider=-1

[measurePROCESS]
Measure=Plugin
Plugin=Process
ProcessName=[#process[&measureSTYLE]]
IfBelowValue=1
IfBelowAction=[!SetOption animation ImageTint "#c_animation1#"][!HideMeter glow][!ShowMeter shadow]
IfAboveValue=0
IfAboveAction=[!SetOption animation ImageTint "#c_animation2#"][!ShowMeter glow][!HideMeter shadow]
UpdateDivider=10

[measureINCREASE]
Measure=Calc
Formula=measureINCREASE + (measureINCREASE < #max_frames#)
IfEqualValue=#max_frames#
IfEqualAction=[!DisableMeasure measureINCREASE]
Disabled=1
UpdateDivider=1

[measureDECREASE]
Measure=Calc
Formula=(measureDECREASE + (#max_frames# + 1) - 1) % (#max_frames# + 1)
IfEqualValue=0
IfEqualAction=[!DisableMeasure measureDECREASE]
Disabled=1
UpdateDivider=1

[measureSUM]
Measure=Calc
Formula=measureINCREASE + measureDECREASE
UpdateDivider=1

[styleSHADOW]
DynamicVariables=1
ImageName=shadow.png
ImagePath=#@#
ImageTint=#c_shadow#
PreserveAspectRatio=1
SolidColor=#c_trigger#
W=([button:W]+6)
X=([button:X]+5)
Y=([button:Y]+5)


[styleGLOW]
DynamicVariables=1
Hidden=1
ImageName=glow.png
ImagePath=#@#
ImageTint=#c_animation2#,125
PreserveAspectRatio=1
SolidColor=#c_trigger#
W=([button:W]+10)
;X=0
;Y=0
X=52
Y=0

; ========================= BUTTTON MOVE

[styleBUTTON]
;MouseOverAction=[!ShowMeter text][!EnableMeasure measureINCREASE][!DisableMeasure measureDECREASE][!SetOption button X "3"][!SetOption button Y "3"][!SetOption button W "([#w_[&measureSTYLE]]+6)"][Play "#@#select.wav"][!UpdateMeter button][!UpdateMeter animation][!UpdateMeter icon][!Redraw][!Delay 20][!UpdateMeter shadow][!UpdateMeter glow][!Redraw]
;MouseLeaveAction=[!HideMeter text][!DisableMeasure measureINCREASE][!EnableMeasure measureDECREASE][!SetOption button X "5"][!SetOption button Y "5"][!SetOption button W "[#w_[&measureSTYLE]]"][!UpdateMeter button][!UpdateMeter animation][!UpdateMeter icon][!Redraw][!Delay 20][!UpdateMeter shadow][!UpdateMeter glow][!Redraw]
;LeftMouseUpAction=["[#path[&measureNUMBER]]"][!EnableMeasure measureINCREASE][!DisableMeasure measureDECREASE][!SetOption animation ImageTint "#c_animation2#"][!ShowMeter glow][!HideMeter shadow][!UpdateMeter animation][!UpdateMeter glow][!UpdateMeter shadow][!Redraw]



MouseOverAction=[!ShowMeter text][!EnableMeasure measureINCREASE][!DisableMeasure measureDECREASE][!SetOption button X "3"][!SetOption button Y "3"][!SetOption button W "([#w_[&measureSTYLE]]+6)"][Play "#@#select.wav"][!UpdateMeter button][!UpdateMeter animation][!UpdateMeter icon][!Redraw][!Delay 20][!UpdateMeter shadow][!UpdateMeter glow][!Redraw]
MouseLeaveAction=[!HideMeter text][!DisableMeasure measureINCREASE][!EnableMeasure measureDECREASE][!SetOption button X "5"][!SetOption button Y "5"][!SetOption button W "[#w_[&measureSTYLE]]"][!UpdateMeter button][!UpdateMeter animation][!UpdateMeter icon][!Redraw][!Delay 20][!UpdateMeter shadow][!UpdateMeter glow][!Redraw]
LeftMouseUpAction=["[#path[&measureNUMBER]]"][!EnableMeasure measureINCREASE][!DisableMeasure measureDECREASE][!SetOption animation ImageTint "#c_animation2#"][!ShowMeter glow][!HideMeter shadow][!UpdateMeter animation][!UpdateMeter glow][!UpdateMeter shadow][!Redraw]

ImageName=bubble.png
ImagePath=#@#
PreserveAspectRatio=1
SolidColor=#c_trigger#
;W=[#w_[&measureSTYLE]]
;X=5
;Y=5
X=0
Y=0


[styleTEXT]
AntiAlias=1
DynamicVariables=1
FontColor=#f_color#
FontFace=#f_face#
FontSize=#f_size#
Hidden=1
StringAlign=LeftCenter
Text=[#text[&measureNUMBER]]
;X=([button:X]+[button:W]+15)
;Y=(([#w_[&measureSTYLE]]/2)+5)
X=15
Y=15

[styleANIMATION]
AntiAlias=1
DynamicVariables=1
GreyScale=1
ImageName=frame ([measureSUM]).png
ImagePath=#@#Frames\
ImageTint=#c_animation1#
PreserveAspectRatio=1
UpdateDivider=1
W=([button:W])
X=([button:X]+1)
Y=([button:Y]+1)

[styleICON]
AntiAlias=1
DynamicVariables=1
ImageName=icon[measureNUMBER].png
ImagePath=#@#Icons\
PreserveAspectRatio=1
SolidColor=#c_trigger#
W=([button:W]-34)
X=([button:X]+(([button:W]-([button:W]-34))/2))
Y=([button:Y]+(([button:W]-([button:W]-34))/2))
Last edited by balala on October 11th, 2020, 3:08 pm, edited 1 time in total.
Reason: Please use <code> tags, not <Snippet>, whenever are posting code snippets. It's the </> button.
User avatar
Yincognito
Rainmeter Sage
Posts: 7119
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: HELP: ActionTimer. Is it possible to STOP the completion of the ActionList1 on a second mouseover action?

Post by Yincognito »

strawberryshortcake wrote: October 11th, 2020, 12:33 pm(i.e. rainmeter locking up if actiontimer is looped forever).
Just so you know, ActionTimer will NOT lock up if looped forever. I used to think the same a while ago, and even avoided AT because of that warning and the one regarding overloading the Windows message queue. Nowadays, even though I still prefer animations without using AT because they are generally more light on resources (this might also be a misconception, by the way) and more stable, I know better: as long as one adds a Wait time after the entire action, that action will not lock up (excerpt from the manual):
Ensure that there is at least some "wait" time between actions, so Rainmeter has time to handle other messages in the message queue.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
jsmorley
Developer
Posts: 22629
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: HELP: ActionTimer. Is it possible to STOP the completion of the ActionList1 on a second mouseover action?

Post by jsmorley »

Yincognito wrote: October 11th, 2020, 1:32 pm Just so you know, ActionTimer will NOT lock up if looped forever. I used to think the same a while ago, and even avoided AT because of that warning and the one regarding overloading the Windows message queue. Nowadays, even though I still prefer animations without using AT because they are generally more light on resources (this might also be a misconception, by the way) and more stable, I know better: as long as one adds a Wait time after the entire action, that action will not lock up (excerpt from the manual):
You certainly CAN do endless animations with ActionTimer. You just need to be quite careful that you do it correctly, and since the result can be ugly, we don't recommend it. Nothing forbids it however...

To be honest, I'm not a fan of endless animations in any case. The resource usage is just too high for my tastes, no matter how you do it. Rainmeter is extremely tight and efficient, and for almost all things you do with it, the resource usage really rounds to zero. As soon as you start doing music visualizers, or having effects floating around on your screen, Rainmeter can become a burden on your system that I just don't personally like.