BUG:
In v7 (and all previous), in function _ImageSearchArea(), line 1405 (v7), the If statement is never closed. It should look like this:
Code:
If $tolerance > 0 Then $findImage = "*" & $tolerance & " " & $findImage EndIf
What is happening is that the function can only return true if tolerance is greater than 0. This is fine for most calls in the script, EXCEPT the check to see if your gear has changed before vendoring or salvaging. In those cases, the DLL is never even called.
An even better fix would be proper formatting of code, so that errors like this are obvious, especially in a VB based language that requires conditional closes for one statement branches. Here is what the function should look like:
Code:
Func _ImageSearchArea($findImage, $resultPosition, $x1, $y1, $right, $bottom, ByRef $x, ByRef $y, $tolerance)
If $tolerance > 0 Then
$findImage = "*" & $tolerance & " " & $findImage
EndIf
$findImage = "*TRANSBLACK " & $findImage
If @AutoItX64 Then
$result = DllCall("ImageSearchDLL_x64.dll", "str", "ImageSearch", "int", $x1, "int", $y1, "int", $right, "int", $bottom, "str", $findImage)
Else
$result = DllCall("ImageSearchDLL.dll", "str", "ImageSearch", "int", $x1, "int", $y1, "int", $right, "int", $bottom, "str", $findImage)
EndIf
; get the x,y location of the match and the size of the image to
; compute the centre of search
$array = StringSplit($result[0], "|")
If (UBound($array) >= 4) Then ; false if result was "0"
$x = Int(Number($array[2]))
$y = Int(Number($array[3]))
If $resultPosition = 1 Then
$x = $x + Int(Number($array[4]) / 2)
$y = $y + Int(Number($array[5]) / 2)
EndIf
Return 1
EndIf
Return 0
EndFunc ;==>_ImageSearchArea
I got rid of a useless conditional and made an explicit return on failure.