# PixelSearch Continue

## Recommended Posts

Hello, basically.. I want PixelSearch to continue where it left off after it got it's first match so I can continue to find more matches. Is this possible? If so, how?

##### Share on other sites

Hello, basically.. I want PixelSearch to continue where it left off after it got it's first match so I can continue to find more matches. Is this possible? If so, how?

PixelSearch() returns X/Y coordinates. Do the math on the remaining portion of the rectangle and finish the search. You could also search one vertical or horizontal line at a time in a For/Next loop, and then just ContinueLoop.

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

##### Share on other sites

Just taking a quick stab at this since I have nothing better to do

```Func _PixelSearchContinue(\$left, \$top, \$right, \$bottom, \$color, \$x = -1, \$y = -1, \$shadevar = -1, \$step = -1, \$hwnd = -1)
Local \$ret
If \$y = -1 Then \$y = \$top
If \$x = -1 Then
\$x = \$left
Else
\$x += 1
If \$x > \$right Then
\$x = \$left
\$y += 1
If \$y > \$bottom Then Return SetError(1, 0, 0)
EndIf
EndIf
If \$x = \$left Then
\$ret = PixelSearch(\$x, \$y, \$right, \$bottom, \$color, \$shadevar, \$step, \$hwnd)
If @error = 1 Then Return SetError(1, 0, 0)
Return SetError(0, 0, \$ret)
Else
\$ret = PixelSearch(\$x, \$y, \$right, \$y, \$color, \$shadevar, \$step, \$hwnd)
If @error <> 1 Then Return SetError(0, 0, \$ret)
\$y += 1
If \$y > \$bottom Then Return SetError(1, 0, 0)
\$x = \$left
\$ret = PixelSearch(\$x, \$y, \$right, \$bottom, \$color, \$shadevar, \$step, \$hwnd)
If @error = 1 Then Return SetError(1, 0, 0)
Return SetError(0, 0, \$ret)
EndIf
EndFuncoÝ÷ ÙKç±jjey«­¢+Ù±½°ÀÌØí±ÍÑàô´Ä°ÀÌØí±ÍÑäô´Ä°ÀÌØíÁÍ()]¡¥±QÉÕ(\$ÀÌØíÁÍô}A¥á±MÉ¡
½¹Ñ¥¹Õ À°À°ÄÈà°ÄÈà°À°ÀÌØí±ÍÑà°ÀÌØí±ÍÑä¤(%%ÉÉ½ÈôÄQ¡¸á¥Ñ1½½À(%
½¹Í½±]É¥Ñ ÅÕ½Ðì ÅÕ½ÐìµÀìÀÌØíÁÍlÁtµÀìÅÕ½Ðì°ÅÕ½ÐìµÀìÀÌØíÁÍlÅtµÀìÅÕ½Ðì¤ÅÕ½ÐìµÀì
I1¤(\$ÀÌØí±ÍÑàôÀÌØíÁÍlÁt(\$ÀÌØí±ÍÑäôÀÌØíÁÍlÅt)]¹```

If it's not right then it's not far away ...

WBD

## Create an account

Register a new account

×

• Wiki

• Back

• Git