SweatyOgre Posted June 29, 2004 Share Posted June 29, 2004 What could be the possible reasons behind AutoIt not sending a keystroke? I need the script to send it once, perform some actions, then send the same one again. Well, it send the keystroke, performs the actions, and doesn't send the keystroke the second time. I have sleep commands before and the keystroke, in case its missing it because its too soon after the actions, so thats not the problem. Any suggestions? Link to comment Share on other sites More sharing options...
tutor2000 Posted June 29, 2004 Share Posted June 29, 2004 Can you show some of the script? Rick Link to comment Share on other sites More sharing options...
SweatyOgre Posted June 30, 2004 Author Share Posted June 30, 2004 (edited) expandcollapse popupFunc PotDrink() While $InGameCheck = PixelChecksum (680, 320, 700, 350) WinCheck() Sleep(100) WEnd Sleep(500) Send("I") Sleep(250) $FCheck = 0 Do $FCheck = $FCheck + 1 $FJuve = PixelSearch(430, 340, 710, 455, 14708848) If not @error then WinCheck() MouseClick("right",$FJuve[0],$FJuve[1], 1, 1) Else EndIf Until $FCheck = 6;PixelSearch(430, 340, 710, 455, 14708848) = 0 $JCheck = 0 Do $JCheck = $JCheck +1 $Juve = PixelSearch(430, 340, 710, 455, 10756348) If not @error then WinCheck() MouseClick("right",$Juve[0],$Juve[1], 1, 1) Else EndIf Until $JCheck = 6;PixelSearch(430, 340, 710, 455, 10756348) =0 $SCheck = 0 Do $SCheck = $SCheck + 1 $SHeal = PixelSearch(430, 340, 710, 455, 12866644) If not @error then WinCheck() MouseClick("right",$SHeal[0],$SHeal[1], 1, 1) Else EndIf Until $SCheck = 6;PixelSearch(430, 340, 710, 455, 12866644) = 0 $GCheck = 0 Do $GCheck = $GCheck + 1 $GHeal = PixelSearch(430, 340, 710, 455, 15773836) If not @error then WinCheck() MouseClick("right",$GHeal[0],$GHeal[1], 1, 1) Else EndIf Until $GCheck = 6;PixelSearch(430, 340, 710, 455, 15773836) = 0 $MCheck = 0 Do $MCheck = $MCheck + 1 $SMana = PixelSearch(430, 340, 710, 455, 2384088) If not @error then WinCheck() MouseClick("right",$SMana[0],$SMana[1], 1, 1) Else EndIf Until $MCheck = 6;PixelSearch(430, 340, 710, 455, 2384088) = 0 $GMCheck = 0 Do $GMCheck = $GMCheck + 1 $GMana = PixelSearch(430, 340, 710, 455, 3158164) If not @error then WinCheck() MouseClick("right",$GMana[0],$GMana[1], 1, 1) Else EndIf Until $GMCheck = 6;PixelSearch(430, 340, 710, 455, 3158164) = 0 Sleep($KeyD) Send("I") Sleep($KeyD) WinCheck() EndFunc It doesn't send the second "I". Edited June 30, 2004 by SweatyOgre Link to comment Share on other sites More sharing options...
tutor2000 Posted June 30, 2004 Share Posted June 30, 2004 Try send ("!i") or {SHIFTDOWN} Holds the SHIFT key down until {SHIFTUP} is sent send ("{SHIFTDOWN}") send ("i") send ("{SHIFTUP}") Rick Link to comment Share on other sites More sharing options...
emmanuel Posted June 30, 2004 Share Posted June 30, 2004 send ("!i")+ is shift, alt is ! "I'm not even supposed to be here today!" -Dante (Hicks) Link to comment Share on other sites More sharing options...
SweatyOgre Posted June 30, 2004 Author Share Posted June 30, 2004 I just need it to send plain "I" key, but in the program it is sending the key, the shift won't affect it, so maybe it will cause the script to send the key. Link to comment Share on other sites More sharing options...
Arctor Posted June 30, 2004 Share Posted June 30, 2004 The question is: Wasn't the "I" sent? Or didn't the script reach the line where the second send("I") is placed. I would test it with a simple Output. Just put a MsgBox(0, "Output", "Line has been reached") instead of the second send ("I") and look it comes up or not. Or just write something to a textfile. arctor Link to comment Share on other sites More sharing options...
SweatyOgre Posted July 1, 2004 Author Share Posted July 1, 2004 It's not doing the pixel searches either. I added a MsgBox after the second Send("i") and it is getting to that line...ugh, whats wrong? Link to comment Share on other sites More sharing options...
tutor2000 Posted July 1, 2004 Share Posted July 1, 2004 + is shift, alt is !Oops sorryRick Link to comment Share on other sites More sharing options...
Arctor Posted July 1, 2004 Share Posted July 1, 2004 It's not doing the pixel searches either. I added a MsgBox after the second Send("i") and it is getting to that line...ugh, whats wrong?I have no more idea. I do not know in what game you are in. I can't test your script on my machine. What I noticed is that a function named WinCheck() is called. But I don't see the function itself.arctor Link to comment Share on other sites More sharing options...
SweatyOgre Posted July 1, 2004 Author Share Posted July 1, 2004 That function is defined earlier in the script, and is just a simple function to check and see if the game window is active. Link to comment Share on other sites More sharing options...
SweatyOgre Posted July 1, 2004 Author Share Posted July 1, 2004 I just separated the whole function into another script, and ran it, and it worked. AGGGGGGGGGGGHHHHHHHHHHHHHHHHHHHHHHHH! Does anyone have any possible idea why autoit wouldn't send a keystroke, or wouldn't perform a pixelsearch? 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