Jump to content

Pixel help


Recommended Posts

f okay if the pixel is not red blue or white to first get pixel color then return pixel color to a variable then click untill the color of the pixel changes please help with this i just need an example im just useing red blue and white as an example

Edited by d3m0n
Link to comment
Share on other sites

f okay if the pixel is not red blue or white to first get pixel color then return pixel color to a variable then click untill the color of the pixel changes please help with this i just need an example im just useing red blue and white as an example

Can no one help me?

Link to comment
Share on other sites

This will get the color of the pixel under your mouse cursor and check if it is red, blue, or white. If it isn't, it will click 10 times per second until the color is red, blue, or white. If the color is ever red, blue, or white, a message box will inform you and the program will close. Hold escape to exit the program.

Note that it is set to work with pure red, blue, and white. If your colors are only slightly off, they will not be detected and it will click forever. So if you are looking for pure red, blue, or white, then you're all set. Otherwise, you need to specify your own colors.

I'm sure there is a better alternative, but this is what I could think of.

#Include <misc.au3>

Global $color, $mousepos
Global Const $red = "0000FF"
Global Const $blue = "FF0000"
Global Const $white = "FFFFFF"

While 1
    If _IsPressed("1B") Then Exit
    $mousepos = MouseGetPos()
    $color = Hex(PixelGetColor($mousepos[0], $mousepos[1]), 6)
    If $color = $red Or $color = $blue Or $color = $white Then
        MsgBox(262160, "Found!", $color & " found. Exiting", 1)
        Exit
    Else
        MouseClick("primary")
    EndIf
    Sleep(100)
Wend
Edited by Vakari
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...