joncom Posted April 22, 2005 Posted April 22, 2005 Is there any possible way to make a script that will hold down the letter "G" until a particular color is detected at pixel (1,1)? I do NOT want the script to keep hitting the key multiple times. It must HOLD it down until the change is detected. Any help would GREATLY be appreciated.
buzz44 Posted April 23, 2005 Posted April 23, 2005 While $Color <> "Insert decimal color value here" Send("{g down}") $Color = PixelGetColour(1,1) Wend or Do Send("{g down}") $Color = PixelGetColour(1,1) Until $Color = "Insert decimal color value here" Doesnt holding a key down, and pressing the key multiple times, give you the same result? If not can you please give and example. qq
joncom Posted April 23, 2005 Author Posted April 23, 2005 I need this for responding to what's being displayed in a game... in the game, holding down the button performs a much different action than tapping it... for example.. in some video games, if you hold the "jump" button, you will jump higher than if u just tap it. So, what I want to accomplish here, is a script that will do something along the lines of {SHIFTDOWN} (except using the "g" key of course), and then once the pixel color change is detected at (1,1), I need the equivilent of {SHIFTUP} (for the "g" instead though). Does this make sense? And is it possible? Or does the AutoIt language not support this?
buzz44 Posted April 23, 2005 Posted April 23, 2005 (edited) Yes its possible, the above won't work? I'm unsure if it will or not, test please. If it doesn't I remember a topic not long ago for someone asking for a key to be held down there entire script, I'll see if I can find it.Edit: On further inspection, try this.Send("{g down}") While 1 If PixelGetColour(1,1) = "Insert decimal color value here" Then Send("{g up}") EndIf Wend Edited April 23, 2005 by Burrup qq
joncom Posted April 23, 2005 Author Posted April 23, 2005 Thanks, haven't tried yet, but I will in a little bit. I'll post my results.
herewasplato Posted April 23, 2005 Posted April 23, 2005 Might want exitloop: Send("{g down}") While 1 If PixelGetColour(1,1) = "Insert decimal color value here" Then Send("{g up}") ExitLoop EndIf Wend ...but then again, you might not... [size="1"][font="Arial"].[u].[/u][/font][/size]
joncom Posted April 24, 2005 Author Posted April 24, 2005 I got around to trying this recently... wow it worked like a charm. Thanks a lot!
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