Sign in to follow this  
Followers 0
Nefarious

Checking screen for color

9 posts in this topic

This is probably simple for some of you brains out there...

What I'm trying to do is check 2 pixel locations in a browser window, in this case I need 111,60 and 389,110 to be checked for the color red and once it's found have it click that pixel via a mouseclick.

Any sample code or links to posts with more info would be appreciated.

Share this post


Link to post
Share on other sites



This is probably simple for some of you brains out there...

What I'm trying to do is check 2 pixel locations in a browser window, in this case I need 111,60 and 389,110 to be checked for the color red and once it's found have it click that pixel via a mouseclick.

Any sample code or links to posts with more info would be appreciated.

PixelSearch() in the help file has an example.

[center]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.[/center]

Share this post


Link to post
Share on other sites

If you just want to check the 2 locations you can use PixelGetColor



Get Beta versions Here Get latest SciTE editor Here AutoIt 1-2-3 by Valuater - A great starting point.

Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

Share this post


Link to post
Share on other sites

In the given example in the help file I don't quite understand the Top, Left, Right, Bottom...

$coord = PixelSearch( 0, 0, 20, 300, 0xFF0000 )

Seeing as how the windowspy gives you x,y coords how do you plug those into that example? I just can't visualize what area the sample code would be checking.

Thanks.

Share this post


Link to post
Share on other sites

In the given example in the help file I don't quite understand the Top, Left, Right, Bottom...

$coord = PixelSearch( 0, 0, 20, 300, 0xFF0000 )

Seeing as how the windowspy gives you x,y coords how do you plug those into that example? I just can't visualize what area the sample code would be checking.

Thanks.


[center]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.[/center]

Share this post


Link to post
Share on other sites

Perfect. Thank you so much. :whistle:

Share this post


Link to post
Share on other sites

heh, i think

If PixelGetColor(x,y) = 0000000 AND PixelGetColor(x,y) = 0000000 Then

~~~~~~

it might work.... i think i pulled it of a few times..


[center]"When you look at old, classic games like Snake, you often put it off because it's such a simple game, but it's only when you actually try and create your own unique game from scratch, do you finally appreciate those games."[/center][center]Don't ask for answers if you haven't TRIED yet![/center][center]Most answers can be answered in the help file! Use it![/center]

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0