Read colors no matter where the screen is..

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
Mark Gevry
Pro Scripter
Posts: 63
Joined: Sat Dec 25, 2004 3:23 pm

Read colors no matter where the screen is..

Post by Mark Gevry » Wed Mar 16, 2005 7:47 pm

Hi. If you GetPixelColor of things, such as in a game, instead of moving the window and then getting the colors there, is it possible to let it not matter where the screen is. I thought you had to use the ADD> command to do this im just not sure? Example please? Thank you.

Regards,
Mark

Me_again
Automation Wizard
Posts: 1101
Joined: Fri Jan 07, 2005 5:55 pm
Location: Somewhere else on the planet

Post by Me_again » Wed Mar 16, 2005 8:11 pm

You have to get the X Y position of the window, and then add those X Y values to the X Y values within the window where you want to get the pixel color

If X and Y are the coordinates in the window of the pixel for which you want to get the color

GetWindowPos>MyWindow,WX,WY
Add>X,WX
Add>Y,WY
GetPixelColor>X,Y,PC

Mark Gevry
Pro Scripter
Posts: 63
Joined: Sat Dec 25, 2004 3:23 pm

Post by Mark Gevry » Wed Mar 16, 2005 9:18 pm

Sorry could you put some numbers in so i get the jist of it? Just new to this thing.

Me_again
Automation Wizard
Posts: 1101
Joined: Fri Jan 07, 2005 5:55 pm
Location: Somewhere else on the planet

Post by Me_again » Thu Mar 17, 2005 12:14 am

Sure. If the pixel you want to check is at 100 pixels across and 50 pixels down (you need to replace "MyWindow" with the actual name of the window)

GetWindowPos>MyWindow,WX,WY
Add>100,WX
Add>50,WY
GetPixelColor>X,Y,PC
Message>PC

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts