Sign in to follow this  
Followers 0
DNnlee

need help with pixel search

9 posts in this topic

im trying to scan a certain region for a monster, ( for this game i play)

i know its going to appear within certain coordinates

if i do pixel scan, white means it isn't there, and anything but white means there's something there.

$coord = PixelSearch( 0, 0, 20, 300, 0xFFFFFF )

If Not @error Then

MsgBox(0, "X and Y are:", $coord[0] & "," & $coord[1])

EndIf

if i do this it will only tell me coords of white... i want to find coord of anything BUT white in a region... any ideas?

Share this post


Link to post
Share on other sites



Right now your script says:

If there is No error finding the color white, then Msg this coordinate

Try looking into PixelChecksum (), it sounds like that is your best option.

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

See here:

#491281

Find anything NOT black:

$result = PixelSearch(884,199,1094,408,0xFFFFFF,254)
If NOT @ERROR Then
    ConsoleWrite("MATCH FOUND")
Else
    ConsoleWrite("NO MATCH FOUND")
EndIf

Find anything NOT white:

$result = PixelSearch(884,199,1094,408,0x000000,254)
If NOT @ERROR Then
    ConsoleWrite("MATCH FOUND")
Else
    ConsoleWrite("NO MATCH FOUND")
EndIf
Edited by weaponx

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

See here:

#491281

Find anything NOT black:

$result = PixelSearch(884,199,1094,408,0xFFFFFF,254)
If NOT @ERROR Then
    ConsoleWrite("MATCH FOUND")
Else
    ConsoleWrite("NO MATCH FOUND")
EndIf

Find anything NOT white:

$result = PixelSearch(884,199,1094,408,0x000000,254)
If NOT @ERROR Then
    ConsoleWrite("MATCH FOUND")
Else
    ConsoleWrite("NO MATCH FOUND")
EndIf

the thing is... i want the pixelsearch to RETURN a COordinate to me.. once it find something not white, i will make it click it

PixelSearch(884,199,1094,408,0x000000,254)

then once it find the coord, Mouseclick ( "left", xxx,xxx)

so the point is , find the monster, and click it, the monster shape and size will vary, but always remain in same region.

edit: so... according to u, i should

$result = PixelSearch(884,199,1094,408,0x000000,254)
if not @ error then
mouseclick ("left" , $result[0], $result[1])
endif

like tat?

Edited by DNnlee

Share this post


Link to post
Share on other sites

PixelSearch returns an array with the coordinates and my code uses PixelSearch() so it inherently does this task.

Share this post


Link to post
Share on other sites

PixelSearch returns an array with the coordinates and my code uses PixelSearch() so it inherently does this task.

i used it, and it did a weird thing

$result = PixelSearch ( 196 , 262 , 290 , 331 , 0x000000 , 254 )
if not @error then
mouseclick ("left" , $result[0], $result[1])
endif

it searches for it i guess,.. but when it click.. it is always 1 pixel off.. it moves teh mouse RIght NExt to the non-white and clicks...

Share this post


Link to post
Share on other sites

The clicked pixel probably isn't white. It may look white but it is probably not 0xFFFFFF. If its a real problem just add 1 to the X and Y coordinates.

Share this post


Link to post
Share on other sites

The clicked pixel probably isn't white. It may look white but it is probably not 0xFFFFFF. If its a real problem just add 1 to the X and Y coordinates.

wow , i just took a look with the au3info program.... the monsters have a coating of wierd colors which looks white... but can't be clicked...

i guess i gotta x+1 and y+1?

Share this post


Link to post
Share on other sites

Well you can do that or use the window info tool to identify a unique color of the monster, without the PixelSearch() shade parameter.

Share this post


Link to post
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
Sign in to follow this  
Followers 0