Hello I have followed the instructions but I cannot seem to get it to work. Below I have copied the instrustions from the posting(s) with a copy of the code actually in place.
I cannot see what I have done wrong.
I hope someone can help. I am not into programming so I have probally done somthing obvious mistake.
Many thanks.
----------------------------------------------------------------------------------------------
Just place the bulk of the code just above: 'PROCESS: REVERSE CERTAIN CONTRACTIONS AND OTHER SUBSTITUTIONS
============
sponse = Replace(RepeatResponse, "<response>", GetResponse, 1, -1, vbTextCompare)
DebugInfo = DebugInfo & "Hal has noticed he is repeating himself and has made a comment about it: " & GetResponse & vbCrLf
End If
'RESPOND: MAKE COMMENTS ABOUT SHORT PHRASES
GetResponse = GetResponse & ShortPhrase
'Ziggy Pro Bot, Correct Spelling on the fly.
'Search for teaching on how to actually spell a word.
'Example: Pleeze is spelled Please.
If CorSpelLeft = "" Then CorSpelLeft = HalBrain.SearchPattern(UserSentence, "* IS SPELLED *", 1)
If CorSpelRight = "" Then CorSpelRight = HalBrain.SearchPattern(UserSentence, "* IS SPELLED *", 2)
If CorSpelLeft = "" Then CorSpelLeft = HalBrain.SearchPattern(UserSentence, "THE CORRECT WAY TO SPELL * IS *", 1)
If CorSpelRight = "" Then CorSpelRight = HalBrain.SearchPattern(UserSentence, "THE CORRECT WAY TO SPELL * IS *", 2)
If CorSpelLeft = "" Then CorSpelLeft = HalBrain.SearchPattern(UserSentence, "I MISPELLED * IT IS SPELLED *", 1)
If CorSpelRight = "" Then CorSpelRight = HalBrain.SearchPattern(UserSentence, "I MISPELLED * IT IS SPELLED *", 2)
If CorSpelLeft = "" Then CorSpelLeft = HalBrain.SearchPattern(UserSentence, "IT IS NOT SPELLED * IT IS SPELLED *", 1)
If CorSpelRight = "" Then CorSpelRight = HalBrain.SearchPattern(UserSentence, "IT IS NOT SPELLED * IT IS SPELLED *", 2)
If CorSpelLeft = "" Then CorSpelLeft = HalBrain.SearchPattern(UserSentence, "THE WORD * IS SPELLED *", 1)
If CorSpelRight = "" Then CorSpelRight = HalBrain.SearchPattern(UserSentence, "THE WORD * IS SPELLED *", 2)
If CorSpelLeft = "" Then CorSpelLeft = HalBrain.SearchPattern(UserSentence, "THE WORD * IS SPELLED * CORRECTLY", 1)
If CorSpelRight = "" Then CorSpelRight = HalBrain.SearchPattern(UserSentence, "THE WORD * IS SPELLED * CORRECTLY", 2)
If CorSpelLeft = "" Then CorSpelLeft = HalBrain.SearchPattern(UserSentence, "THE WORD * IS CORRECTLY SPELLED *", 1)
If CorSpelRight = "" Then CorSpelRight = HalBrain.SearchPattern(UserSentence, "THE WORD * IS CORRECTLY SPELLED *", 2)
If CorSpelLeft = "" Then CorSpelLeft = HalBrain.SearchPattern(UserSentence, "THE PROPER WAY TO SPELL * IS SPELLED *", 1)
If CorSpelRight = "" Then CorSpelRight = HalBrain.SearchPattern(UserSentence, "THE PROPER WAY TO SPELL * IS SPELLED *", 2)
If CorSpelLeft = "" Then CorSpelLeft = HalBrain.SearchPattern(UserSentence, "* IS NOT A WORD, IT IS SPELLED *", 1)
If CorSpelRight = "" Then CorSpelRight = HalBrain.SearchPattern(UserSentence, "* IS NOT A WORD, IT IS SPELLED *", 2)
If CorSpelLeft = "" Then CorSpelLeft = HalBrain.SearchPattern(UserSentence, "* IS NOT A WORD, IT IS SPELLED * TO BE CORRECT", 1)
If CorSpelRight = "" Then CorSpelRight = HalBrain.SearchPattern(UserSentence, "* IS NOT A WORD, IT IS SPELLED * TO BE CORRECT", 2)
If CorSpelLeft = "" Then CorSpelLeft = HalBrain.SearchPattern(UserSentence, "* IS NOT A WORD, IT IS SPELLED * TO BE PROPER", 1)
If CorSpelRight = "" Then CorSpelRight = HalBrain.SearchPattern(UserSentence, "* IS NOT A WORD, IT IS SPELLED * TO BE PROPER", 2)
If CorSpelLeft = "" Then CorSpelLeft = HalBrain.SearchPattern(UserSentence, "* IS PROPERLY SPELLED *", 1)
If CorSpelRight = "" Then CorSpelRight = HalBrain.SearchPattern(UserSentence, "* IS PROPERLY SPELLED *", 2)
If CorSpelLeft = "" Then CorSpelLeft = HalBrain.SearchPattern(UserSentence, "THE CORRECT WAY FOR I TO SPELL * IS *", 1)
If CorSpelRight = "" Then CorSpelRight = HalBrain.SearchPattern(UserSentence, "THE CORRECT WAY FOR I TO SPELL * IS *", 2)
If CorSpelLeft = "" Then CorSpelLeft = HalBrain.SearchPattern(UserSentence, "THE CORRECT WAY FOR I TO SPELL * IS SPELLED *", 1)
If CorSpelRight = "" Then CorSpelRight = HalBrain.SearchPattern(UserSentence, "THE CORRECT WAY FOR I TO SPELL * IS SPELLED *", 2)
If CorSpelLeft = "" Then CorSpelLeft = HalBrain.SearchPattern(UserSentence, "* IS IMPROPER SPELLING, IT IS SPELLED *", 1)
If CorSpelRight = "" Then CorSpelRight = HalBrain.SearchPattern(UserSentence, "* IS IMPROPER SPELLING, IT IS SPELLED *", 2)
'If a taught spelling correction is detected then save it to getresponse corrections.
If HalBrain.CheckTableExistence("correctionsII") = False Then HalBrain.CreateTable "correctionsII", "TopicSearch", ""
If CorSpelLeft <> "" And CorSpelRight <> "" And Len(CorSpelLeft) > 0 And Len(CorSpelRight) > 0 Then
HalBrain.AddToTable "correctionsII", "TopicSearch", Trim(CorSpelLeft), Trim(CorSpelRight)
Select Case (Int(Rnd * 6) + 1)
Case 1
GetResponse = "I will have to remember that is the way to spell it." & vbCrLf
Case 2
GetResponse = "Thanks for correcting me on that word" & ". " & vbCrLf
Case 3
GetResponse = "I'll have to make a note of that." & vbCrLf
Case 4
GetResponse = "So that's the way to spell it." & vbCrLf
Case 5
GetResponse = "I did not know that, thanks." & vbCrLf
Case 6
GetResponse = "Well, I won't be misspelling that word again, thanks." & vbCrLf
End Select
End If
'PROCESS: REVERSE CERTAIN CONTRACTIONS AND OTHER SUBSTITUTIONS
'Standardizing on contractions can make Hal sound conversational.
'However, certain sentence constructions don't work well
'
-------------------------------------------------------------------------------------------
'Add this code section below to: 'PROCESS: REVERSE CERTAIN CONTRACTIONS AND OTHER SUBSTITUTIONS 'Ziggy Pro Bot Corrections.
GetResponse = HalBrain.ProcessSubstitutions(GetResponse, "correctionsII")
================
'PROCESS: REVERSE CERTAIN CONTRACTIONS AND OTHER SUBSTITUTIONS
'Standardizing on contractions can make Hal sound conversational.
'However, certain sentence constructions don't work well
'if expressed as contractions. For example:
'"I don't know where it is" becomes "I don't know where it's."
'For another example, "That's how he is" becomes "That's how he's."
'To solve these types of cases
'we attempt to modify certain contractions, words, and phrases
'at the end of this function, now that Hal's thinking is done.
GetResponse = HalBrain.HalFormat(GetResponse)
GetResponse = HalBrain.ProcessSubstitutions(GetResponse, "corrections")
GetResponse = HalBrain.ProcessSubstitutions(GetResponse, "correctionsII")
'PROCESS: CALL USER BY CORRECT NAME
'If the user has chosen a nickname or tempor
---------------------------------------------------------------------
'And add this to: PROCESS: WORD AND PHRASE SUBSTITUTIONS
UserSentence = HalBrain.ProcessSubstitutions(UserSentence, "correctionsII")
==================
'Almost all of Hal's thinking is done in caps.
UserSentence = UCase(UserSentence)
'PROCESS: WORD AND PHRASE SUBSTITUTIONS
'This will fix common errors in the user's sentence that the
'HalFormat function didn't take care of. These subsitutions are
'placed only the users sentence, not on Hal's responses. The
'HalFormat function is used on both Hal's and the user's sentences
'throughout the script.
UserSentence = HalBrain.ProcessSubstitutions(UserSentence, "substitutions")
TempParent = HalBrain.AddDebug("Debug", "Modified User Sentence")
HalBrain.AddDebug TempParent, "Sentence: " & UserSentence
UserSentence = HalBrain.ProcessSubstitutions(UserSentence, "correctionsII")
'PROCESS: EMOTIONAL REACTIONS
'We enable Hal's expressions to respond to common verbal