Jump to content

need help with pixel search


Recommended Posts

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?

Link to comment
Share on other sites

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

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

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

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