'x=x=x=x=x=x=x=x==vonsmith==x=x=x=x=x=x=x=x=x 'In Ultra Hal Assistant v5.0 the "POST PROCESS: SAVE HAL'S RESPONSE" ' function should precede this function. ' 'PROCESS: HAL CALLS USER BY NICKNAME 'This is an entirely new function written by =vonsmith= , version 11-14-03a. ' 'This function lets the user specify one or more nicknames that the user wishes 'to be called by Hal. The nicknames are stored in a user specific self generated file 'called UserNickname.brn. If more than one nickname is specified then Hal 'will randomly choose one of the nicknames from the UserNickname.brn file. 'If a nickname is specified then the default Hal Assistant username will no longer be used 'when Hal speaks to the user, however the default username is still used for assigning 'user filenames and all other normal Hal functions. If the user wants to be called by 'his/her default Hal Assistant username then just add it as a nickname. If the user 'prefers to be called one nickname more often than another then just add that nickname 'multiple times. The more times the user adds a nickname the more likely that nickname 'will be used. The function does not affect any other Hal brain operations or files. 'To get rid of the nicknames delete the UserNickname.brn file. If InStr(1, GetResponse, "", vbTextCompare) > 0 Then Nickname = HalBrain.ChooseSentenceFromFile(WorkingDir & "X" & Trim(UserName) & "UserNickname.brn") If Len(Nickname) > 0 Then GetResponse = Replace(GetResponse, "", Nickname, 1, -1, vbTextCompare) End If 'Save nickname when the user says, " nickname [nickname]", Example: Hal nickname Buzz. TestSentence = Replace(OriginalSentence, " ", " ", 1, -1, vbTextCompare) 'Replace multiple spaces with one. If InStr(1, TestSentence, ComputerName & " " & "NICKNAME ", vbTextCompare) = 1 Then TestSentence = HalBrain.AlphaNumericalOnly(OriginalSentence) TestSentence = Trim(TestSentence) NickStart = Instr(1, TestSentence, "NICKNAME ", vbTextCompare) + Len("NICKNAME ") Nickname = Mid(TestSentence, NickStart, (Len(TestSentence) - NickStart) + 1) Nickname = Trim(Nickname) If Len(Nickname) > 0 Then HalBrain.AppendFile WorkingDir & "X" & Trim(UserName) & "UserNickname.brn", Nickname & vbCrLf & Nickname GetResponse = "" & "! I'll remember your nickname " & Nickname & ". " & GetResponse End If End If ' 'In Ultra Hal Assistant v5.0 the "POST PROCESS: PRESERVE ALL VARIABLES" ' function should follow this function. 'x=x=x=x=x=x=x=x==vonsmith==x=x=x=x=x=x=x=x=x