It is currently November 29th, 2020, 4:48 pm

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

Help with creating, editing & fixing problems with skins
User avatar
Yincognito
Posts: 2933
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 15th, 2020, 12:05 amThat code works great, but I tried to implement the "Execute 1" for when the trashcan is empty so it'll play the raindrop animation once (then disappear) but it didn't work. It didn't even start the raindrop animation when the trash can was empty unfortunately.
Yeah, I know why that happens, actually - will take a look at it tomorrow. It's not that the animation doesn't start, because it does - it's just that it only plays 1 frame (because that's what my scenario looked like), while in your case playing the animation once means playing all 36 frames one time. This is why it appears to not work.

On the other stuff, sorry, but you lost me - and I'm not easy to get lost. :D I think it would be better to not overcomplicate things and just explain in simpler terms what you want to happen, bearing in mind that I don't know (and I'm not particularly interested) in the concept behind the mechanics in your skin, I just need a "I want this, followed by that to happen" type of description, as clearly expressed as possible.

That being said, I'll take another look at your post tomorrow, maybe I'll get the essence of your message better then, and be able to help you with it. ;-)
User avatar
Yincognito
Posts: 2933
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 »

Yincognito wrote: October 15th, 2020, 2:31 am Yeah, I know why that happens, actually - will take a look at it tomorrow. It's not that the animation doesn't start, because it does - it's just that it only plays 1 frame (because that's what my scenario looked like), while in your case playing the animation once means playing all 36 frames one time. This is why it appears to not work.
Couldn't help it but solve this "today":

Code: Select all

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

