I just want to terminate main thread with an hotkey.
Code: Select all
!F1:: ; main thread
loop
{
sleep 1000
number++
tooltip, %number% , 500,500
}
return
F2:: ; Terminate !F1 with F2 hotkey
Exit, !F1
return
Code: Select all
!F1:: ; main thread
loop
{
sleep 1000
number++
tooltip, %number% , 500,500
}
return
F2:: ; Terminate !F1 with F2 hotkey
Exit, !F1
return
Code: Select all
!F1:: ; main thread
terminate := false
loop
{
sleep 1000
if %terminate%
break
number++
tooltip, %number% , 500,500
}
return
F2:: ; Terminate !F1 with F2 hotkey
terminate := true
return
its not doable with supercomplex, 4million+ line script.kaiserwilli wrote: ↑11 Aug 2022, 14:51You could have the first thread check if the second thread has called for it to terminate, then have the first thread terminate itself.
Code: Select all
!F1:: ; main thread terminate := false loop { sleep 1000 if %terminate% break number++ tooltip, %number% , 500,500 } return F2:: ; Terminate !F1 with F2 hotkey terminate := true return