Jump to content

PixelSearch/PixelGetColor not working


Recommended Posts

Here is a simple snipped:

func color($x,$y)

$clr=PixelGetColor($x, $y)

If Not @error Then

consolewrite("Pixel color at (" & $x & "," & $y & ") is " & Hex($clr,6) & @CRLF)

EndIf

EndFunc

On XP32 it works both on desktop and the game, on windows 7 the desktop is okay, game does not rise an error, but the output is simply "Pixel color at (100,100) is 000000" and stays the same no matter if I change coords. Sometimes gets stuck into some other value, light gray, but neve anything sane

Link to comment
Share on other sites

I had a very simliar issue not too long ago. If your game is ran in a window, rather than fullscreen, this will cause problems if you are trying to use the Opt for client-coords; because Pixel Search searchs the screens coordinates.

However there is a relatively easy way I managed to get around this, and only search the "wanted" coordinates throughout the client side only.

Lmk if this is the case and I'll elaborate.

Link to comment
Share on other sites

No, game is fullscreen sadly, I have tried:

Opt("CaretCoordMode", 2) ;1=absolute, 0=relative, 2=client

Opt("PixelCoordMode", 2) ;1=absolute, 0=relative, 2=client

to every possible option and still got 0000000 as color. I have downloaded AutoHotkey and tested his similar function which have 3 possible ways to operate, all 3 returned 0 too. It looks windows 7's directx is doing something bad. I have heard that it supports 10-bit colors, maybe that's the reason? I guess only some of the developers can answer :)

Link to comment
Share on other sites

I had the same problem with directx in quake3. I fixed the problem basically by fixing the screen size of the game. Although it's minimized, you really can't tell the difference. Try using your program while it's minimized.

"I think, therefore I am"[size="1"]René Descartes[/size]

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...