Jhon_ Posted June 6, 2019 Share 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 Link to comment Share on other sites More sharing options...
kaisies Posted June 7, 2019 Share Posted June 7, 2019 Your first loop steals focus, so it never gets past that. Remove it. Jhon_ 1 Link to comment Share on other sites More sharing options...
OSMMDAIJI Posted June 7, 2019 Share 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 Jhon_ 1 Link to comment Share on other sites More sharing options...
Jhon_ Posted June 7, 2019 Author Share Posted June 7, 2019 Ohhh, Thank you Kaisies. I used to need that alongside Hotkeyset() Now it works wonderfully! Have a nice day! Link to comment Share on other sites More sharing options...
Jhon_ Posted June 7, 2019 Author Share Posted June 7, 2019 And thank you, Osmmdaiji, too! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now