Sign in to follow this  
Followers 0
Elettrone

Problem with pixel/color search functions

8 posts in this topic

I made a plugin for a game and i've been using the PixeGetColor() and PixelSearch() functions in a tight loop to understand when the interfaces changes.

The problem is that for some reason, these functions detect black pixels(with color value=0) even if there are none and this is causing me a lot of trouble.

It looks like it happens a LOT more on ATI cards....is this a know issue or what?

Share this post


Link to post
Share on other sites



Well, I believe that the underlying cause of this is because PixelGetColor and PixelSearch both use GDI. You're probably reading from a window that is drawing itself using DirectX technology. DirectX and GDI are completely seperate drawing methods in Windows, and they're not ment to be interacting the way most AutoIt users are using it.

We're all rather lucky that it is working at all...

Share this post


Link to post
Share on other sites

i Found out a similiar problem on a game called combat arms... then i noticed that for some weird reason if i moved the mouse to o,o coords Before checking the color of the pixel, Strangely the color will be the real one.... i dunno if this is the same as my problem but u can try to add this before ur pixel get color...

Mousemove(0,0,300)... try it and let me know if it worked, if not maybe we will find another logistic u can use maybe...

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Well, I believe that the underlying cause of this is because PixelGetColor and PixelSearch both use GDI. You're probably reading from a window that is drawing itself using DirectX technology. DirectX and GDI are completely seperate drawing methods in Windows, and they're not ment to be interacting the way most AutoIt users are using it.

We're all rather lucky that it is working at all...

You're telling me there's no actual solution to this problem?! That can't be true.... T_T

Would it change anything if i ran the program under OpenGL rather than DirectX? I know this game can also run with OGL.

i Found out a similiar problem on a game called combat arms... then i noticed that for some weird reason if i moved the mouse to o,o coords Before checking the color of the pixel, Strangely the color will be the real one.... i dunno if this is the same as my problem but u can try to add this before ur pixel get color...

Mousemove(0,0,300)... try it and let me know if it worked, if not maybe we will find another logistic u can use maybe...

Actually my check points are fixed, i don't use the mouse cursor to find my colors...

I've partially fixed this issue introducing data buffering and data filtering....but this offcourse also introduces some lag on responsivness....necessary to avoid false positives; still i'm not satisfied....i want to go to the source of the problem...

Is there ANY other option lying around?

Edited by Elettrone

Share this post


Link to post
Share on other sites

if u use the function pixel get color, as i said above try to make it like i said

Mousemove(0,0,500)

Pixelgetcolor(x,y)

it worked for me and i had ur same issue so before saying all that you should give it a try...

Share this post


Link to post
Share on other sites

if u use the function pixel get color, as i said above try to make it like i said

Mousemove(0,0,500)

Pixelgetcolor(x,y)

it worked for me and i had ur same issue so before saying all that you should give it a try...

Actually that won't work for me :D

I check pixels 20-40 times a second...

I wonder if autohotkey has a better solution for this...

Thanks anyway.

Share this post


Link to post
Share on other sites

Actually that won't work for me :D

I check pixels 20-40 times a second...

I wonder if autohotkey has a better solution for this...

Thanks anyway.

if u check pixel 20 40 times, just keep the mouse there untill u finish checking ur pixels then u can move it... well i just know this way to make it work so at least i tried to help ^^

Share this post


Link to post
Share on other sites

Hhell no you don't get it :D my plugin searches for pixels 100% of the time he's running...

If I use that sloppy workaround i'll have the mouse stuck :D

Ty anyway.

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