Sign in to follow this  
Followers 0
etaliken

Question about "PixelSearch" function

3 posts in this topic

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

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

I will try and give a feedback thanks anyways :)

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