02-24-2015, 07:50 AM
I'm trying to install a Smashed TH check into the algorithmTH.au3 module.
Been staring at the other modules that call the _ImageSearch function in ImageSearch.au3 and can't get a valid response or coordinates from _ImageSearch?
After staring at 3-4 dozen images of smashed TH, it seems they all look same regardless of the TH level.
Have tried several sizes/shapes of images cut directly from saved attack images. They are stored in BMP, and the 1 pixel tall version is same size as the TH check image. But I NEVER find a match even with 20% tolerance. I'm ready to give up.
I am sure its some kind of noob mistake, can anyone help?
Been staring at the other modules that call the _ImageSearch function in ImageSearch.au3 and can't get a valid response or coordinates from _ImageSearch?
After staring at 3-4 dozen images of smashed TH, it seems they all look same regardless of the TH level.
Have tried several sizes/shapes of images cut directly from saved attack images. They are stored in BMP, and the 1 pixel tall version is same size as the TH check image. But I NEVER find a match even with 20% tolerance. I'm ready to give up.
I am sure its some kind of noob mistake, can anyone help?
Code:
Func CheckSmashedTownhall()
Local $SmashedThx, $SmashedTHy
If _Sleep(100) Then Return
_CaptureRegion()
$IsTHSmashed = _ImageSearch($SmashedTH, 1, $SmashedTHx, $SmashedTHy, 20) ; Getting smashed TH Location
If $DebugTH = True Then
SetLog("Check1 Smashed TH returned: " & $IsTHSmashed & ", " & $SmashedTHx & ", " & $SmashedTHy, $COLOR_BLUE)
EndIf
If $IsTHSmashed = 1 Then
Return 1
EndIf
If $IsTHSmashed = 0 Then Return "-"
EndFunc