Need help Converting AutoHotKey Script to AutoIt

08/08/2019 17:08 yetoyeto#1
Is there a similar command in AutoIt that would be the equivalent of AutoHotKey's #persistent? I have Googled but only found a script that is somewhat suspect.

Thank you in advance for any help,
yeto
08/08/2019 17:28 elmarcia#2
Persistent is to continue loop, you could do the same with a while loop and exit condition.
Code:
HotKeySet("{ESC}","stop")

$running = False

Func stop()
	$running = False
EndFunc

Func mainLoop()
	$running = True
	While $running
	;Your program logic here
	ToolTip("script running " & @HOUR & ":" &@MIN & ":" &@SEC,0,0)
	Sleep(5);add delay to prevent high CPU ussage
	WEnd
EndFunc

mainLoop()
08/08/2019 17:54 yetoyeto#3
Quote:
Originally Posted by elmarcia View Post
Persistent is to continue loop, you could do the same with a while loop and exit condition.
Code:
HotKeySet("{ESC}","stop")

$running = False

Func stop()
	$running = False
EndFunc

Func mainLoop()
	$running = True
	While $running
	;Your program logic here
	ToolTip("script running " & @HOUR & ":" &@MIN & ":" &@SEC,0,0)
	Sleep(5);add delay to prevent high CPU ussage
	WEnd
EndFunc

mainLoop()
Thank you for taking time to reply. This is very helpful.

Thank you,
yetoyeto