It is currently April 27th, 2024, 9:43 am

Timing

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

Re: Timing

Post by tass_co »

Yincognito wrote: September 10th, 2023, 8:36 pm 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).
I understand what you mean, but I don't know a macro application that will work with a variable that can intervene from the outside.
It occurred to me to replace the macro file with a lua script. I tried several times but I was not successful. Because I don't know the Lua language very well.

The content of the macro file is below.
If I could replace Count="4" on line 8 in the mxe file below using lua and save it, it wouldn't have to set up an external loop.

Code: Select all

<<Macro Express 4 Playable Macro>>
[string:%T% elements:99 global:TRUE]
[integer:%N% elements:99 global:TRUE]
[float:%D% elements:99 global:TRUE]
[control:%C% elements:99 global:TRUE]
<<BEGIN SCRIPT>>
<WINDOW ACTIVATE Title="qBittorrent" Exact_Match="FALSE" Wildcards="FALSE" _IGNORE="0x0006"/>
<REPEAT START Start="1" Step="1" Count="4" Save="FALSE"/>
<DELAY Flags="\x02" Time="200"/>
<MOUSE MOVE Option="\x01" X="425" Y="508" _PROMPT="0x000A"/>
<DELAY Flags="\x02" Time="20"/>
<MOUSE LEFT CLICK/>
<DELAY Flags="\x02" Time="20"/>
<TEXT TYPE Action="0" Text="<ENTER>"/>
<DELAY Flags="\x02" Time="200"/>
<END REPEAT/>
Thank you
I don't know where i going from here, but i promise it won't be boring... :great:
User avatar
Yincognito
Rainmeter Sage
Posts: 7175
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Timing

Post by Yincognito »

tass_co wrote: September 11th, 2023, 4:44 am I understand what you mean, but I don't know a macro application that will work with a variable that can intervene from the outside.
It occurred to me to replace the macro file with a lua script. I tried several times but I was not successful. Because I don't know the Lua language very well.

The content of the macro file is below.
If I could replace Count="4" on line 8 in the mxe file below using lua and save it, it wouldn't have to set up an external loop.

Code: Select all

<<Macro Express 4 Playable Macro>>
[string:%T% elements:99 global:TRUE]
[integer:%N% elements:99 global:TRUE]
[float:%D% elements:99 global:TRUE]
[control:%C% elements:99 global:TRUE]
<<BEGIN SCRIPT>>
<WINDOW ACTIVATE Title="qBittorrent" Exact_Match="FALSE" Wildcards="FALSE" _IGNORE="0x0006"/>
<REPEAT START Start="1" Step="1" Count="4" Save="FALSE"/>
<DELAY Flags="\x02" Time="200"/>
<MOUSE MOVE Option="\x01" X="425" Y="508" _PROMPT="0x000A"/>
<DELAY Flags="\x02" Time="20"/>
<MOUSE LEFT CLICK/>
<DELAY Flags="\x02" Time="20"/>
<TEXT TYPE Action="0" Text="<ENTER>"/>
<DELAY Flags="\x02" Time="200"/>
<END REPEAT/>
Thank you
You could probably do this with Lua indeed, but why do that when Macro Express already can run a .mxe and pass a value from the command line to that .mxe macro (assuming you do use that variable in your macro as the count, and command ilthe macro to "variable restore all" as described)?
https://www.macros.com/helppro/Index.htm?context=2320
See the /MXE and /V command line parameters. As for the variable restore all command in your macro, you should know more about that than me, after all, you're the one using the program, I just googled this...
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
tass_co
Posts: 518
Joined: May 4th, 2020, 3:01 pm
Location: Ankara, TURKEY

Re: Timing

Post by tass_co »

Yincognito wrote: September 11th, 2023, 11:32 am You could probably do this with Lua indeed, but why do that when Macro Express already can run a .mxe and pass a value from the command line to that .mxe macro (assuming you do use that variable in your macro as the count, and command ilthe macro to "variable restore all" as described)?
https://www.macros.com/helppro/Index.htm?context=2320
See the /MXE and /V command line parameters. As for the variable restore all command in your macro, you should know more about that than me, after all, you're the one using the program, I just googled this...
I've never seen the parameters available on the command line before. Since I always execute from Windows, it never occurred to me to look at the parameters.

Thank you, I need to tinker with it a bit :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: 7175
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Timing

Post by Yincognito »

tass_co wrote: September 11th, 2023, 3:33 pm I've never seen the parameters available on the command line before. Since I always execute from Windows, it never occurred to me to look at the parameters.

Thank you, I need to tinker with it a bit :thumbup:
No problem, hopefully you can figure out the things I couldn't figure (and I wouldn't be able to, since I don't use the program) - mainly the variable restore all command, which is a mystery for me but according to the help, apparently required. The good news is that apart from that, the rest shouldn't be complicated at all. You can do some very simple tests from the Windows Command Prompt to get familiar with passing some value to a variable used as count in the repeat. It doesn't even have to be the same macro, just a basic one that prints back the number of times the repeat executed, to see if it worked or not. ;-)
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
tass_co
Posts: 518
Joined: May 4th, 2020, 3:01 pm
Location: Ankara, TURKEY

