Elettrone Posted September 18, 2009 Share Posted September 18, 2009 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? Link to comment Share on other sites More sharing options...
jvanegmond Posted September 18, 2009 Share Posted September 18, 2009 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... github.com/jvanegmond Link to comment Share on other sites More sharing options...
powerpoison Posted September 18, 2009 Share Posted September 18, 2009 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... Link to comment Share on other sites More sharing options...
Elettrone Posted September 18, 2009 Author Share Posted September 18, 2009 (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_TWould 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 September 18, 2009 by Elettrone Link to comment Share on other sites More sharing options...
powerpoison Posted September 20, 2009 Share Posted September 20, 2009 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... Link to comment Share on other sites More sharing options...
Elettrone Posted September 20, 2009 Author Share Posted September 20, 2009 if u use the function pixel get color, as i said above try to make it like i saidMousemove(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 I check pixels 20-40 times a second...I wonder if autohotkey has a better solution for this...Thanks anyway. Link to comment Share on other sites More sharing options...
powerpoison Posted September 21, 2009 Share Posted September 21, 2009 Actually that won't work for me 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 ^^ Link to comment Share on other sites More sharing options...
Elettrone Posted September 22, 2009 Author Share Posted September 22, 2009 Hhell no you don't get it my plugin searches for pixels 100% of the time he's running... If I use that sloppy workaround i'll have the mouse stuck Ty anyway. 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