Hansi Posted July 27, 2009 Share Posted July 27, 2009 ; ; AutoIt Version: 3.0 ; Language: English ; Platform: Windows 7 ; Author: Casper ; ; Script Function: ; Mouseclick when a single pixel on screen change to the Select color ; Prompt the user to run the script - use a Yes/No prompt $answer = MsgBox(4, "AutoIt", "Run?") ; Find a white pixel in the range 577,569-577,569 If $coord = PixelSearch( 577, 569, 577, 569, 0xFFFFDE ) Then sleep(200) Mouseclick("Left" [, 700, 800[, 2]]) EndIf I want my script to search for a single pixel to change color, Just stay searching for the pixel untill the pixel change color then click with the mouse 1-2 times. After the mouse click i want it to loop/start the scrips again untill i stop it. I am very new here and have workd on this in 5hours now without getting any closer. can some1 plzz tell me what more to add and maybe help me if my scrips not sceems to work. Link to comment Share on other sites More sharing options...
lordicast Posted July 27, 2009 Share Posted July 27, 2009 Try... ; Prompt the user to run the script - use a Yes/No prompt $Answer = MsgBox(4, "AutoIt", "Run?") If $Answer = 6 Then PixelS() Else Exit EndIf Func PixelS() While 1 Sleep(200) ; Find a white pixel in the range 577,569-577,569 $PixelSeek = PixelSearch(577, 569, 577, 569, 0xFFFFDE) If Not @error Then MouseClick("Left", $PixelSeek[0], $PixelSeek[1], 2) EndIf WEnd EndFunc ;==>PixelS [Cheeky]Comment[/Cheeky] Link to comment Share on other sites More sharing options...
Hansi Posted July 27, 2009 Author Share Posted July 27, 2009 Thanks lordicast yes thats what i looking for.. If i can ask for a one little thing. Is this possible to search for pixel two different places on same time: Only mouseclick if two different pixel, two different places on the screen have the same color? if i got the cordinate of both of the pixels example: i need the mouse to click if pixel on cord 577, 575 is 0xFFFFFF (white) and pixel in cord 880, 980 is 0xFFFFFF (white) when both pixel are white (and only when they are white same time) mouse click. it dont have to click where the pixel is just click where i manuel put the mouse. Link to comment Share on other sites More sharing options...
lordicast Posted July 28, 2009 Share Posted July 28, 2009 ; Prompt the user to run the script - use a Yes/No prompt $Answer = MsgBox(4, "AutoIt", "Run?") If $Answer = 6 Then PixelS() Else Exit EndIf Func PixelS() While 1 Sleep(200) $Pix1 = PixelGetColor(577, 575) $Pix2 = PixelGetColor(880, 890) If Hex($Pix1) = '00FFFFFF' Then If Hex($Pix2) = '00FFFFFF' Then MouseClick("Left") EndIf EndIf WEnd EndFunc ;==>PixelS [Cheeky]Comment[/Cheeky] Link to comment Share on other sites More sharing options...
Hansi Posted July 28, 2009 Author Share Posted July 28, 2009 (edited) Thanks once again, this is exacly what i need u are my mann... >_ Edited July 28, 2009 by Hansi 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