=sinister= Posted December 3, 2005 Share Posted December 3, 2005 is there a way to search the screen with more than 1 pixel, but fast? the only thing I found was pixelsearch but thats only 1 color... Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted December 3, 2005 Moderators Share Posted December 3, 2005 Try looking at the shade variation sinister. You posted this question yesterday on pixelsearch, I gave you the link... but you said it was a bit complicated. It looked like Larry was just waiting on someone to turn that into C++ code to add it in, is what I gathered from the post. If they are 2 totally different "specific" colors, you'll need to run 2 options of the PixelSearch. Local $Pix1 = PixelSearch(0, 0, 100, 100, 0x000000, 0, 2); notice the last one, stepping 2 pixels to speed it up Local $Pix2 = PixelSearch(0, 0, 100, 100, 0xFF0000, 0, 2) If $Pix1 <> 1 Or $Pix2 <> 1 Then ;Do something EndIf I gave an example with stepping 2 pixels to speed up the current PixelSearch. Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
=sinister= Posted December 3, 2005 Author Share Posted December 3, 2005 so if I had 3 pixels to search for, would I change the 2 to a 3? Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted December 3, 2005 Moderators Share Posted December 3, 2005 so if I had 3 pixels to search for, would I change the 2 to a 3?The "2" is not a "pixel" to search for, it's how many pixels to skip while searching. You can make that any integer higher than 1, but will skip that many pixels.As per my post, and the help file: You can do "Shade" vaiations where the "0" is, if the colors are close, and they don't have to be specific. If the colors have to be specific, then you must use "2" different pixelsearch() functions as my example gave you. Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
=sinister= Posted December 3, 2005 Author Share Posted December 3, 2005 (edited) great, thanks, one more question, do you think the following code would work? Local $Pix1 = PixelSearch(0, 0, 100, 100, 0x000000, 0, 2) Local $Pix2 = PixelSearch(0, 0, 100, 100, 0xFF0000, 0, 2) If $Pix1 <> 1 Or $Pix2 <> 1 Then MouseClick('Right', $Pix1[0], $Pix1[1], 1, 0) MouseClick('Right', $Pix2[0], $Pix2[1], 1, 0) Sleep(2000) EndIf Edited December 3, 2005 by =sinister= Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted December 3, 2005 Moderators Share Posted December 3, 2005 (edited) great, thanks, one more question, do you think the following code would work? Local $Pix1 = PixelSearch(0, 0, 100, 100, 0x000000, 0, 2) Local $Pix2 = PixelSearch(0, 0, 100, 100, 0xFF0000, 0, 2) If $Pix1 <> 1 Or $Pix2 <> 1 Then MouseClick('Right', $Pix1[0], $Pix1[1], 1, 0) MouseClick('Right', $Pix2[0], $Pix2[1], 1, 0) Sleep(2000) EndIf Probably not just like that... Try this: Local $Pix1 = PixelSearch(0, 0, 100, 100, 0x000000, 0, 2) Local $Pix2 = PixelSearch(0, 0, 100, 100, 0xFF0000, 0, 2) If $Pix1 <> 1 Or $Pix2 <> 1 Then If IsArray($Pix1) Then MouseClick('Right', $Pix1[0], $Pix1[1], 1, 0) If IsArray($Pix2) Then MouseClick('Right', $Pix2[0], $Pix2[1], 1, 0) Sleep(2000) EndIf Otherwise, it looks like it would throw you an error is one of them was not found or "@error" Edit: Double Posted Edited December 3, 2005 by SmOke_N Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
=sinister= Posted December 3, 2005 Author Share Posted December 3, 2005 alright, thanks. I'll test it out later and give ya some feedback, im too lazy to right now. lol. 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