DNnlee Posted April 16, 2008 Posted April 16, 2008 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?
litlmike Posted April 16, 2008 Posted April 16, 2008 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. _ArrayPermute()_ArrayUnique()Excel.au3 UDF
weaponx Posted April 16, 2008 Posted April 16, 2008 (edited) See here:#491281Find anything NOT black:$result = PixelSearch(884,199,1094,408,0xFFFFFF,254) If NOT @ERROR Then ConsoleWrite("MATCH FOUND") Else ConsoleWrite("NO MATCH FOUND") EndIfFind 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 April 16, 2008 by weaponx
DNnlee Posted April 16, 2008 Author Posted April 16, 2008 (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 April 16, 2008 by DNnlee
weaponx Posted April 16, 2008 Posted April 16, 2008 PixelSearch returns an array with the coordinates and my code uses PixelSearch() so it inherently does this task.
DNnlee Posted April 16, 2008 Author Posted April 16, 2008 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...
weaponx Posted April 16, 2008 Posted April 16, 2008 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.
DNnlee Posted April 16, 2008 Author Posted April 16, 2008 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?
weaponx Posted April 16, 2008 Posted April 16, 2008 Well you can do that or use the window info tool to identify a unique color of the monster, without the PixelSearch() shade parameter.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now