It is currently November 29th, 2023, 10:03 pm

Timing

Get help with creating, editing & fixing problems with skins
User avatar
tass_co
Posts: 499
Joined: May 4th, 2020, 3:01 pm
Location: Ankara, TURKEY

Timing

Post by tass_co »

Hi everyone :welcome:

I have a problem with ActionTimer. I use the ActionTimer plugin to repeat a macro. It doesn't work properly because I can't time it :confused:
I would appreciate it if you could help :bow:

Macro's duration is approximately a little more than 300ms.
Clipboarder.2023.09.09.png

Code: Select all

[MeaAgain]
Measure=Plugin
Plugin=ActionTimer
ActionList1=Repeat OkTorrent,410,#Again#
OkTorrent=["#Path2#\TorrentAccept.mxe"][!Delay 100]
DynamicVariables=1
UpdateDivider=-1

[S03E01]
Meter=BUTTON
x=26
y=178
ButtonImage=#image5#
LeftMouseDownAction=#UU#[!CommandMeasure MeaAgain "Execute 1"]
RightMouseDownAction=#UU#["#Path2#\TorrentAccept.mxe"]
MouseScrollDownAction=[!SetVariable Again "((#Again#)+1)"][!UpdateMeasure MeaAgain]
MouseScrollUpAction=[!SetVariable Again "((#Again#)-1)"][!UpdateMeasure MeaAgain]
X1MouseUpAction=[!SetVariable Again "((#Again#)+5)"][!UpdateMeasure MeaAgain]
X2MouseUpAction=[!SetVariable Again "((#Again#)-5)"][!UpdateMeasure MeaAgain]
MiddleMouseUpAction=[!SetVariable Again "2"]
DynamicVariables=1
Hidden=1
Group=BtnP

You do not have the required permissions to view the files attached to this post.
I don't know where i going from here, but i promise it won't be boring... :great:
User avatar
balala
Rainmeter Sage
Posts: 15814
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Timing

Post by balala »

tass_co wrote: September 9th, 2023, 3:15 pm I have a problem with ActionTimer. I use the ActionTimer plugin to repeat a macro. It doesn't work properly because I can't time it :confused:
I would appreciate it if you could help :bow:
Let's see if I understand correctly what you want.
Do you want to get executed the TorrentAccept.mxe file by #Again# times? If you do, you reversed the order of parameters in the ActionList1 option of the [MeaAgain] measure. The first parameter following the ActionName (in this case OkTorrent) has to be the number of repeats, while the second has to be the wait time between two consecutive execution. You put these parameters in reversed order, so try this: ActionList1=Repeat OkTorrent,#Again#,410 - NOT TO BE TAKEN INTO ACCOUNT.
User avatar
tass_co
Posts: 499
Joined: May 4th, 2020, 3:01 pm
Location: Ankara, TURKEY

Re: Timing

Post by tass_co »

balala wrote: September 9th, 2023, 8:41 pm Let's see if I understand correctly what you want.
Do you want to get executed the TorrentAccept.mxe file by #Again# times? If you do, you reversed the order of parameters in the ActionList1 option of the [MeaAgain] measure. The first parameter following the ActionName (in this case OkTorrent) has to be the number of repeats, while the second has to be the wait time between two consecutive execution. You put these parameters in reversed order, so try this: ActionList1=Repeat OkTorrent,#Again#,410
Yes, you understood correctly. But when I try as you said, unfortunately the computer crashes...

Balala, I'm starting to think that my problem is not related to the code but to the app I am using. Because when the first execution is performed with ActionTimer, there is a delay in the other application (such as freezing). Since this duration is uncertain, 410ms does not equal as and problems occur in the #Again# repetition...

Thank you balala :great:
I don't know where i going from here, but i promise it won't be boring... :great:
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5230
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: Timing

Post by eclectic-tech »

tass_co wrote: September 9th, 2023, 9:46 pm Yes, you understood correctly. But when I try as you said, unfortunately the computer crashes...
Balala is mistaken :o :rosegift:
You had the correct order of elements for the 'Repeat' in the ACTIONLIST
Docs wrote: Repeat Action name, Wait time number, Repeat count number
This will repeat the named Action option Repeat count times, with a wait of Wait time milliseconds between each. Note that Wait time is not applied after the last execution of Action name, only between each.
I think you are on the right track by examining the timing; I would suggest using a longer #Wait# time rather than adding a !Delay bang in the ActionList.

ActionTimer measures are controlled by !CommandMeasure bangs; I don't think you need UpdateDivider=-1 on the measure.
User avatar
balala
Rainmeter Sage
Posts: 15814
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Timing

Post by balala »

eclectic-tech wrote: September 10th, 2023, 3:08 am Balala is mistaken :o :rosegift:
You had the correct order of elements for the 'Repeat' in the ACTIONLIST
Right. My bad, sorry for this stupid mistake.
User avatar
tass_co
Posts: 499
Joined: May 4th, 2020, 3:01 pm
Location: Ankara, TURKEY

Re: Timing

Post by tass_co »

eclectic-tech wrote: September 10th, 2023, 3:08 am Balala is mistaken :o :rosegift:
You had the correct order of elements for the 'Repeat' in the ACTIONLIST


I think you are on the right track by examining the timing; I would suggest using a longer #Wait# time rather than adding a !Delay bang in the ActionList.

