'A Work of Art. for all you scrip-tors who like to scribe, lol
'This Script removes duplicate responses inside a full GetResponse.
'updated
'added punctuation adjustments for periods with no space trailing.
'The Script & help.
'Compliments of the Edge.
'Remove duplicate responses from full getresponse.
'Usually more effective near the bottom of all getresponses.
'This routine does work for all responses, PrevSent, PrevUserSent
'OriginalSentence and UserSentence i.e GetResponse.
HalString = GetResponse', <-- change this to what you want cleaned.
GetResponse = "" 'temporaraly suspend getresponse for cleaning.
Set oDict = CreateObject("Scripting.Dictionary")
oDict.CompareMode = vbTextCompare
For Each Sentence In Split(HalString, ". ")
oDict(Sentence) = Null
Next
MasterResponse = Join(oDict.Keys, ". ")
'Adjust for punctuation.
MasterResponse = Replace(MasterResponse, " ", " ", 1, - 1, vbTextCompare)
MasterResponse = Replace(MasterResponse, ".", ". ", 1, -1, vbTextCompare)
MasterResponse = Replace(MasterResponse, " ", " ", 1, -1, vbTextCompare)
GetResponse = MasterResponse', <-- all duplicate entries in Getresponse
'are removed before the response is given.
GetResponse = GetResponse & vbCrLf
Set oDict = Nothing
HalBrain.DebugWatch MasterResponse, "MasterResponse"
this script works best between Rem PLUGIN: PLUGINAREA7 and
Rem PLUGIN: CUSTOMMEM2 in the Hal Brain Editor. to catch as many
GetResponses as possible. assembled getresponses act differently because
of word assembly differences. if there is 1% difference between
compares the script will consider it as being different and not remove it
from the getresponse list. but it will be different.
always make a backup, even if you are experienced.
download below to your Ultra Hal 6 or 7 folder
choose plug in brain options.
Happy Holidays and Merry Christmas.
Jerry