Guest Keelan Posted February 11, 2005 Share Posted February 11, 2005 Hello Everyone! I just downloaded AutoIt today and I love it and I want to thank the devs for making such a great program. Now, to my problem. I looked through commands like Pixel Search but I can't find a way to make my mouse click a pixel that's a crtain color. Does anyone know how to do this? Thank you! Link to comment Share on other sites More sharing options...
layer Posted February 11, 2005 Share Posted February 11, 2005 Straight from the help file... (Most of it at least ) ; Find a pure red pixel in the range 0,0-20,300 $coord = PixelSearch( 0, 0, 20, 300, 0xFF0000 ) If Not @error Then MouseClick ("left", $coord[0], $coord[1]) EndIf that should work... FootbaG Link to comment Share on other sites More sharing options...
Guest Keelan Posted February 11, 2005 Share Posted February 11, 2005 Okay thanks layer. One more thing how does the range seem to work? I don't understand it. Sorry for my nooby questions. Link to comment Share on other sites More sharing options...
Blue_Drache Posted February 11, 2005 Share Posted February 11, 2005 (edited) PixelSearch is input as a rectangular box that you draw on the screen for it to search in. PixelSearch ( left, top, right, bottom, color [, shade-variation] [, step]] ) can be a little confusing, so we'll put in in algebraic terms. x1,y1 +---------------------+ | | | | | | | | | | | | +---------------------+ x2,y2 PixelSearch(x1,y1,x2,y2,colour,shade-variant,step) Colour is required, and is in decimal or hex. Use hex though it's easier. Note as 0xRRGGBB in hexidecimal format. so, pure red is 0xff0000. The shade variant is the ammount that the pixel can vary from the specified colour. It's an optional parameter and if not supplied, we're only looking for an exact colour match. The step is how many pixels to search. Step 1 will search every pixel in the box, step 2 will search every other pixel, step 3 will search 1/3 of the pixels, etc. As with the shade variant, this is also an optinal parameter and defaults to 1. Edited February 11, 2005 by Blue_Drache Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache Link to comment Share on other sites More sharing options...
Guest Keelan Posted February 11, 2005 Share Posted February 11, 2005 (edited) Thanks Drache I understand it now. How do I make it repeat the action an infinite amount of times? Edited February 11, 2005 by Keelan Link to comment Share on other sites More sharing options...
layer Posted February 11, 2005 Share Posted February 11, 2005 HotKeySet ("^e", "MyExit") While 1 ; Find a pure red pixel in the range 0,0-20,300 $coord = PixelSearch( 0, 0, 20, 300, 0xFF0000 ) If Not @error Then MouseClick ("left", $coord[0], $coord[1]) EndIf WEnd Func MyExit () Exit EndFunc press Ctrl+E to exit... you should look in the help file [/ FootbaG 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