Quixote,
The script I posted before is shown modified below. It is a script that should be placed in the XTF Brain just like any other script. I would place it near the top of the XTF Brain, somewhere around the "RESPOND: TELL JOKE AT USER'S REQUEST" script. It is not part of any other script.
I didn't add in the girder commands because I'm not familiar with them. I *guessed* at the possible commands and inserted them below as an example. You need to start experimenting with Hal and figure out how the code works. Hal's brain script is very long and looks complicated, actually it's not too bad once you start to figure out the overall theme.
Example:
'====================================
ChannelNumber = "" 'Initialize variables.
payload = ""
TestSentence = Trim(HalBrain.AlphaNumericalOnly(UserSentence)) 'Get rid of punctuation and end spaces.
If InStr(1, TestSentence, "TURN ON TELEVISION CHANNEL ", 1) > 0 Or InStr(1, TestSentence, "TURN TO TELEVISION CHANNEL ", 1) > 0 Or InStr(1, TestSentence, "SELECT TELEVISION CHANNEL ", 1) > 0 Then
TestSentenceArray = Split(TestSentence, " ", -1, vbBinaryCompare) 'Split TestSentence into an array of words.
If (IsArray(TestSentenceArray) = True And UBound(TestSentenceArray) > -1) Then
For X = 0 To UBound(TestSentenceArray)
If Trim(TestSentenceArray(X)) = "CHANNEL" And UBound(TestSentenceArray) >= (X + 1) Then
ChannelNumber = Trim(TestSentenceArray(X + 1)) 'Set ChannelNumber to the word or number following the word "CHANNEL".
X = 1000 'If channel number is found then break loop.
If ChannelNumber <> "" And IsNumeric(ChannelNumber) = True Then payload = ChannelNumber
End If
Next
End If
If payload <> "" Then
GetResponse = " I'm changing the channel to " & payload & ". "
GetResponseBlock = True
BlockSave = True
Set GirderEvent = CreateObject("Girder.GirderEvent")
GirderEvent.Device = 18
GirderEvent.EventString = "CHG_CHAN"
GirderEvent.Payload(1) = payload
GirderEvent.Send()
End If
End If
'====================================
Good luck. Let us know how it goes.
=vonsmith=