ActionTimer measures are controlled by !CommandMeasure bangs; I don't think you need UpdateDivider=-1 on the measure.
Thank you for the suggestion. Instead, I added Delay into the macro recording.

After many trials, I came to the conclusion that 500ms gives the most stable results.

Thanks :great:
I don't know where i going from here, but i promise it won't be boring... :great:
User avatar
tass_co
Posts: 499
Joined: May 4th, 2020, 3:01 pm
Location: Ankara, TURKEY

Re: Timing

Post by tass_co »

eclectic-tech wrote: September 10th, 2023, 3:08 am Balala is mistaken :o :rosegift:
balala wrote: September 10th, 2023, 5:35 am Right. My bad, sorry for this stupid mistake.
At first I didn't understand either.
Then I checked it in Documents and thought there was a mistake.
Then I said, balala must know something :thumbup:
I don't know where i going from here, but i promise it won't be boring... :great:
User avatar
Yincognito
Rainmeter Sage
Posts: 6369
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Timing

Post by Yincognito »

tass_co wrote: September 9th, 2023, 9:46 pmYes, you understood correctly. But when I try as you said, unfortunately the computer crashes...
tass_co wrote: September 10th, 2023, 6:08 amAfter many trials, I came to the conclusion that 500ms gives the most stable results.
This is bound to cause problems anyway, no matter how stable it seems after the latest adjustments. Running something repeatedly is atrocious for the machine. Can't you include this loop in the macro instead (optionally, executing it with parameters like #Again# that you can change from the Rainmeter skin)? That way, only one execution would take place, while still being able to repeat stuff as many times as you want. Not sure what program you use for the macro, but although subjects are unrelated and the example is a bit complex, you can definitely use parameters (and bangs too) in an AutoIt script (see the $CmdLine[...] variables)... :confused:
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
tass_co
Posts: 499
Joined: May 4th, 2020, 3:01 pm
Location: Ankara, TURKEY

Re: Timing

Post by tass_co »

Yincognito wrote: September 10th, 2023, 2:22 pm This is bound to cause problems anyway, no matter how stable it seems after the latest adjustments. Running something repeatedly is atrocious for the machine. Can't you include this loop in the macro instead (optionally, executing it with parameters like #Again# that you can change from the Rainmeter skin)? That way, only one execution would take place, while still being able to repeat stuff as many times as you want. Not sure what program you use for the macro, but although subjects are unrelated and the example is a bit complex, you can definitely use parameters (and bangs too) in an AutoIt script (see the $CmdLine[...] variables)... :confused:
I have 2 computers. Dual-core Celeron 1037U 1.8 GHz. It consumes 30-40 watts of power. I use this computer only for torrent downloading. When I overload it, there are lags/freezes, which is normal for the processor. So it's nothing to do with the Rainmeter app. Becasue when I use the same code on second my PC, I do not encounter any problems etc. (Ryzen 9 5900x)

The name of the Macro application I am using is Macro Express Pro.
Unfortunately, I have no idea how to change the number of repetitions outside the application :oops:

But as you said, maybe it can be done with a different application.

As can be seen, the macro content is simple.
+Activate the qBittorent window
+Move mouse
+Click
+Press Enter

I'll take a look at the AutoIt app :thumbup:
I don't know where i going from here, but i promise it won't be boring... :great:
User avatar
Yincognito
Rainmeter Sage
Posts: 6369
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Timing

Post by Yincognito »

tass_co wrote: September 10th, 2023, 3:54 pm I have 2 computers. Dual-core Celeron 1037U 1.8 GHz. It consumes 30-40 watts of power. I use this computer only for torrent downloading. When I overload it, there are lags/freezes, which is normal for the processor. So it's nothing to do with the Rainmeter app. Becasue when I use the same code on second my PC, I do not encounter any problems etc. (Ryzen 9 5900x)

The name of the Macro application I am using is Macro Express Pro.
Unfortunately, I have no idea how to change the number of repetitions outside the application :oops:

But as you said, maybe it can be done with a different application.

As can be seen, the macro content is simple.
+Activate the qBittorent window
+Move mouse
+Click
+Press Enter

I'll take a look at the AutoIt app :thumbup:
I see. Yeah, it depends on how powerful is the computer and how much stuff runs in the background. All I'm saying is that is much more efficient and light on recources to run a program just once and perform a loop several times per second from inside its macro script, than running that program or the .mxe several times per second to perform a single step in the loop.

I suspected you use a different application than AutoIt or its sister app AutoHotKey (both free, by the way, with the script language roughly similar between the two, bar some syntax differences). As far as I can tell, Macro Express Pro has loops too, see here, the only questions would be how to set the stuff from your one step macro to repeat itself a number of times using those repeat commands, and how to pass that number of times to the main application or the .mxe file. The latter is mostly done via command line parameters in other similar programs, so maybe it would be possible in this case too (e.g. ["#Path2#\TorrentAccept.mxe #Again#"] or something along those lines, and grab the #Again# parameter as a variable in your macro in order to know how many times to repeat a single step in the loop).

One more thing about your script: it will work for your configuration, screen resolution and such, but not necessarily on other systems, since the Mouse Move is relative to screen coordinates. In other words, if it's run on a different resolution, the click might not be performed where you want it to happen. Of course, if you only made this to run on your system and configuration, you normally wouldn't have to worry, but just in case you think about distributing a similar skin / macro, this is something to consider.

Anyway, it's up to you if you want to settle on the way you do things already, or you want to explore other alternatives. ;-)
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth