Hi vonsmith
I usually just say Hals name when saying the password because the BlockSave will detect Hals name, Like: Hal, Password.
You could include your command for Hal but all you need to do is just include Hals name when you're saying the password and we'd get the same effect from the script that's already in the Brain called:
'PROCESS: BLOCK LEARNING IF HAL'S NAME IS DETECTED
'Here we check to see if the user is calling Hal by name; if the user is doing so,
'it's better not to save the sentence for re-use, since it usually makes the
'pronoun-reversed sentence sound clumsy or incorrect:
BlockSave = False
If InStr(1, UserSentence, ComputerName, vbTextCompare) > 0 Then BlockSave = True
If InStr(1, OriginalSentence, ComputerName, vbTextCompare) > 0 Then BlockSave = True
Thanks for your input, Most appreciated.
Best of wishes and grand new discoveries.
Jerry.
quote:
Originally posted by vonsmith
What I generally do when passing directives to Hal is to include Hal's name in the decoding. For example to command Hal the user must say, "Hal caps Utah". This command sequence is from my Capitalization script. In principle the script might look like:
Command = ComputerName & " caps "
If InStr(1, Trim(OriginalSentence), Command, 1) = 1 Then
[do something]
End If
Note: ComputerName is a Hal brain variable that contains the name you assign your Hal.
1) One advantage of including Hal's name (whatever you name him/her) is that Hal has script to block saving the user input to brn files if his name is used. This prevents non-dialog sentences or odd grammar from being saved to brn files.
2) Also Hal's name combined with a non-dialog sounding word should make a unique combination that shouldn't occur accidentally. For example "Hal caps " is not likely to occur in a normal dialog.
Therefore my suggestion is something like:
Command = ComputerName & " eject CD "
If InStr(1, Trim(OriginalSentence), Command, 1) = 1 Then
[eject CD script]
End If
Trimming the UserSentence removes spaces at the beginning and end of the sentence. If the InStr(...) command equals 1 then the ComputerName must start at position 1 in the sentence. Therefore the sequence *must* be "Hal eject CD ". The sequence, "Please Hal eject CD " wouldn't eject the CD. Testing the OriginalSentence variable instead of the UserSentence insures that the "Reverse Person" and other mod's made to UserSentence don't confuse detection of the command phrase. OriginalSentence contains the user's sentence without any mod's.
Just my 2 cents...
= vonsmith =