[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1
BackgroundMode=2
SolidColor=0,0,0,1

---Measures---

[MeasureSlider]
Measure=Plugin
Plugin=ActionTimer
ActionList1=Reset | Wait #Speed# | Repeat Slide,#Speed#,#FrameCount# | Wait #Speed#
ActionList2=Repeat Slide,#Speed#,#FrameCount# | Wait #Speed# | Rerun | Wait #Speed#
Reset=[!SetVariable Frame 0]#U#
Slide=[!SetVariable Frame ((#Frame#+1)%#FrameCount#)]#U#
Rerun=[!CommandMeasure MeasureSlider "Stop 1"][!CommandMeasure MeasureSlider "Stop 2"][!CommandMeasure MeasureSlider "Execute 2"]
UpdateDivider=-1
DynamicVariables=1

---Meters---

[MeterButterflies]
Meter=Image
ImageName=#@#tmp-#Frame#.png
UpdateDivider=-1
LeftMouseUpAction=[!CommandMeasure MeasureSlider "Stop 1"][!CommandMeasure MeasureSlider "Stop 2"][!CommandMeasure MeasureSlider "Execute 2"]
MiddleMouseUpAction=[!CommandMeasure MeasureSlider "Stop 1"][!CommandMeasure MeasureSlider "Stop 2"][!CommandMeasure MeasureSlider "Execute 1"]
RightMouseUpAction=[!CommandMeasure MeasureSlider "Stop 1"][!CommandMeasure MeasureSlider "Stop 2"][!SetVariable Frame 0]#U#
DynamicVariables=1

[MeterFrame]
Hidden=0
Meter=String
X=([MeterButterflies:W]/2)r
FontFace=Segoe UI
FontSize=8
FontWeight=700
StringAlign=Center
FontColor=220,220,220,255
SolidColor=0,0,0,150
AntiAlias=1
Text="Frame#CRLF##Frame#"
UpdateDivider=-1
DynamicVariables=1
As you can see, the difference is mainly that I replaced the single Slide in the two action lists with a Repeat Slide,#Speed#,#FrameCount#, so that a full animation is performed in both cases. That being said, when the animation is arbitrarily stopped, the Frame variable was left unchanged, so if I stopped the animation when Frame was 25 and then start a "one time" animation, that animation would start at 25 and continue until 36 frames after 25 ... which was again 25. I imagined that was not the desired behavior, so I added a [!SetVariable Frame 0]#U# part, to reset the Frame variable to 0. This should be normally used either after the actions have been stopped, between the stop and a subsequent execution, or simply before any execution. Because I didn't know how you prefer it, I left one instance at the end of the action stopping in RightMouseUpAction, but I also included as an action name named Reset in the Action Timer measure itself. Basically, it's up to you to choose how to use the [!SetVariable Frame 0]#U# part:

- if you want to reset the frame to 0 after stop, then add it after stopping the 2nd action, outside the ActionTimer measure
- if you want the "drop" to stay in the air (so to speak) when stopping the animation (e.g. a "pause" effect) and only reset the frame to 0 when starting a subsequent animation, then either add before executes, outside the ActionTimer measure, or keep it as the action named Reset in the ActionTimer measure
- or, you can keep them both as they are, even though it's a bit redundant as it is, since the reset now happens both at the end of stopping the actions and also at the start of a one time animation (though it doesn't affect the functionality in any way)

P.S. You probably noticed that I had to add another mouse action to the mix in the sample, so since the right click up is taken, you'll have to hold the CTRL key to access the skin context menu. In any case, feel free to adapt it and integrate it in your skin as you like.

And yes, executing an action can only be expressed by the [!CommandMeasure SomeMeasure "Execute N"] bangs. Me adding the action list name or action name in the earlier post was just to make it clearer what happened in those bangs, that's all. It was not meant to suggest that there are alternative syntaxes to the bang above.
User avatar
Yincognito
Posts: 2933
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 15th, 2020, 12:05 am 1. First part of the video. Mouseoveraction on the empty trashcan triggers the raindrop animation sequence. It plays one time and stop. This is a good thing but it uses a 'simple animation'. I would rather use an ActionTimer. I tried mouseoveraction=[!CommandMeasure MeasureSlider "Stop 2"][!CommandMeasure MeasureSlider "Stop 1"][!CommandMeasure MeasureSlider "Execute 1"] but it doesn't work.
My previous post should solve this, as now you can not only play the endless animation, but also play a 36 frame "one time" animation (as opposed to just a single frame animation, as the 1st action originally was), both within the ActionTimer measure.
strawberryshortcake wrote: October 15th, 2020, 12:05 am 2. When I placed the 49ers picture into the trashcan, it triggers the three spherical colored lights and continuous raindrop. Rainmeter Update is set to 50 to make number #1 work realistically, but it also causes the three spheres to pauses at certain points. When Update=100, the sphere's move at the constant and correct speed.
[...]
The low update unfortunately causes the three spheres *(blue, green white)" to move with a hitch.EDIT:
One thing I wanted to mentioned was that it would be best if I could get all the animations done with actiontimer instead of using the 'simple animation' (no, they're not really simple, I'm just using that to differentiate between actiontimer animations) because 'simple animations' in skins (that includes other functions rely on [Rainmeter]Update. Standard update=1000, and unfortunately most animations require update=50 or so to make it look realistic.
Yes, you're close. It's not really the fact that update rates are the problem, it's the fact that multiple and separated animations at the same time are not going to be efficient and will probably cause stutter in one or some of the animations. If you have multiple animations happening at the same time (this only appplies to animations involving ActionTimer measures, as "simple animations" based on a fast Rainmeter update rate sort of follow this principle "by default" due to how update cycles and update dividers happen in Rainmeter), it's best to "merge" them into a single animation process, happening more or less at the same wait times. In other words, while it's inefficient to create 2 separate ActionTimer measures, one handling a movement and the other a fade (just an example), it's much more efficient to have both the movement and the fade in a single ActionTimer measure, in effect having, if possible, a single ActionTimer process happening at a certain moment in time.

Bottom line, what this means in your specific case is that you'll probably have to add the 3 spheres animation to the drop animation from your existing ActionTimer measure, once you set it up the way you want to. Don't worry, this isn't as complicated as it looks, it's jut about adding another !SetVariable (or whatever process you use to change values in your spheres animation) to the already existing one which handles the drop animation in the Slide action. This might involve further separating your one time vs your endless animation though, depending on when you want the spheres animation to happen (e.g. at the same time as the one time animation, or at the same time as the endless one).
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 15th, 2020, 4:13 am
Couldn't help it but solve this "today":

Code: Select all

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

[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1
BackgroundMode=2
SolidColor=0,0,0,1

---Measures---

[MeasureSlider]
Measure=Plugin
Plugin=ActionTimer
ActionList1=Reset | Wait #Speed# | Repeat Slide,#Speed#,#FrameCount# | Wait #Speed#
ActionList2=Repeat Slide,#Speed#,#FrameCount# | Wait #Speed# | Rerun | Wait #Speed#
Reset=[!SetVariable Frame 0]#U#
Slide=[!SetVariable Frame ((#Frame#+1)%#FrameCount#)]#U#
Rerun=[!CommandMeasure MeasureSlider "Stop 1"][!CommandMeasure MeasureSlider "Stop 2"][!CommandMeasure MeasureSlider "Execute 2"]
UpdateDivider=-1
DynamicVariables=1

---Meters---

[MeterButterflies]
Meter=Image
ImageName=#@#tmp-#Frame#.png
UpdateDivider=-1
LeftMouseUpAction=[!CommandMeasure MeasureSlider "Stop 1"][!CommandMeasure MeasureSlider "Stop 2"][!CommandMeasure MeasureSlider "Execute 2"]
MiddleMouseUpAction=[!CommandMeasure MeasureSlider "Stop 1"][!CommandMeasure MeasureSlider "Stop 2"][!CommandMeasure MeasureSlider "Execute 1"]
RightMouseUpAction=[!CommandMeasure MeasureSlider "Stop 1"][!CommandMeasure MeasureSlider "Stop 2"][!SetVariable Frame 0]#U#
DynamicVariables=1

[MeterFrame]
Hidden=0
Meter=String
X=([MeterButterflies:W]/2)r
FontFace=Segoe UI
FontSize=8
FontWeight=700
StringAlign=Center
FontColor=220,220,220,255
SolidColor=0,0,0,150
AntiAlias=1
Text="Frame#CRLF##Frame#"
UpdateDivider=-1
DynamicVariables=1
As you can see, the difference is mainly that I replaced the single Slide in the two action lists with a Repeat Slide,#Speed#,#FrameCount#, so that a full animation is performed in both cases. That being said, when the animation is arbitrarily stopped, the Frame variable was left unchanged, so if I stopped the animation when Frame was 25 and then start a "one time" animation, that animation would start at 25 and continue until 36 frames after 25 ... which was again 25. I imagined that was not the desired behavior, so I added a [!SetVariable Frame 0]#U# part, to reset the Frame variable to 0. This should be normally used either after the actions have been stopped, between the stop and a subsequent execution, or simply before any execution. Because I didn't know how you prefer it, I left one instance at the end of the action stopping in RightMouseUpAction, but I also included as an action name named Reset in the Action Timer measure itself. Basically, it's up to you to choose how to use the [!SetVariable Frame 0]#U# part:

- if you want to reset the frame to 0 after stop, then add it after stopping the 2nd action, outside the ActionTimer measure
- if you want the "drop" to stay in the air (so to speak) when stopping the animation (e.g. a "pause" effect) and only reset the frame to 0 when starting a subsequent animation, then either add before executes, outside the ActionTimer measure, or keep it as the action named Reset in the ActionTimer measure
- or, you can keep them both as they are, even though it's a bit redundant as it is, since the reset now happens both at the end of stopping the actions and also at the start of a one time animation (though it doesn't affect the functionality in any way)

P.S. You probably noticed that I had to add another mouse action to the mix in the sample, so since the right click up is taken, you'll have to hold the CTRL key to access the skin context menu. In any case, feel free to adapt it and integrate it in your skin as you like.

And yes, executing an action can only be expressed by the [!CommandMeasure SomeMeasure "Execute N"] bangs. Me adding the action list name or action name in the earlier post was just to make it clearer what happened in those bangs, that's all. It was not meant to suggest that there are alternative syntaxes to the bang above.

Nicely done but with one caveat -- the raindrop stops dripping when the trashcan is full with mouseoveraction-- which is something that I suspected would in fact happen when the following code actually works because Execute2 is turned off with the following code:

Code: Select all

MouseOverAction=[!CommandMeasure MeasureSlider "Stop 2"][!CommandMeasure MeasureSlider "Stop 1"][!CommandMeasure MeasureSlider "Execute 1"]
Is there a way to have a condition where the trashcan is FULL, and something like [!CommandMeasure MouseOver "Stop"] to prevent any effect by a mouseover? Sort of like blocking mouseoveraction? Not exactly blocking, but something that says if the trashcan is still full, when you mouseover the trashcan, let the raindrops continue to run forever. That's probably a better way to do it.

The next strip of code below is already an existing code in the script. When I delete stuff and it goes to the recycling bin (now FULL), the raindrop animation starts and will continue forever. When I empty out the recycling bin (EMPTY), the raindrop animation will play one final sequence and then stop.

If the MeasureCount inside the trashbin is greater than 1, then the raindrop will continue to drip. If the trashbin is empty, then the raindrop sequence will only play once and stop (Execute 1). The problem is trying to associated it with mouseactions, but how?

Code: Select all

[MeasureAction]
;meterunder 6,7,8 represents those rotational spheres (green, white, blue)
;metericonFull represents the image of the Full trashcan. I'm not using it. 
;I'm using the Rainmeter raindrop to rerpresent the trashcan causes it looks cooler.
;MeterButterflies is simply the raindrops. Butterfly skin was where I got one of the initial animation formula.

Measure=Calc
IfCondition=MeasureCount > 0
IfTrueAction=[Play "#@#Water Drip 6.wav"][!ShowMeter MeterButterflies][!CommandMeasure MeasureSlider "Stop 1"][!CommandMeasure MeasureSlider "Stop 2"][!CommandMeasure MeasureSlider "Execute 2"][!RainmeterHideMeter MeterIconEmpty][!RainmeterShowMeter MeterIconFull][!RainmeterShowMeter MeterCount][!ShowMeter MeterUnder6][!ShowMeter MeterUnder7][!ShowMeter MeterUnder8]
IfFalseAction=[Play "#@#Water Drip 6.wav"][!HideMeter MeterUnder6][!HideMeter MeterUnder7][!HideMeter MeterUnder8][!CommandMeasure MeasureSlider "Stop 1"][!CommandMeasure MeasureSlider "Stop 2"][!CommandMeasure MeasureSlider "Execute 1"][!RainmeterHideMeter MeterIconFull][!RainmeterShowMeter MeterIconEmpty][!RainmeterHideMeter MeterCount]

Is it possible to have a conditional mouseaction?
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 15th, 2020, 4:56 am
My previous post should solve this, as now you can not only play the endless animation, but also play a 36 frame "one time" animation (as opposed to just a single frame animation, as the 1st action originally was), both within the ActionTimer measure.


Yes, you're close. It's not really the fact that update rates are the problem, it's the fact that multiple and separated animations at the same time are not going to be efficient and will probably cause stutter in one or some of the animations. If you have multiple animations happening at the same time (this only appplies to animations involving ActionTimer measures, as "simple animations" based on a fast Rainmeter update rate sort of follow this principle "by default" due to how update cycles and update dividers happen in Rainmeter), it's best to "merge" them into a single animation process, happening more or less at the same wait times. In other words, while it's inefficient to create 2 separate ActionTimer measures, one handling a movement and the other a fade (just an example), it's much more efficient to have both the movement and the fade in a single ActionTimer measure, in effect having, if possible, a single ActionTimer process happening at a certain moment in time.

Bottom line, what this means in your specific case is that you'll probably have to add the 3 spheres animation to the drop animation from your existing ActionTimer measure, once you set it up the way you want to. Don't worry, this isn't as complicated as it looks, it's jut about adding another !SetVariable (or whatever process you use to change values in your spheres animation) to the already existing one which handles the drop animation in the Slide action. This might involve further separating your one time vs your endless animation though, depending on when you want the spheres animation to happen (e.g. at the same time as the one time animation, or at the same time as the endless one).

Here's where I got the sphere rotational 'animation' from:
https://www.deviantart.com/misteroiso/art/CenterBubbles-StartOrb-3-3-477377684


In order of importance, getting the raindrop the way I envision is number one. But also learning how to properly use SetVariable (with multiple actiontimer animation would be great as well).

The stutter also happens when the update=100 value deviates in its original skin, which is why I suspected the update value does have some significance.
User avatar
Yincognito
Posts: 2933
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 15th, 2020, 11:12 amIs there a way to have a condition where the trashcan is FULL, and something like [!CommandMeasure MouseOver "Stop"] to prevent any effect by a mouseover? Sort of like blocking mouseoveraction?
Yes, there is. Take a look at mouse action state bangs, there are plenty of variations that you can use to enable, disable or toggle mouse actions on a meter, a group of meters or an entire skin.
strawberryshortcake wrote: October 15th, 2020, 11:12 amIs there a way to have a condition where the trashcan is FULL, and Is it possible to have a conditional mouseaction?
Yes, there is, but you have to approach this differently. Instead of having those AT bangs directly in the mouse actions of a meter, like:

Code: Select all

[SomeMeter]
Meter=...
...
MouseOverAction=...[!CommandMeasure MeasureSlider "Stop 2"][!CommandMeasure MeasureSlider "Stop 1"][!CommandMeasure MeasureSlider "Execute 1"]...
what you can do is move those bangs in the IfTrue / IfFalse Actions of an IfCondition, or in the IfMatch / IfNotMatch Actions of an IfMatch (depending on whether your variable is a number or a string) in a newly created (initially Disabled and having an UpdateDivider of -1) measure, and then in the original meter, trigger the update of the said measure based on the desired mouse action, like:

Code: Select all

[SomeMeasure]
Disabled=1
Measure=...
...
UpdateDivider=-1
IfCondition=(#RecycleBinCount#=0)
IfTrueAction=...[!CommandMeasure MeasureSlider "Stop 2"][!CommandMeasure MeasureSlider "Stop 1"][!CommandMeasure MeasureSlider "Execute 1"]...
IfFalseAction=...[!CommandMeasure MeasureSlider "Stop 2"][!CommandMeasure MeasureSlider "Stop 1"][!CommandMeasure MeasureSlider "Execute 2"]...
IfConditionMode=...
...
...
...
[SomeMeter]
Meter=...
...
MouseOverAction=[!EnableMeasure SomeMeasure][!UpdateMeasure SomeMeasure]...
This is just a schematic - hopefully you'll understand the idea and manage to implement it. If not, I'll try to help you with that, although I'll probably have to find a way to simulate the recycle bin count, as I don't use the bin at all. In the schematic above, the measure is initially disabled so as to not trigger unwanted stuff at skin refresh time (therefore needing to be enabled in the meter's mouse over action; by the way, the enable bang doesn't affect functionality if the measure already enabled), and has the negative update divider so as to update only when instructed to do so, e.g. on demand, and not automatically on each skin update. Obviously, you would fill the ... parts according to your envisioned behavior.

Bottom line, since we couldn't add the needed IfCondition in the meter, we added it in a measure that's updated when the desired action is happening.

P.S. The #RecycleBinCount# variable is self explanatory, and it can be replaced to whatever numerical measure or variable you use to test if the bin is empty or not.
User avatar
Yincognito
Posts: 2933
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 »

Again, couldn't help it, so, based on the above schematic:

Code: Select all

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

[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1
BackgroundMode=2
SolidColor=0,0,0,1

---Measures---

[MeasureBinCount]
Measure=Calc
Formula=(1-MeasureBinCount)
UpdateDivider=-1
IfCondition=(MeasureBinCount=0)
IfTrueAction=[!CommandMeasure MeasureSlider "Stop 1"][!CommandMeasure MeasureSlider "Stop 2"][!SetVariable Frame 0]#U#
IfConditionMode=1

[MeasureChooseSlide]
Disabled=1
Measure=Calc
UpdateDivider=-1
IfCondition=(MeasureBinCount=0)
IfTrueAction=[!CommandMeasure MeasureSlider "Stop 1"][!CommandMeasure MeasureSlider "Stop 2"][!CommandMeasure MeasureSlider "Execute 1"]
IfFalseAction=[!CommandMeasure MeasureSlider "Stop 1"][!CommandMeasure MeasureSlider "Stop 2"][!CommandMeasure MeasureSlider "Execute 2"]
IfConditionMode=1

[MeasureSlider]
Measure=Plugin
Plugin=ActionTimer
ActionList1=Reset | Wait #Speed# | Repeat Slide,#Speed#,#FrameCount# | Wait #Speed#
ActionList2=Repeat Slide,#Speed#,#FrameCount# | Wait #Speed# | Rerun | Wait #Speed#
Reset=[!SetVariable Frame 0]#U#
Slide=[!SetVariable Frame ((#Frame#+1)%#FrameCount#)]#U#
Rerun=[!CommandMeasure MeasureSlider "Stop 1"][!CommandMeasure MeasureSlider "Stop 2"][!CommandMeasure MeasureSlider "Execute 2"]
UpdateDivider=-1
DynamicVariables=1

---Meters---

[MeterBox]
Meter=Shape
Shape=Rectangle 0,0,500,374 | Fill Color 0,0,0,0 | Stroke Color 255,255,255,255 | StrokeWidth 1
UpdateDivider=-1

[MeterButterflies]
Meter=Image
ImageName=#@#tmp-#Frame#.png
UpdateDivider=-1
MouseOverAction=[!EnableMeasure MeasureChooseSlide][!UpdateMeasure MeasureChooseSlide]
LeftMouseUpAction=[!CommandMeasure MeasureSlider "Stop 1"][!CommandMeasure MeasureSlider "Stop 2"][!SetVariable Frame 0]#U#
DynamicVariables=1

[MeterFrame]
Hidden=0
Meter=String
X=([MeterButterflies:W]/2)r
FontFace=Segoe UI
FontSize=8
FontWeight=700
StringAlign=Center
FontColor=220,220,220,255
SolidColor=0,0,0,150
AntiAlias=1
Text="Frame#CRLF##Frame#"
UpdateDivider=-1
DynamicVariables=1

[MeterBinCount]
Hidden=0
Meter=String
X=([MeterButterflies:W]/2+[MeterBinCount:W]/2)r
FontFace=Segoe UI
FontSize=8
FontWeight=700
StringAlign=Center
FontColor=220,220,220,255
SolidColor=0,0,0,150
AntiAlias=1
MeasureName=MeasureBinCount
Text="Count#CRLF#%1"
UpdateDivider=-1
LeftMouseUpAction=[!UpdateMeasure MeasureBinCount][!UpdateMeter MeterBinCount][!Redraw]
DynamicVariables=1
[MeasureBinCount] simulates a recycle bin count (in your code, it would be the actual recycle bin count measure). [MeterBinCount] displays the bin count, for convenience. [MeterBox] draws a rectangle around the frame, so it's easier to see when mouse is over it. All these are not really required in your code, although you should have a measure getting the actual bin count.

[MeasureChooseSlide] is the measure where the so called "conditional mouse action" is happening. It's not an actual mouse action conditional, of course, because the mouse action part is still in [MeterButterflies], which triggers the measure's update on mouse over the meter. For convenience, I left the possibility to stop any animation via a left click on the meter, and I added an optional IfCondition part to [MeasureBinCount] which will stop any animation when the bin "is empty", so to speak, without any kind of mouse action trigger. It's up to you if you want to keep that IfCondition or not. If you keep it, any animation will stop when emptying the bin without needing a mouse over the meter; if you remove it, the animations (both the one time and the endless one) will keep running (until its end, in the case of the one time animation, naturally), until (or requiring, in order to stop) a "new" mouse over happening on the meter, which will run as usual.

Anyway, just load the skin and you'll understand what happens. As always, feel free to adjust it and integrate it into your envisioned environment.

P.S. As you cn see, there was no need to disable mouse actions anywhere in the skin, but of course you'll have to decide whether the behavior is the desired one and there is any additional need for that.
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 »

EDIT: Unfortunately, I messed up the code below completely because I didn't read closely. I still feel stupid though. So I'll redo the code. Even though it 'works' it's not correctly written.


In case anyone is interested in the check box in the video, it's jsmorley's code:
https://forum.rainmeter.net/viewtopic.php?t=20189


Edit: Don't look or use the code because I completely butchered it. I messed it up big time, even though it works.

Yincognito wrote: October 15th, 2020, 4:15 pm Again, couldn't help it, so, based on the above schematic:

Code: Select all

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

[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1
BackgroundMode=2
SolidColor=0,0,0,1

---Measures---

[MeasureBinCount]
Measure=Calc
Formula=(1-MeasureBinCount)
UpdateDivider=-1
IfCondition=(MeasureBinCount=0)
IfTrueAction=[!CommandMeasure MeasureSlider "Stop 1"][!CommandMeasure MeasureSlider "Stop 2"][!SetVariable Frame 0]#U#
IfConditionMode=1

[MeasureChooseSlide]
Disabled=1
Measure=Calc
UpdateDivider=-1
IfCondition=(MeasureBinCount=0)
IfTrueAction=[!CommandMeasure MeasureSlider "Stop 1"][!CommandMeasure MeasureSlider "Stop 2"][!CommandMeasure MeasureSlider "Execute 1"]
IfFalseAction=[!CommandMeasure MeasureSlider "Stop 1"][!CommandMeasure MeasureSlider "Stop 2"][!CommandMeasure MeasureSlider "Execute 2"]
IfConditionMode=1

[MeasureSlider]
Measure=Plugin
Plugin=ActionTimer
ActionList1=Reset | Wait #Speed# | Repeat Slide,#Speed#,#FrameCount# | Wait #Speed#
ActionList2=Repeat Slide,#Speed#,#FrameCount# | Wait #Speed# | Rerun | Wait #Speed#
Reset=[!SetVariable Frame 0]#U#
Slide=[!SetVariable Frame ((#Frame#+1)%#FrameCount#)]#U#
Rerun=[!CommandMeasure MeasureSlider "Stop 1"][!CommandMeasure MeasureSlider "Stop 2"][!CommandMeasure MeasureSlider "Execute 2"]
UpdateDivider=-1
DynamicVariables=1

---Meters---

[MeterBox]
Meter=Shape
Shape=Rectangle 0,0,500,374 | Fill Color 0,0,0,0 | Stroke Color 255,255,255,255 | StrokeWidth 1
UpdateDivider=-1

[MeterButterflies]
Meter=Image
ImageName=#@#tmp-#Frame#.png
UpdateDivider=-1
MouseOverAction=[!EnableMeasure MeasureChooseSlide][!UpdateMeasure MeasureChooseSlide]
LeftMouseUpAction=[!CommandMeasure MeasureSlider "Stop 1"][!CommandMeasure MeasureSlider "Stop 2"][!SetVariable Frame 0]#U#
DynamicVariables=1

[MeterFrame]
Hidden=0
Meter=String
X=([MeterButterflies:W]/2)r
FontFace=Segoe UI
FontSize=8
FontWeight=700
StringAlign=Center
FontColor=220,220,220,255
SolidColor=0,0,0,150
AntiAlias=1
Text="Frame#CRLF##Frame#"
UpdateDivider=-1
DynamicVariables=1

[MeterBinCount]
Hidden=0
Meter=String
X=([MeterButterflies:W]/2+[MeterBinCount:W]/2)r
FontFace=Segoe UI
FontSize=8
FontWeight=700
StringAlign=Center
FontColor=220,220,220,255
SolidColor=0,0,0,150
AntiAlias=1
MeasureName=MeasureBinCount
Text="Count#CRLF#%1"
UpdateDivider=-1
LeftMouseUpAction=[!UpdateMeasure MeasureBinCount][!UpdateMeter MeterBinCount][!Redraw]
DynamicVariables=1
[MeasureBinCount] simulates a recycle bin count (in your code, it would be the actual recycle bin count measure). [MeterBinCount] displays the bin count, for convenience. [MeterBox] draws a rectangle around the frame, so it's easier to see when mouse is over it. All these are not really required in your code, although you should have a measure getting the actual bin count.

[MeasureChooseSlide] is the measure where the so called "conditional mouse action" is happening. It's not an actual mouse action conditional, of course, because the mouse action part is still in [MeterButterflies], which triggers the measure's update on mouse over the meter. For convenience, I left the possibility to stop any animation via a left click on the meter, and I added an optional IfCondition part to [MeasureBinCount] which will stop any animation when the bin "is empty", so to speak, without any kind of mouse action trigger. It's up to you if you want to keep that IfCondition or not. If you keep it, any animation will stop when emptying the bin without needing a mouse over the meter; if you remove it, the animations (both the one time and the endless one) will keep running (until its end, in the case of the one time animation, naturally), until (or requiring, in order to stop) a "new" mouse over happening on the meter, which will run as usual.

Anyway, just load the skin and you'll understand what happens. As always, feel free to adjust it and integrate it into your envisioned environment.

P.S. As you can see, there was no need to disable mouse actions anywhere in the skin, but of course you'll have to decide whether the behavior is the desired one and there is any additional need for that.
You're a super star :Medal

Super! Success! :YESSS: :17good

But I did have to rearrange the code just a small bit. The most important thing that I needed to add to allow the MouseOverAction on an empty trashbin to trigger one animation sequence was [!CommandMeasure MeasureSlider "Stop 1" ][!CommandMeasureSlider "Execute 1"]. Without this, hovering over an empty trashbin unfortunately did not trigger the raindrop animation to run just one time.

I think MeasureChooseSlide was absolute genius, sort of like a conditional mouseaction. When I first read that part of the code, I thought THAT will be the key. Even though it didn't work the way I thought initially because as stated just above, there was no rain drop on a single mouseoveraction on an empty trash bin. But the combination of both ( MeasureChooseSlide ) and the small snippet of code just mentioned made things work, and moving only some parts of the code around (I did have to move the mouseoveraction to my 'trashbin' (Rainmeter green raindrop icon image).

Just FYI but not a big deal (because I'm going to simply hide the meter) is the simulated Count stays always at 1 even when the trashbin is emptied or full with more than one item (7 items, it'll still show as a Count of 1). This doesn't affect the skin functionality at all though.

Code: Select all

---Meters---

[StartButton]
Meter=Button
ButtonImage=StartorbGREEN.png
SolidColor=0,0,0,1
x=15
UpdateDivider=-1

MouseOverAction=[Play "#@#Bubble Water Drip.wav"][!RainmeterShowMeter MeterSize][!CommandMeasure MeasureSlider "Stop1"][!CommandMeasure MeasureSlider "Execute 1"][!Redraw]
MouseLeaveAction=[!RainmeterHideMeter MeterSize][!Redraw]
LeftMouseUpAction=[Play "#@#Bubble Water Drip.wav"][!RainmeterPluginBang "MeasureCount OpenBin"]
RightMouseUpAction=[Play "#@#Bubble Water Drip.wav"][!RainmeterPluginBang "MeasureCount EmptyBin"]
AntiAlias=1
Another thing that I had to adjust was the [Rainmeter]Update=1000 to [Rainmeter]Update=100, then add UpdateDivider=10 and some other places UpdateDivider=-1 to everywhere else because the three colored spheres (green, white, blue) needs the [Rainmeter]Update=100 for smooth rotation movements. I'm not sure if that's the best method though. Is it better to have [Rainmeter]Update=100 and have many UpdateDividers including UpdateDivider=-1 ... or is it better to have [Rainmeter]Update1000, and somehow use actiontimers to speed up the part of the skin that requires it. The sphere's aren't really 'animation', I think they're more mathematical rotational formulas.

Full Code from the video
EDIT: For anyone reading, don't use the code below because even though it works, it's completely wrong.

Code: Select all

[Variables]
Frame=0
FrameCount=48
;-----@@@@Speed=50
Speed=75
U=[!UpdateMeasure MeasureSlider][!UpdateMeter MeterButterflies][!UpdateMeter MeterFrame][!Redraw]




WhiteSphere_X=0
WhiteSphere_Y=0
BlueSphere_X=50
BlueSphere_Y=60
GreenSphere_X=55
GreenSphere_Y=30


[Rainmeter]
Update=100
DynamicWindowSize=1
AccurateText=1
BackgroundMode=2
SolidColor=0,0,0,1

---Measures---

[MeasureBinCount]
Measure=Calc
Formula=(1-MeasureBinCount)
UpdateDivider=-1
IfCondition=(MeasureBinCount=0)
IfTrueAction=[!CommandMeasure MeasureSlider "Stop 1"][!CommandMeasure MeasureSlider "Stop 2"][!SetVariable Frame 0]#U#
IfConditionMode=1

UpdateDivider=10




[MeasureChooseSlide]
Disabled=1
Measure=Calc
UpdateDivider=-1
IfCondition=(MeasureBinCount=0)
IfTrueAction=[Play "#@#Bubble Water Drip.wav"][!CommandMeasure MeasureSlider "Stop 1"][!CommandMeasure MeasureSlider "Stop 2"][!CommandMeasure MeasureSlider "Execute 1"]
IfFalseAction=[Play "#@#Bubble Water Drip.wav"][!CommandMeasure MeasureSlider "Stop 1"][!CommandMeasure MeasureSlider "Stop 2"][!CommandMeasure MeasureSlider "Execute 2"]
IfConditionMode=1

UpdateDivider=10




[MeasureSlider]
Measure=Plugin
Plugin=ActionTimer
ActionList1=Reset | Wait #Speed# | Repeat Slide,#Speed#,#FrameCount# | Wait #Speed#
ActionList2=Repeat Slide,#Speed#,#FrameCount# | Wait #Speed# | Rerun | Wait #Speed#
Reset=[!SetVariable Frame 0]#U#
Slide=[!SetVariable Frame ((#Frame#+1)%#FrameCount#)]#U#
Rerun=[!CommandMeasure MeasureSlider "Stop 1"][!CommandMeasure MeasureSlider "Stop 2"][!CommandMeasure MeasureSlider "Execute 2"]
UpdateDivider=-1
DynamicVariables=1


[MeasureAction]
Measure=Calc
IfCondition=MeasureCount > 0
IfTrueAction=[Play "#@#Water Drip 6.wav"][!ShowMeter MeterButterflies][!CommandMeasure MeasureSlider "Stop 1"][!CommandMeasure MeasureSlider "Stop 2"][!CommandMeasure MeasureSlider "Execute 2"][!HideMeter MeterIconEmpty][!ShowMeter MeterIconFull][!ShowMeter MeterCount][!ShowMeter MeterUnder6][!ShowMeter MeterUnder7][!ShowMeter MeterUnder8]
IfFalseAction=[Play "#@#Water Drip 6.wav"][!HideMeter MeterUnder6][!HideMeter MeterUnder7][!HideMeter MeterUnder8][!CommandMeasure MeasureSlider "Stop 1"][!CommandMeasure MeasureSlider "Stop 2"][!CommandMeasure MeasureSlider "Execute 1"][!HideMeter MeterIconFull][!ShowMeter MeterIconEmpty][!HideMeter MeterCount]

UpdateDivider=10


---Meters---

[StartButton]
Meter=Button
ButtonImage=StartorbGREEN.png
SolidColor=0,0,0,1
x=15
UpdateDivider=-1

MouseOverAction=[Play "#@#Bubble Water Drip.wav"][!RainmeterShowMeter MeterSize][!CommandMeasure MeasureSlider "Stop1"][!CommandMeasure MeasureSlider "Execute 1"][!Redraw]
MouseLeaveAction=[!RainmeterHideMeter MeterSize][!Redraw]
LeftMouseUpAction=[Play "#@#Bubble Water Drip.wav"][!RainmeterPluginBang "MeasureCount OpenBin"]
RightMouseUpAction=[Play "#@#Bubble Water Drip.wav"][!RainmeterPluginBang "MeasureCount EmptyBin"]
AntiAlias=1

UpdateDivider=10



;[MeterBox]
;Meter=Shape
;Shape=Rectangle 0,0,500,374 | Fill Color 0,0,0,0 | Stroke Color 255,255,255,255 | StrokeWidth 1
;UpdateDivider=-1

[MeterButterflies]
Meter=Image
ImageName=#@#tmp-#Frame#.png
UpdateDivider=-1
;--------@@@@ MouseOverAction=[Play "#@#Bubble Water Drip.wav"][!EnableMeasure MeasureChooseSlide][!UpdateMeasure MeasureChooseSlide]
;--------@@@@ LeftMouseUpAction=[Play "#@#Bubble Water Drip.wav"][!CommandMeasure MeasureSlider "Stop 1"][!CommandMeasure MeasureSlider "Stop 2"][!SetVariable Frame 0]#U#
DynamicVariables=1



[MeterFrame]
Hidden=0
Meter=String
X=([MeterButterflies:W]/2)r
FontFace=Segoe UI
FontSize=8
FontWeight=700
StringAlign=Center
FontColor=220,220,220,255
SolidColor=0,0,0,150
AntiAlias=1
Text="Frame#CRLF##Frame#"
UpdateDivider=-1
DynamicVariables=1

[MeterBinCount]
Hidden=0
Meter=String
X=([MeterButterflies:W]/2+[MeterBinCount:W]/2)r
FontFace=Segoe UI
FontSize=8
FontWeight=700
StringAlign=Center
FontColor=220,220,220,255
SolidColor=0,0,0,150
AntiAlias=1
MeasureName=MeasureBinCount
Text="Count#CRLF#%1"
UpdateDivider=-1
;------@@@@@ LeftMouseUpAction=[Play "#@#Bubble Water Drip.wav"][!UpdateMeasure MeasureBinCount][!UpdateMeter MeterBinCount][!Redraw]
DynamicVariables=1





;==============================================
;	DEFAULT JUST A BIN VALUES	START
;==============================================
[MeterIconBackground]
Meter=Image
X=15
Y=27
W=19
H=26
SolidColor=255,255,255,1
UpdateDivider=-1


[MeterIconEmpty]
Meter=Image
X=10
Y=20
W=#IconSize#
ImageName=#IconEmpty#
AntiAlias=1
UpdateDivider=-1


[MeterIconFull]
Meter=Image
X=10
Y=20
W=#IconSize#
UpdateDivider=-1


[MeterSize]
Meter=String
MeasureName=MeasureSize
X=55
Y=0
MeterStyle=Style
Text=%1B
AutoScale=1
NumOfDecimals=1
Hidden=1
UpdateDivider=-1


[MeterCount]
Meter=String
MeasureName=MeasureCount
X=r
Y=(13)r
MeterStyle=Style
Text=%1


;==============================================
;	DEFAULT JUST A BIN VALUES	END
;==============================================

;==============================================
;	TRASH BIN RECYCLE BIN MERGE (FROM JUST A BIN)
;================================


[Variables]
IconSize=32
IconEmpty=#@#Empty.png
IconFull=#@#Full.png
UpdateDivider=-1


[Style]
StringAlign=Right
InlineSetting=Face | Roboto
InlineSetting2=Size | 9
InlineSetting3=Color | 255,255,255,255
AntiAlias=1

[MeasureCount]
Measure=Plugin
Plugin=RecycleManager.dll
RecycleType=Count
Drives=All

[MeasureSize]
Measure=Plugin
Plugin=RecycleManager.dll
RecycleType=Size
Drives=All



;==============================================
;	TRASH BIN RECYCLE BIN MERGE (FROM JUST A BIN)
;================================


;===========================================================
;===========================================================
;===========================================================
;		ROTATIONAL SPHERES SECTION	- START
;===========================================================
;===========================================================
;===========================================================

;=============================================
;
;	ROTATION SPHERE'S GREEN,WHITE,BLUE
;	V	V	V	V
;=============================================

[MeasureTime]
Measure=Calc
Formula=MeasureTime1 * 12
[MeasureTime1]
Measure=Time
AverageSize=10


;=============================================
;/////////////////////////////
;	ROTATIONAL SPHERE #GREEN
;/////////////////////////////
;=============================================


[MeterUnder6]
MeasureName=MeasureTime
Meter=ROTATOR
W=1
H=1
;x=100
;y=70
X=#GreenSphere_X#
Y=#GreenSphere_Y#


;------Point1.png is the image representating the green sphere
ImageName=Point1.png
StartAngle=6.2831853
RotationAngle=6.2831853
ValueReminder=110
OffsetX=67
OffsetY=67


;=============================================
;/////////////////////////////
;	ROTATIONAL SPHERE #WHITE
;/////////////////////////////
;=============================================

[MeterUnder7]
MeasureName=MeasureTime
Meter=ROTATOR
;y=50
W=94
H=94
;x=40
;y=10

X=#WhiteSphere_X#
Y=#WhiteSphere_Y#

;------Point2.png is the image representating the white sphere
ImageName=Point2.png
StartAngle=6.2831853
RotationAngle=-6.2831853
ValueReminder=130
OffsetX=47
OffsetY=47

;OffsetX=97
;OffsetY=97

;=============================================
;/////////////////////////////
;	ROTATIONAL SPHERE #BLUE
;/////////////////////////////
;=============================================

[MeterUnder8]
MeasureName=MeasureTime
Meter=ROTATOR
;x=29
;y=49
;y=100

X=#BlueSphere_X#
Y=#BlueSphere_Y#

W=40
D=50
;x=70
;y=50
;-------Point6.png is the image representating the blue sphere
ImageName=Point6.png
StartAngle=6.2831853
RotationAngle=6.2831853
ValueReminder=130
OffsetX=87
OffsetY=87

;===========================================================
;===========================================================
;===========================================================
		ROTATIONAL SPHERES SECTION	- END
;===========================================================
;===========================================================
;===========================================================




I forgot to include the reason why I had the log tab open, fast mouseoveraction to see if there were any errors --- there isn't.

Code: Select all

[Youtube]https://www.youtube.com/watch?v=3pXDBHAp_Zw[/Youtube]
https://www.youtube.com/watch?v=3pXDBHAp_Zw&feature=youtu.be&ab_channel=strawberryyogurt0
Last edited by strawberryshortcake on October 16th, 2020, 6:33 pm, edited 3 times in total.
User avatar
Yincognito
Posts: 2933
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 »

Nah, you got this absolutely wrong. I told you not to take the code literally, simple copy paste is obviously not going to work, and need pointless additions like the one you mentioned above. You should have replaced MeasureBinCount (and its occurrences in the code) with the measure that actually gets that count, i.e. MeasureCount in your code (taking care to preserve the IfCondition part, obviously adapted to use the new measure name).

Once you do that, things should start working as they should. My simulated bin count measure (i.e. MeasureBinCount) has NOTHING to do with the real state of the bin (from MeasureCount, in your code above), that's the whole meaning of the word "simulated"... duh.

This information is present in my previous replies, but for some reason, you didn't quite get the idea the first time, and just copy pasted one code next to the other, expecting things to magically work.

Again, I DON'T use the recycle bin, so that's why I simulated its state in MeasureBinCount. And yeah, MeasureChooseSlide IS the key in all this, but it will obviously not react as it should if you use a simulated bin count with no real connection to the recycle bin state, instead of the actual recycle bin count...
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 16th, 2020, 12:27 pm Nah, you got this absolutely wrong. I told you not to take the code literally, simple copy paste is obviously not going to work, and need pointless additions like the one you mentioned above. You should have replaced MeasureBinCount (and its occurrences in the code) with the measure that actually gets that count, i.e. MeasureCount in your code (taking care to preserve the IfCondition part, obviously adapted to use the new measure name).

Once you do that, things should start working as they should. My simulated bin count measure (i.e. MeasureBinCount) has NOTHING to do with the real state of the bin (from MeasureCount, in your code above), that's the whole meaning of the word "simulated"... duh.

This information is present in my previous replies, but for some reason, you didn't quite get the idea the first time, and just copy pasted one code next to the other, expecting things to magically work.

Again, I DON'T use the recycle bin, so that's why I simulated its state in MeasureBinCount. And yeah, MeasureChooseSlide IS the key in all this, but it will obviously not react as it should if you use a simulated bin count with no real connection to the recycle bin state, instead of the actual recycle bin count...
:thumbup: I appreciate your help. I'll try to do better next time. I'll redo the steps when I get a chance this week/weekend.

And I have to apologize for being stupid. There's intelligent people, and then unfortunately, there's people like me that will take more effort to hopefully get things right.

Edit: I made an edit in the previous to notating that I messed up the code even though it works. I will need to redo it so it's written correctly.