Jump to content

Question regarding PixelSearch

Recommended Posts



At the momento i'm using autoit and the function PixelSearch with Visual Basic 6.

I know that the function PixelSearch returns error = 1 if no pixel was found. Is there a way to retrieve the coord where there is no such pixel?

I'm trying to search for a pixel colour (Ex: Red) and then looping through the X axis, until no pixel of that colour is found, and i want to know that coordinate (the coordinate adjacent to the pixel colour, where there is no colour)


Share this post

Link to post
Share on other sites

This is a valid question.

In addittion, i noticed that using for instance:

Dim C() as variant

C()=pixelsearch( parameters)

msgbox C(0) & C(1)

throws an error of type mismatch.

Any way to fix it in Vb?

Share this post

Link to post
Share on other sites



I'm making an autoaim Bot for a 2d mmorpg game.

PixelSearch is very popular for game automation. :lol::P

go find some forums that will help you solve your problem. :D


Edited by 232showtime

ill get to that... i still need to learn and understand a lot of codes graduated.gif

Correct answer, learn to walk before you take on that marathon.

Share this post

Link to post
Share on other sites
3 hours ago, Eragon said:

Any way to fix it in Vb?

Did you realized that you are not posting in a VB-Froum?

If you want to realize it with AutoIt, have a look in the helpfile and notice mousecoords are only returned if a pixel with searched colour is found. So what to do? Juast memory in which area you searched, in all of these mousecoords is in that moment no pixel with searched colour, what's in the next moment nobody knows.

So your problem isn't solveable with pixelsearch. Have a look at:


Edited by AutoBert

Share this post

Link to post
Share on other sites


We know you want to use this for a game, so stop pretending otherwise. This is your final warning - thread locked.


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:


ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area


Share this post

Link to post
Share on other sites
This topic is now closed to further replies.