Jump to content

Problem using Pixelsearch or PixelGetColor under Vista


Recommended Posts

I have been enjoying writing a Fishbot for World of Warcraft (naughty I know) and so far it has functioned quite good.

However I recently got a new laptop running on Vista (Home Premium x86).

When I try to get the color of my bobber in World of Warcraft using "PixelGetColor" it just returns 0x000000 every time.

I had a feeling it might have to do with "Windows Aero" settings, so I disabled those. Then when I tried to use "PixelGetColor" in game it would return me the color of the window below the game. (Usually my desktop).

To narrow down the problem I wrote a simple little script that posts the color of the pixel I'm targeting in a messagebox whenever I press {Pause}. For me it clearly illustrates the problem and I was wondering if any of you could use it to reproduce it, or even know a solution.

This script does not use PixelSearch, but using pixelsearch with Windows Aero active made it only respond to the color 0x000000 and with Aero off it was just picking up my desktop again.

The script I use is:

HotKeySet("{pause}","color")
while 1
    sleep(1000)
Wend
func color()
$mousepos = Mousegetpos()
$pointerpixel = hex(PixelGetColor($mousepos[0],$mousepos[1]),6)
MsgBox(0,"The color is:","0x"&$pointerpixel)
endfunc

I was also wondering if this should belong in the the "Bug report forum" because it seems to be related to vista rather then AutoIt. Any help and suggestions are greatly appreciated.

Tom

Edit: PixelGetColor seems to work when the game is not fullscreen, however that doesn't seem to help for pixelsearch.

Edit2: I made a typo. Outside fullscreen mode both functions work, but in fullscreen I get the two problems with and without Aero as described above.

Edited by Tvern
Link to comment
Share on other sites

Like I said I found a workaround for the problem, but I'm gonna bump the topic once becuase I'm interested in what causes this problem and different ways of solving it. Hope you don't mind :).

Tom

Link to comment
Share on other sites

Use the AutoIT Info Tool to get the color for where ever your cursor is, while you are playing the game. Just have the AutoIT Info Tool window open while playing and move ur cursor over ur bobber and write down the code for the colour u need.

Also, do u mind me asking about ur bot and if u have problems with the PixelSearch finding a pixel other than ur bobber? (resulting in it clicking something completely other than what you had hoped?)

red

Link to comment
Share on other sites

Use the AutoIT Info Tool to get the color for where ever your cursor is, while you are playing the game. Just have the AutoIT Info Tool window open while playing and move ur cursor over ur bobber and write down the code for the colour u need.

Also, do u mind me asking about ur bot and if u have problems with the PixelSearch finding a pixel other than ur bobber? (resulting in it clicking something completely other than what you had hoped?)

red

The AutoIt info tool also returns the wrong color if the game is in fullscreen mode and I was aiming to make the bot able to adjust settings without needing any other programs. It works fine if the game is in windowed maximised mode, but it seems Vista does some strange things with fullscreen applications.

I hardly have any trouble with picking up other pixels then the one I want to. I can click the bobber once ingame and the program will set itself up to search for that color, or if it can't find it I made a secondary color to look for. In most zones it searches for the read feather because it stands out best, but in some zones I make it look for the blue feather or the cork or whatever bobbers are made of.

I made a GUI wich allows me to change the color and tolerance for different zones and that way I can keep the tolerance low (usually between 5 and 15), wich makes for very few errors. Last time I counted it had a 96% catchrate with most misses coming from clicking too soon.

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...