Jump to content

Checking screen for color


Recommended Posts

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.

Link to comment
Share on other sites

  • Moderators

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.

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

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


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

Link to comment
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.

Link to comment
Share on other sites

  • Moderators

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.

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

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]

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...