It is currently October 13th, 2024, 2:13 am

[Suggestion] Execute and Stop All for ActionTimer

Report bugs with the Rainmeter application and suggest features.
User avatar
Yincognito
Rainmeter Sage
Posts: 8442
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

[Suggestion] Execute and Stop All for ActionTimer

Post by Yincognito »

Similar to the InputText syntax, would it be feasible to add a [!CommandMeasure SomeActionTimerMeasure "Execute All"] and/or a [!CommandMeasure SomeActionTimerMeasure "Stop All"] capability to ActionTimer? The order of executing and stopping would be ascending, unless you want to allow descending as well, of course. Executing or stopping intervals of actions like "1-3" or "2-5" wouldn't be a bad idea either.

Anyway, just a thought - feel free to disregard, if you think so, though a quick answer as to why would be nice to have. ;-)
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
Cariboudjan
Posts: 285
Joined: May 12th, 2019, 8:55 am

Re: [Suggestion] Execute and Stop All for ActionTimer

Post by Cariboudjan »

I like it.

Also while we're here - I've noticed that Rainmeter has the potential to crash if a STOP command is issued while it's processing a string of bangs.

As in, let's say this ActionTimer is running, and a STOP is sent at the point shown below:

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

[MeasureSliders]
Measure=Plugin
Plugin=ActionTimer
ActionList1=Repeat SlideOut,#W#,20|Wait 10000|Repeat SlideIn,#W#,20|EndSlideIn
SlideOut=[!SetVariable SlideNot "(Clamp(#SlideNot#+0.05,0,1))"]#U2#
SlideIn=[!SetVariable SlideNot "(Clamp(#SlideNot#-0.05,0,1))"]#U2#
ActionList2=Repeat SlideOut#AlwaysShowSongTitleOFF#,#W#,20|Wait 10000|Repeat SlideIn1,#W#,20|EndSlideIn
SlideOut1=[!SetVariable SlideNot "(Clamp(#SlideNot#+0.05,0,1))"]#U2#
SlideIn1=[!SetVariable SlideNot "(Clamp(#SlideNot#-0.05,0,1))"]#U2#
EndSlideIn=[!SetVariable SlideNot 0]#U2#
ActionList3=Wait #FolderMouseOverTime#|Click#ActiveAll##ButtonSection#
Click1A=[!EnableMouseAction * "LeftMouseDownAction|MouseOverAction" "Droptop\Other\Folders\Folder[#SlotFolder[##HighlightedButton#]]"][!DisableMouseAction * "LeftMouseDownAction|MouseOverAction" "Droptop\Other\Folders\Folder#ActiveFolder#"][!EnableMouseActionGroup "MouseOverAction" Buttons00][!ToggleMouseAction #HighlightedButton# "MouseOverAction"][!WriteKeyValue Variables Folder[#SlotFolder[##HighlightedButton#]]X [#HighlightedButton#:X] "#@#GlobalVar\Control.inc"][!SetVariableGroup CurrentMeter "#HighlightedButton#" "PrimaryConfig"][!SetVariable FolderNum [#HighlightedButton#:X] "Droptop\Other\Folders\Folder[#SlotFolder[##HighlightedButton#]]"][!ActivateConfig "Droptop\Other\Folders\Folder[#SlotFolder[##HighlightedButton#]]" "Folder[#SlotFolder[##HighlightedButton#]].ini"][!Move ([#CURRENTCONFIGX]+[#HighlightedButton#:X]-1) ([#CURRENTCONFIGY]+#TopHeight#+#DropdownMenuYOffset#) "Droptop\Other\Folders\Folder[#SlotFolder[##HighlightedButton#]]"][!Zpos 1 "Droptop\Other\Folders\Folder[#SlotFolder[##HighlightedButton#]]"][!HideGroup [#SlotFolder[##HighlightedButton#]]][!HideGroup Tray][!SetVariable ActiveAll (#ActiveFolder#=[#SlotFolder[##HighlightedButton#]]?0:1)][!SetVariable ActiveFolder (#ActiveFolder#=[#SlotFolder[##HighlightedButton#]]?0:[#SlotFolder[##HighlightedButton#]])][!SetVariable ActiveFolder (#ActiveFolder#=[#SlotFolder[##HighlightedButton#]]?0:[#SlotFolder[##HighlightedButton#]]) "Droptop\Other\BackgroundProcesses"][!SetVariable ActiveTray 0][!SetOption HighlightSelected Hidden STOP (#ActiveFolder#=[#SlotFolder[##HighlightedButton#]]?1:0)][!SetOption #HighlightedButton# FontColor "#*TopBarFontColor1*#,#*TopBarTitleOpacity*#"][!HideMeterGroup Highlight][!CommandMeasure MeasureSliders "Execute 2" "Droptop\Other\PowerMenu"][!HideMeterGroup Triggers "Droptop\DropdownBar\Other\HiddenTrigger#AutohideTopBar#"][!DisableMeasureGroup TriggerXY "Droptop\DropdownBar\Other\HiddenTrigger#AutohideTopBar#"][!DeactivateConfigGroup Tray][!HideGroup ContextBox][!DeactivateConfigGroup ContextBox][!HideMeter HighlightSelected "Droptop\Other\Folders\Folder[#SlotFolder[##HighlightedButton#]]"][!UpdateMeasure MeasureSliders][!UpdateMeasureGroup Count "Droptop\Other\Folders\Folder[#SlotFolder[##HighlightedButton#]]"][!UpdateMeasure CalcFolderNum "Droptop\Other\Folders\Folder[#SlotFolder[##HighlightedButton#]]"][!UpdateMeter *][!Redraw "Droptop\Other\Folders\Folder[#SlotFolder[##HighlightedButton#]]"][!Redraw][!Log "#ErrorMessage#" Notice][!#Toggle# "Droptop\Other\Folders\Folder[#Slot[#HighlightedButton]]"][!#Hide# "Droptop\Other\Folders\Folder#ActiveFolder#"]
Click1B=
DynamicVariables=1
IgnoreWarnings=1
Group=Animation
Disabled=1

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

Maybe have STOP only affect "Wait XXX" or Repeat commands in ActionTimer to prevent this, and have no effect if its a singular action. I see no reason to stop an ActionTimer in the middle of a bang sequence.

By "singular action" I am referring specifically to the part of the action timer below:

ActionList1=Repeat SlideOut,#W#,20|Wait 10000|Repeat SlideIn,#W#,20|EndSlideIn
Last edited by Cariboudjan on March 29th, 2022, 12:33 pm, edited 2 times in total.
User avatar
Yincognito
Rainmeter Sage
Posts: 8442
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: [Suggestion] Execute and Stop All for ActionTimer

Post by Yincognito »

Cariboudjan wrote: March 27th, 2022, 3:12 pm I like it.

Also while we're here - I've noticed that Rainmeter has the potential to crash if a STOP command is issued while it's processing a string of bangs.

As in, let's say this ActionTimer is running, and a STOP is sent at the point shown below:

Code: Select all

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

[MeasureSliders]
Measure=Plugin
Plugin=ActionTimer
ActionList1=Repeat SlideOut,#W#,20|Wait 10000|Repeat SlideIn,#W#,20|EndSlideIn
SlideOut=[!SetVariable SlideNot "(Clamp(#SlideNot#+0.05,0,1))"]#U2#
SlideIn=[!SetVariable SlideNot "(Clamp(#SlideNot#-0.05,0,1))"]#U2#
ActionList2=Repeat SlideOut#AlwaysShowSongTitleOFF#,#W#,20|Wait 10000|Repeat SlideIn1,#W#,20|EndSlideIn
SlideOut1=[!SetVariable SlideNot "(Clamp(#SlideNot#+0.05,0,1))"]#U2#
SlideIn1=[!SetVariable SlideNot "(Clamp(#SlideNot#-0.05,0,1))"]#U2#
EndSlideIn=[!SetVariable SlideNot 0]#U2#
ActionList3=Wait #FolderMouseOverTime#|Click#ActiveAll##ButtonSection#
Click1A=[!EnableMouseAction * "LeftMouseDownAction|MouseOverAction" "Droptop\Other\Folders\Folder[#SlotFolder[##HighlightedButton#]]"][!DisableMouseAction * "LeftMouseDownAction|MouseOverAction" "Droptop\Other\Folders\Folder#ActiveFolder#"][!EnableMouseActionGroup "MouseOverAction" Buttons00][!ToggleMouseAction #HighlightedButton# "MouseOverAction"][!WriteKeyValue Variables Folder[#SlotFolder[##HighlightedButton#]]X [#HighlightedButton#:X] "#@#GlobalVar\Control.inc"][!SetVariableGroup CurrentMeter "#HighlightedButton#" "PrimaryConfig"][!SetVariable FolderNum [#HighlightedButton#:X] "Droptop\Other\Folders\Folder[#SlotFolder[##HighlightedButton#]]"][!ActivateConfig "Droptop\Other\Folders\Folder[#SlotFolder[##HighlightedButton#]]" "Folder[#SlotFolder[##HighlightedButton#]].ini"][!Move ([#CURRENTCONFIGX]+[#HighlightedButton#:X]-1) ([#CURRENTCONFIGY]+#TopHeight#+#DropdownMenuYOffset#) "Droptop\Other\Folders\Folder[#SlotFolder[##HighlightedButton#]]"][!Zpos 1 "Droptop\Other\Folders\Folder[#SlotFolder[##HighlightedButton#]]"][!HideGroup [#SlotFolder[##HighlightedButton#]]][!HideGroup Tray][!SetVariable ActiveAll (#ActiveFolder#=[#SlotFolder[##HighlightedButton#]]?0:1)][!SetVariable ActiveFolder (#ActiveFolder#=[#SlotFolder[##HighlightedButton#]]?0:[#SlotFolder[##HighlightedButton#]])][!SetVariable ActiveFolder (#ActiveFolder#=[#SlotFolder[##HighlightedButton#]]?0:[#SlotFolder[##HighlightedButton#]]) "Droptop\Other\BackgroundProcesses"][!SetVariable ActiveTray 0][!SetOption HighlightSelected Hidden [b][color=#FF0000][size=150]STOP [/size][/color][/b](#ActiveFolder#=[#SlotFolder[##HighlightedButton#]]?1:0)][!SetOption #HighlightedButton# FontColor "#*TopBarFontColor1*#,#*TopBarTitleOpacity*#"][!HideMeterGroup Highlight][!CommandMeasure MeasureSliders "Execute 2" "Droptop\Other\PowerMenu"][!HideMeterGroup Triggers "Droptop\DropdownBar\Other\HiddenTrigger#AutohideTopBar#"][!DisableMeasureGroup TriggerXY "Droptop\DropdownBar\Other\HiddenTrigger#AutohideTopBar#"][!DeactivateConfigGroup Tray][!HideGroup ContextBox][!DeactivateConfigGroup ContextBox][!HideMeter HighlightSelected "Droptop\Other\Folders\Folder[#SlotFolder[##HighlightedButton#]]"][!UpdateMeasure MeasureSliders][!UpdateMeasureGroup Count "Droptop\Other\Folders\Folder[#SlotFolder[##HighlightedButton#]]"][!UpdateMeasure CalcFolderNum "Droptop\Other\Folders\Folder[#SlotFolder[##HighlightedButton#]]"][!UpdateMeter *][!Redraw "Droptop\Other\Folders\Folder[#SlotFolder[##HighlightedButton#]]"][!Redraw][!Log "#ErrorMessage#" Notice][!#Toggle# "Droptop\Other\Folders\Folder[#Slot[#HighlightedButton]]"][!#Hide# "Droptop\Other\Folders\Folder#ActiveFolder#"]
Click1B=
DynamicVariables=1
IgnoreWarnings=1
Group=Animation
Disabled=1

;--------------------------------------------------
Maybe have STOP only affect "Wait XXX" or Repeat commands in ActionTimer to prevent this, and have no effect if its a singular action. I see no reason to stop an ActionTimer in the middle of a bang sequence.

By "singular action" I am referring specifically to the part of the action timer below:

ActionList1=Repeat SlideOut,#W#,20|Wait 10000|Repeat SlideIn,#W#,20|EndSlideIn
I didn't encounter (potential) crashes when using ActionTimer like you, but then, I never had so many - and so time consuming, like !WriteKeyValues, !Redraws or !ActivateConfigs - chain of bangs as an action in the list, so maybe that's the root of the issue there, especially if using that action in a quick succession (not sure if you run it at the end or not). Also, are you sure the STOP you tried to color and enlarge there (and which the edit by balala removed it, since coloring and resizing text don't work in a <code> box, unlike a <snippet> one) isn't self-referencing the same measure and action list, which I believe would be a problem?

I don't know for sure the specifics of ActionTimer's source code, but I suppose it performs the stop at the closest moment of an iteration step as possible (e.g. right after it's repeated for i times and just before it goes to the i+1 iteration). In other words, I see no problem that not all the bangs in the chain would be executed.

It remains to be seen if ActionTimer allows executing more than one action "at a time", which is why I mentioned the ascending order, to avoid concurrent execution (if by any chance that would be unfeasible). In any case, I see no logical reason why stopping all actions wouldn't be possible, the question is only relevant when it comes to executing something like "Execute 1-3".
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth