Post Reply Home » Forums » EverQuest 2 » EverQuest 2 Premium Discussions

GetPixelColor is kinda bugged... : EverQuest 2 Premium Discussions

Posted: December 13th, 2004
richyrich
Well, this is not a new issue, I actually found the same problem when I was scripting SWG, but I thought I'd throw it out there again if there is something Admin/Wyv can do?

Here is the problem, the GetPixelColor() doesn't always return the right colors when it is reading from a "window" in game.
There is a quick way to reproduce the problem and that is to run the GetPixelColorDemo.vbs that comes with XU.
Go into EQ2 and put your cursor over the health bar of your character (will have to move away from the pop-up tip). Just leave it there and watch the color value swtich between the real colors and something else (usually 0, 0, 0, but can be anything).

I found this when coding SWG and rewrote my health/power bar functions to work around this by checking a pixel multiple times if it didn't match what was expected... and think it is pretty reliable now even in EQ2.

The problem is the more we rely on the function to get colors the more it will become a problem, especially if using to bitmap checks until we have other functions that do that.

I have found the problem does not happen if you are not reading from an in-game window. So, my theory is somehow the GetPixelColor() function is not in sync with the game redraw and when reading from a window in-game, it sometimes reads what is "behind" the window instead of the actual window color (health bar, etc.)

Any ideas?

Rich
Posted: December 13th, 2004
User avatar
Total Posts:1168 Joined:2004
You are right.

I have found the problem. I was using the WIN32API to call GetPIxel GetDC(0),x,y. I have modified the script to call GetPixel gameDC,x,y.

I'll post it here in a bit.

_________________
Help our site.. take a moment to click the Digg this post!!! v v v
Posted: December 13th, 2004
richyrich
Awesome! You have no idea how much code I have written to "work around" this bug :-) TY TY!
Posted: December 15th, 2004
User avatar
Total Posts:272 Joined:2004
That also always happens in FFXI, but it does not always goto 0,0,0 but some other random color code. Rather annoying but scripting still is possible obviously.
Posted: December 15th, 2004
richyrich
It's not always 0,0,0, just see that a lot, I think it truly is reading what is "behind" the window...

Still waiting to see it released, tried it last night and it was still the old code.
Posted: December 15th, 2004
User avatar
Premium
Total Posts:6718 Joined:2004
I dont think he has posted a new scripthost yet

_________________
Use Search first, ask questions later!
Ready to join the community? Click here and see all of the benefits!
blue large dotWho is online
Users browsing this forum: No registered users and 12 guests
Post Reply