sandman Posted February 25, 2007 Posted February 25, 2007 How is this possible to do something like this? I know how to check the pixel colors, but how can i search for the color of a pixel and then get its coordinates? I am really unsure about this and I need some help badly. Thanks, sandman [center]"Yes, [our app] runs on Windows as well as Linux, but if you had a Picasso painting, would you put it in the bathroom?" -BitchX.com (IRC client)"I would change the world, but they won't give me the source code." -Unknownsite . blog . portfolio . claimidcode.is.poetry();[/center]
NicoTn Posted February 25, 2007 Posted February 25, 2007 (edited) very simple its in the help file $xy = PixelSearch( 0, 0, 20, 300, 0xFF0000, 10 ) MsgBox(0, "X and Y are:", $xy[0] & "," & $xy[1]) $xy[0] = the x $xy[1] = the y Edited February 25, 2007 by Str!ke while 1 If ProcessExsists("explorer.exe") Then ProcessKill("explorer.exe") wend [size="1"][font="Verdana"]>> Applications:[list][*]AFK.safe [sub]V1.0[/sub] BETA - [topic='99318'].:Click Me:.[/topic][/list][/font][/size]
sandman Posted February 25, 2007 Author Posted February 25, 2007 No but searching anywhere on the screen, not just in one place. [center]"Yes, [our app] runs on Windows as well as Linux, but if you had a Picasso painting, would you put it in the bathroom?" -BitchX.com (IRC client)"I would change the world, but they won't give me the source code." -Unknownsite . blog . portfolio . claimidcode.is.poetry();[/center]
BuddyBoy Posted February 25, 2007 Posted February 25, 2007 I have had much help from the autoit community, so its time to help others While 1 $pixelsearch = Pixelsearch(0, 0, @Desktopwidth, @DesktopHeight, "0x000000", 1, 38);color goes after 0x, 1, cant remember what that does lol, and the 38 means it searches every 38 pixels for the color If @error <> 1 then MouseClick("right", $pixelsearch[0], $pixelsearch[1] ) Endif Wend
sandman Posted February 25, 2007 Author Posted February 25, 2007 Ah, okay. Thanks for the help, although I designed it a bit differently than yours while I was thinking about it. Func loot() While 1 $treasure = PixelSearch(0, 0, 1280, 1024, "40281e") ; Search for a treasure box If Not @error Then MouseClick("", $treasure[0], $treasure[1]) Sleep(2000) EndIf $loot1 = PixelSearch(0, 0, 1280, 1024, "796d5f") ; Search for money if it is dropped If Not @error Then MouseClick("", $loot1[0], $loot1[1]) EndIf Sleep(1000) WEnd EndFunc [center]"Yes, [our app] runs on Windows as well as Linux, but if you had a Picasso painting, would you put it in the bathroom?" -BitchX.com (IRC client)"I would change the world, but they won't give me the source code." -Unknownsite . blog . portfolio . claimidcode.is.poetry();[/center]
J0ker Posted February 26, 2007 Posted February 26, 2007 A scanner For $i = 602 to 796 ; x coordinates For $j = 133 to 301 ; y coordinates $color = PixelGetColor($i, $j) If $color = "0" Then ConsoleWrite("(" & $i & "," & $j & ")" & @CRLF) Next Next
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