Jump to content
Sign in to follow this  
ciraco

Pixel/Color detection?

Recommended Posts

ciraco

I am looking to create a bot that will find a specific color on your scree, then click X number of pixels down from the pixel that was found with the color.

Could anyone help me?

Share this post


Link to post
Share on other sites
Paulie

I am looking to create a bot that will find a specific color on your scree, then click X number of pixels down from the pixel that was found with the color.

Could anyone help me?

RTFM!!

Pixelsearch()

Share this post


Link to post
Share on other sites
ciraco

RTFM!!

Pixelsearch()

Yeah I did a search on the forum and I found a script that does color search, but I dont know the varieables as to how to make it find a specific color and what not

Sleep (5000)
Send("L")
Sleep (1000)
MouseClick("left")
Sleep (1000)

While 1
    $coor = PixelSearch( 129, 104, 423, 169, 0x3489e3, 2, 2 )
    If @error = 0 Then
        Opt("SendKeyDownDelay", 300000);will hold Space down for 5 min or until pixelcolor changes ??
        Send("{SPACE}")
        While 1
            $coor = PixelSearch( 129, 104, 423, 169, 0x3489e3, 2, 2 )
            If @error = 1 Then
                Opt("SendKeyDownDelay", 5)
                Send("{SPACE}")
                ExitLoop
            eNDiF
        Wend
    EndIf
Wend

Share this post


Link to post
Share on other sites
Paulie

Damn me and my generosity... :)

$Color = 0xFF0000;Color to search for (Red)
$Offset = 10 ; Clicks 10 pixels lower than the found pixel

While 1
$Search = PixelSearch(0,0,@Desktopwidth,@Desktopheight,$Color);Searches whole screen (From (0,0) to (Width,Height)) for color
If not @error then MouseClick("Left", $Search[0],$Search[1]+$Offset, 1,0)
WEnd

Share this post


Link to post
Share on other sites
ciraco

thats alot, but one more question. How would I make the bot hit the tilde button (`/~)?

Like this?

Send("`")

or

Send("~")

or

Send("{TILDE}")

??

Share this post


Link to post
Share on other sites
qazwsx

have u checked the helpfile?

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  

×