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

New GetPixel function's don't seem to work : EverQuest 2 Premium Discussions

Posted: December 16th, 2004
richyrich
I tried to test the new GetPixel with window handle functions and it bombs out.
Here is a modified version of the GetPixelColorDemo.vbs file.
The fgwin seems to to work fine, returns a 6 digit number.
But when I go to pass it to the GetPixelColor() function as the 3rd param, it bombs. I have tried just a 0, since that would be default. Have also tried CLng(0) to see if it forces it to Long, no luck.

Any help Admin/Wyv?

Dim x,y,color,r,g,b,fgwin

fgwin=Win32API.XUGetForegroundWindow()

staMouse.Text = fgwin
XUScriptHost.Sleep 3000
do while bRunning
XUScriptHost.GetCursorPos x,y
color = XUScriptHost.GetPixelColor(x,y,fgwin)
r = XUScriptHost.ExtractRGB_Red(color)
g = XUScriptHost.ExtractRGB_Green(color)
b = XUScriptHost.ExtractRGB_Blue(color)
staMouse.Text = "X:" & x & " Y:" & y
staColor.Text = "R:" & r & " G:" & g & " B:" & b & " =>" & color
XUScriptHost.Sleep 100
loop
Posted: December 16th, 2004
User avatar
Premium
Total Posts:6718 Joined:2004
Yea it broke my plugin last nite and was having other problems so I had admin roll it back.

here is what I have done.

If you use windowed mode in eq2, the getpixelcolor works very well.

_________________
Use Search first, ask questions later!
Posted: December 16th, 2004
richyrich
Does Windowed mode mess up my X,Y functions? Are they relative the the game window?
Posted: December 16th, 2004
User avatar
Premium
Total Posts:6718 Joined:2004
Yes it will mess up x,y functions unless you convert them.

Ie if you want to read game coordinate x,y you will need to call GetClientRect and then use those offsets with your x,y.

Ie clientrect.left + x, clientrect.top + y

etc.

Admin is still working on that function, but that might let ya get by until he can add back in tthe hwnd which reads the window coordinates directly.

_________________
Use Search first, ask questions later!
Posted: December 17th, 2004
richyrich
I'm good until he fixes it again - I wrote most of my code to read health/power to take this into account, but when I get into reading bitmaps from the screen, could get harder, but at least I can play with windowed mode until then... hopefully he'll get it working soon.
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 28 guests
Post Reply