Jump to content

Question about "PixelSearch" function


etaliken
 Share

Recommended Posts

I started some days ago with Autoit and now i want to crate a profile which searchs in an area for the color read.

I wachted for such an command and found this:

; Find a pure red pixel in the range 0,0-20,300

$coord = PixelSearch( 0, 0, 20, 300, 0xFF0000 )

If Not @error Then

MsgBox(0, "X and Y are:", $coord[0] & "," & $coord[1])

EndIf

Is it possible with this command to create an skript like this:

1. Search in Area for Red

2. If Red is not found do this:

for example push "A"

Jump to 1 and check again for red

3. If red is found do this:

for example push "B"

_______________

I Hope i described what i want and that you can help me.

If it is possible plz write me how i can make such an skript.

Thanks for your time

Etaliken

Link to comment
Share on other sites

Ofc.

While True
; Find a pure red pixel in the range 0,0-20,300
$coord = PixelSearch(0, 0, 20, 300, 0xFF0000)
If @error Then
  ; The Color doesn't found, do the stuffs here
  ;and the script will run again coz it's in a while loop
Else
  ; We found the color, do what ever you want here.
  ExitLoop ; to exit the while loop
EndIf
WEnd
;~ More codes here that execute when the color found and the ExitLoop command executed.
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...