Jhon_ 0 Posted June 6, 2019 #include <Misc.au3> HotKeySet("{ESC}", "Terminate") Local $dll = DllOpen("user32.dll") While 1 Sleep(60000) WEnd Func Terminate() Exit EndFunc Local $i = 0 While 1 If _IsPressed("01",$dll) Then ; Left MouseClick Do $i=$i+1 Send("1") Sleep(250) Until $i=10 ElseIf _IsPressed("0D",$dll) Then ; {Enter} Do $i=$i+1 Send("2") Sleep(250) Until $i=10 EndIf WEnd DllClose($dll) Hello together, I've tried getting this straight for waay too long. I've looked into the AutoIt Help, and the logic should be exactly the same. It should work. But it doesn't. I'm at my wits end... I'd appreciate help. Thanks in advance, Jhon Share this post Link to post Share on other sites
kaisies 20 Posted June 7, 2019 Your first loop steals focus, so it never gets past that. Remove it. 1 Jhon_ reacted to this Share this post Link to post Share on other sites
OSMMDAIJI 2 Posted June 7, 2019 #include <Misc.au3> HotKeySet("{ESC}", "Terminate") Local $dll = DllOpen("user32.dll") Local $i = 0 While 1 If _IsPressed("01",$dll) Then ; Left MouseClick Do $i=$i+1 Send("1") Sleep(250) Until $i=10 ElseIf _IsPressed("0D",$dll) Then ; {Enter} Do $i=$i+1 Send("2") Sleep(250) Until $i=10 EndIf WEnd DllClose($dll) Func Terminate() Exit EndFunc 1 Jhon_ reacted to this Share this post Link to post Share on other sites
Jhon_ 0 Posted June 7, 2019 Ohhh, Thank you Kaisies. I used to need that alongside Hotkeyset() Now it works wonderfully! Have a nice day! Share this post Link to post Share on other sites
Jhon_ 0 Posted June 7, 2019 And thank you, Osmmdaiji, too! Share this post Link to post Share on other sites