Sign in to follow this  
Followers 0
sandman

Check for a color and then click where that color is?

6 posts in this topic

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]

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

very simple :whistle:

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

Share this post


Link to post
Share on other sites

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]

Share this post


Link to post
Share on other sites

I have had much help from the autoit community, so its time to help others :whistle:

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

Share this post


Link to post
Share on other sites

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]

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