Re: Timing

Post by tass_co »

Yincognito wrote: September 11th, 2023, 6:26 pm No problem, hopefully you can figure out the things I couldn't figure (and I wouldn't be able to, since I don't use the program) - mainly the variable restore all command, which is a mystery for me but according to the help, apparently required. The good news is that apart from that, the rest shouldn't be complicated at all. You can do some very simple tests from the Windows Command Prompt to get familiar with passing some value to a variable used as count in the repeat. It doesn't even have to be the same macro, just a basic one that prints back the number of times the repeat executed, to see if it worked or not. ;-)
After some tinkering, I solved the problem very simply.
I set the number of repetitions I want in my skin.
I call the LeftClick event "SetClip "#Again#"" and execute the macro directly.
In this way, I copy the number of times it will be repeated to the clipboard.
Then In Macro Express Pro application; There is a "Variable Set Integer: Set to the Clipboard" action.
I use this together with the Repeat with Variable action. The result is perfect :thumbup:

Thank you Yincognito.If it weren't for you, I wouldn't have bothered with the problem...
12.09.2023 - 01.25.37-Macro Express Pro - Script Editor [DENEME].png

Code: Select all

[S03E01]
Meter=BUTTON
x=26
y=178
ButtonImage=#image5#
LeftMouseDownAction=#UU#[SetClip "#Again#"]["#Path2#\TorrentAccept.mxe"]
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
Yincognito
Rainmeter Sage
Posts: 7175
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Timing

Post by Yincognito »

tass_co wrote: September 11th, 2023, 10:31 pm After some tinkering, I solved the problem very simply.
I set the number of repetitions I want in my skin.
I call the LeftClick event "SetClip "#Again#"" and execute the macro directly.
In this way, I copy the number of times it will be repeated to the clipboard.
Then In Macro Express Pro application; There is a "Variable Set Integer: Set to the Clipboard" action.
I use this together with the Repeat with Variable action. The result is perfect :thumbup:

Thank you Yincognito.If it weren't for you, I wouldn't have bothered with the problem...

12.09.2023 - 01.25.37-Macro Express Pro - Script Editor [DENEME].png

Code: Select all

[S03E01]
Meter=BUTTON
x=26
y=178
ButtonImage=#image5#
LeftMouseDownAction=#UU#[SetClip "#Again#"]["#Path2#\TorrentAccept.mxe"]
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
Ah, that's an ingenious alternative indeed, well done. No need to bother with parameters if the clipboard can be captured. Certainly much lighter on any computer to loop within the macro itself than running it or the executable so frequently. :thumbup:

I suppose this would work even if the clipboard history is turned on, right?
https://www.ricksdailytips.com/windows-10-clipboard-stores-multiple-items/
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
tass_co
Posts: 518
Joined: May 4th, 2020, 3:01 pm
Location: Ankara, TURKEY

Re: Timing

Post by tass_co »

Yincognito wrote: September 11th, 2023, 11:02 pm Ah, that's an ingenious alternative indeed, well done. No need to bother with parameters if the clipboard can be captured. Certainly much lighter on any computer to loop within the macro itself than running it or the executable so frequently. :thumbup:

I suppose this would work even if the clipboard history is turned on, right?
https://www.ricksdailytips.com/windows-10-clipboard-stores-multiple-items/
I read the article. I opened the clipboard history and tried that again. There is no problem, it works smoothly :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: 7175
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Timing

Post by Yincognito »

tass_co wrote: September 12th, 2023, 12:28 am I read the article. I opened the clipboard history and tried that again. There is no problem, it works smoothly :thumbup:
Excellent! :great:
Thanks for letting me know. I was curious about it... :D
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
tass_co
Posts: 518
Joined: May 4th, 2020, 3:01 pm
Location: Ankara, TURKEY

Re: Timing

Post by tass_co »

Yincognito wrote: September 12th, 2023, 9:05 am Excellent! :great:
Thanks for letting me know. I was curious about it... :D
I'm the one who should thank :rosegift:
I don't know where i going from here, but i promise it won't be boring... :great:
User avatar
Yincognito
Rainmeter Sage
Posts: 7175
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Timing

Post by Yincognito »

tass_co wrote: September 12th, 2023, 10:53 am I'm the one who should thank :rosegift:
Well, if you say so... you're welcome. ;-)
Personally, I have a more holistic understanding of this, since most of the times, everybody involved in something has some benefit from it. For you, in this case, it was the idea and the practical outcome. For me, it was the knowledge associated with it. So, in the end, everyone has something to be thankful for, even if some aspects don't seem much. We have to appreciate what we have, cause it can always be worse.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth