Help with multi-threading AHK Script

Get help with using AutoHotkey (v2 or newer) and its commands and hotkeys
User avatar
ibieel
Posts: 216
Joined: 17 Oct 2021, 23:30

Help with multi-threading AHK Script

Post by ibieel » 19 Nov 2021, 07:26

Hello guys, I want to use AHK V2 to run the labels at the same time using only 1 AHK. (multiples routine in one script)
it's possible?

I'm creating a script that needs to have fast reactions, whenever a certain pixel changes on the screen it should do the action I put as fast as possible.
I'm currently using AHK V1, to do this I need to open 3 AHK Script to run 3 Labels at the same time.

Could someone give me examples of how I can do this in AHK V2 without running 3 AHK Script?

Example:

Code: Select all

SetTimer, Label1, On
SetTimer, Label2, On
Label1:
   ToolTip, Label1 Start, 250, 250, 1
   Sleep 1000
RETURN

Label2:
   ToolTip, Label2 Start, 500, 500, 2
   Sleep 1000
RETURN
for performance reasons, I would like the script to run Label1 and Label2 at the same time.

User avatar
boiler
Posts: 16768
Joined: 21 Dec 2014, 02:44

Re: Help with multi-threading AHK Script

Post by boiler » 19 Nov 2021, 23:31

AHK_H allows multi-threading and also has a v2 implementation.

User avatar
ibieel
Posts: 216
Joined: 17 Oct 2021, 23:30

Re: Help with multi-threading AHK Script

Post by ibieel » 20 Nov 2021, 08:24

boiler wrote:
19 Nov 2021, 23:31
AHK_H allows multi-threading and also has a v2 implementation.
oh yeah i know.
I would like some help to implement this, I read the documentation but I don't understand :(

User avatar
boiler
Posts: 16768
Joined: 21 Dec 2014, 02:44

Re: Help with multi-threading AHK Script

Post by boiler » 20 Nov 2021, 08:37

Ask in the AHK_H Ask For Help sub-forum. The regulars in that forum should be able to guide you through it.

User avatar
ibieel
Posts: 216
Joined: 17 Oct 2021, 23:30

Re: Help with multi-threading AHK Script

Post by ibieel » 26 Nov 2021, 18:38

any helpp???

User avatar
boiler
Posts: 16768
Joined: 21 Dec 2014, 02:44

Re: Help with multi-threading AHK Script

Post by boiler » 26 Nov 2021, 19:15

I did give you help. I gave you a link to the part of the forum where you should ask your question because that’s where people who are familiar with AHK_H would be able to answer. Did you post there?

Post Reply

Return to “Ask for Help (v2)”