somepeople could give me an example of multiple threads with 4 loops running at the same time ... I really appreciate autohotkey, since it has helped a lot people with disabilities, and I have read the autohotkey manual for months, and a little autohotkey_h and autohotkey_dll, but I feel really lost, could somepeople help me convert the following codes into multi-threads?:
script:
Code: Select all
;thread 1
Loop
{
sleep 50
IfWinActive, Sin título: Bloc de notas
{
notes:=1
WinGetPos , X, Y,
MsgBox %notes%in %x%%y%
}
else
{
MsgBox, no activo
}
}
;thread 2
Loop
{
sleep 50
KeyIsDown := GetKeyState("l" , "P")
MsgBox, %KeyIsDown%
}
;thread3
Loop
{
sleep 50
MouseGetPos , OutputVarX, OutputVarY
}
;thread 4
Loop
{
sleep 50
pluser:= X Y KeyIsDown OutputVarX OutputVarY
tooltip:=%pluser%
if pluser = 5005001500500
{
MsgBox %pluser%
}
}
I ask this favor since autohotkey normally wouldn't keep the values of the varible pluser updated inside a loop....
I know that this could be done with a single loop, but this is an example for a starting point, on the other hand, when a script needs values in real time, it may be that with a single loop when the "pluser" variable is updated, the The position of the window, the position of the mouse or the state of the key have already changed, taking into account that the pluser variable is the last line of the script.
thank you very much in advance any help...