Jerry, I unchecked all plugins. It is the "Custom Rel..." I copied and pasted your code and I still get the same error message.
"Halscript error on line 1816 col. 0:Type mismatch: 'WC'
'Function Count Words (CW)
Line 1816 CW = WC(UserSentence)
'Custom Relavence For Universal GetResponse.
'This function tries to match as many words between GetResponse and the OriginalSentence.
For i = 1 To CW
If i > 0 Then SearchIt = "* " + SearchIt
SearchIt = Replace(SearchIt, vbCrLf, Chr(
![Cool 8)](https://www.ultrahal.com/community/Smileys/default/cool.gif)
& " ", 1, - 1, vbTextCompare)
SearchIt = Replace(SearchIt, "", "", 1, - 1, vbTextCompare)
SearchIt = Replace(SearchIt, " ", " ", 1, - 1, vbTextCompare)
Next
TemUserSent = OriginalSentence
For i = 1 To CW
If i > 0 Then PatternRel = HalBrain.SearchPattern(TemUserSent, SearchIt, i)
PatternRel = Trim(Ucase(PatternRel))
PatternRel2 = HalBrain.ExtractKeywords(PatternRel)
PatternRel3 = HalBrain.AlphaNumericalOnly(PatternRel2)
HalsResponse = Trim(Ucase(GetResponse))
KeyHalWord = HalBrain.ExtractKeywords(HalsResponse)
KeyHalWord2 = HalBrain.AlphaNumericalOnly(KeyHalWord)
If InStr(1, KeyHalWord2, PatternRel3, vbTextCompare) > 0 Then PattBrainRel = 1 + PattBrainRel Else PattBrainRel = 0
'Here we use the custom relavence for any Universal GetResponse.
PatternRelavance = FormatPercent(PattBrainRel/CW)
'PatternRel uses a Percentage scale to match the GetResponse to a OriginalSentence.
'The more matches found the higher the PatternRelavance in percentage will be, 100 would
'be a 100% match, we try to avoid 100% matches because it could be a repeat of the User for the response.
'We try to maintain a PatternRelavance between 20% and 80% for percentage matches.
'PatternRelavance finds these percentages by adding the number of matched keywords divided by the number of words
'in the user's sentence.
If (PatternRelavance >= "20" And PatternRelavance <= "80") And HalBrain.CheckRepetition(GetResponse, PrevSent) = False Then GetResponse = HalsResponse Else GetResponse = GetResponse & ShortPhrase
Next