Jump to content
Sign in to follow this  

Refresh my mind about GetPixel and Window Info

Recommended Posts


I've worked with autoit a long while ago....few years, but forgot almost all the basics and don't have my old scripts to deconstruct.

Right now I'm just trying to do a simple pixel match to a fullscreen application.

Can someone remind me how to uise the Active Window utility to get the right coordinates on a screenshot for the app? I'm running the app in 1024x768, but I can't get the coord from the screenshot to match that at all. Always just what the size of the picture is.

And can someone just double check that this is right?

if PixelGetColor(COOR1, COOR2) = DEC# then

on with the script

Thanks much

Share this post

Link to post
Share on other sites

This works for me

if PixelGetColor( 10 , 100 ) = 13421772 Then
MsgBox(0,"The color is", "Right")
MsgBox(0,"The color is", "Wrong")


Was going to answer his next question but he withdrew it first, not often I get questions I can answer.

Edited by BigDod

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

Ok this is driving me crazy now.

The script is working....except for the pixel match. I can not get it to trigger!

I can take the screenshot on the app, go get the coordinates using full screen in MSPaint, then put them into the script and still get nothing when I go back to the app! Either my coordinates are wrong (though I tried them like 10 times) or my method of getting the coordinates is wrong.

Heres the picture. http://news.allakhazam.com/uf/BrookieDragon/Untitled_1.jpg

I dont' know if its possible after saving it from a BMP to a JPEG, but if anyone could help me get the coordinates for the left area of the bright right bar in the bottom left corner, would greatly appreciate it.

This is the script and general coordinates I've been trying.

$i = 1



If PixelGetColor(37, 762) = 263610 Then



Until $i = 2

It goes PixelGetColor(Xcoor, Ycoor) = Dec:Number, right? Space after the comma and before and after equal sign?

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