Ok, keep the script this way, but replace the whole "Func scanMap()" block (it's long...make sure to replace everything until you see the first "EndFunc") with this one, then go again to a tile with adamantium and run the script:
Func scanMap()
;#comments-start
; Check for embarkability first
If Not checkPattern($embarkability, 200, 552, 210, 576) Then
notifyUser("Info", "Region is not embarkable")
Return False
EndIf
;#comments-end
; Now check for regional prospector tiles as selected in global settings
$pass = True
; Prepare the positional array
$pos = 0
; Look for adamantium
If Not($adamantium_feature = "ignore") AND ($pass = True) Then
notifyUser("Info", "Entered into adamantium check branch")
$found = findPattern($adamantium_pattern, $features_found, 1)
If $found > 0 Then
notifyUser("Info", "Adamantium found")
$features_found[$found] = -1
$positions[$pos] = $features_found
$pos += 1
EndIf
If $adamantium_feature = "yes" Then
If $found > 0 Then
$pass = True
Else
Return False
EndIf
Else
If $found > 0 Then
Return False
Else
$pass = True
EndIf
EndIf
EndIf
; Look for chasms
If Not($chasm_feature = "ignore") AND ($pass = True) Then
$found = findPattern($chasm_pattern, $features_found, 0)
If $found > 0 Then
$features_found[$found] = -1
$positions[$pos] = $features_found
$pos += 1
EndIf
If $chasm_feature = "yes" Then
If $found > 0 Then
$pass = True
Else
Return False
EndIf
Else
If $found > 0 Then
Return False
Else
$pass = True
EndIf
EndIf
EndIf
; Look for magma vents
If Not($magmavent_feature = "ignore") Then
$found = findPattern($magmavent_pattern, $features_found, 0)
If $found > 0 Then
$features_found[$found] = -1
$positions[$pos] = $features_found
$pos += 1
EndIf
If $magmavent_feature = "yes" Then
If $found > 0 Then
$pass = True
Else
$pass = False
EndIf
Else
If $found > 0 Then
$pass = False
Else
$pass = True
EndIf
EndIf
EndIf
; Look for magma pools
If Not($magmapool_feature = "ignore") AND Not(($magma_combination = "both") AND ($pass = False)) Then
; If we don't care what kind of magma we find, put found tiles of vents and pools in the same array (necessary because of recursive checkDistance function)
If ($magma_combination = "any") AND Not($magmavent_feature = "ignore") AND ($found > 0) Then
$last_found = $found
$last_features = $features_found
$found = findPattern($magmapool_pattern, $features_found, 0)
If $found > 0 Then
For $cell = 0 To $last_found - 1
$features_found[$found + $cell] = $last_features[$cell]
Next
$features_found[$found + $last_found] = -1
$positions[$pos - 1] = $features_found
EndIf
Else
$found = findPattern($magmapool_pattern, $features_found, 0)
If $found > 0 Then
$features_found[$found] = -1
$positions[$pos] = $features_found
$pos += 1
EndIf
EndIf
If $magmapool_feature = "yes" Then
If $found > 0 Then
$pass = True
Else
If ($magma_combination = "any") AND ($pass = True) Then
$pass = True
Else
Return False
EndIf
EndIf
Else
If $found > 0 Then
Return False
Else
$pass = True
EndIf
EndIf
EndIf
If $pass = False Then
return False
EndIf
; Look for cave lakes
If Not($cavelake_feature = "ignore") AND ($pass = True) Then
$found = findPattern($cavelake_pattern, $features_found, 0)
If $found > 0 Then
$features_found[$found] = -1
$positions[$pos] = $features_found
$pos += 1
EndIf
If $cavelake_feature = "yes" Then
If $found > 0 Then
$pass = True
Else
$pass = False
EndIf
Else
If $found > 0 Then
$pass = False
Else
$pass = True
EndIf
EndIf
EndIf
; Look for cave rivers
If Not($caveriver_feature = "ignore") AND Not(($cavewater_combination = "both") AND ($pass = False)) Then
; If we don't care what kind of cavewater we find, put found tiles of lakes and rivers in the same array (necessary because of recursive checkDistance function)
If ($cavewater_combination = "any") AND Not($cavelake_feature = "ignore") AND ($found > 0) Then
$last_found = $found
$last_features = $features_found
$found = findPattern($caveriver_pattern, $features_found, 0)
If $found > 0 Then
For $cell = 0 To $last_found - 1
$features_found[$found + $cell] = $last_features[$cell]
Next
$features_found[$found + $last_found] = -1
$positions[$pos - 1] = $features_found
EndIf
Else
$found = findPattern($caveriver_pattern, $features_found, 0)
If $found > 0 Then
$features_found[$found] = -1
$positions[$pos] = $features_found
$pos += 1
EndIf
EndIf
If $caveriver_feature = "yes" Then
If $found > 0 Then
$pass = True
Else
If ($cavewater_combination = "any") AND ($pass = True) Then
$pass = True
Else
Return False
EndIf
EndIf
Else
If $found > 0 Then
Return False
Else
$pass = True
EndIf
EndIf
EndIf
; Set the end delimiter in the positional array
$positions[$pos] = -1
; Look for distance between tiles
If $pass = False Then
Return False
Else
Global $erX1 = 255
Global $erY1 = 255
Global $erX2 = -1
Global $erY2 = -1
;Return checkDistance(0)
Return True
EndIf
EndFunc