Nefarious Posted August 12, 2006 Share Posted August 12, 2006 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 More sharing options...
Moderators SmOke_N Posted August 12, 2006 Moderators Share Posted August 12, 2006 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 More sharing options...
BigDod Posted August 12, 2006 Share Posted August 12, 2006 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 More sharing options...
Nefarious Posted August 12, 2006 Author Share Posted August 12, 2006 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 More sharing options...
Moderators SmOke_N Posted August 12, 2006 Moderators Share Posted August 12, 2006 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 More sharing options...
Nefarious Posted August 12, 2006 Author Share Posted August 12, 2006 Perfect. Thank you so much. Link to comment Share on other sites More sharing options...
Zib Posted August 12, 2006 Share Posted August 12, 2006 (edited) You already know the coordinates to check. Therefore this should be viable. If PixelGetColor(111, 60) = 0xFF0000 Then MouseClick("left", 111, 60) ElseIf PixelGetColor(389, 110) = 0xFF0000 Then MouseClick("left", 389, 110) EndIf Edited August 12, 2006 by Zib Link to comment Share on other sites More sharing options...
Vindicator209 Posted August 12, 2006 Share Posted August 12, 2006 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 More sharing options...
Nefarious Posted August 12, 2006 Author Share Posted August 12, 2006 You already know the coordinates to check. Therefore this should be viable. If PixelGetColor(111, 60) = 0xFF0000 Then MouseClick("left", 111, 60) ElseIf PixelGetColor(389, 110) = 0xFF0000 Then MouseClick("left", 389, 110) EndIf This works much better for what I need. Thanks. 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