'(I need to do some more work with this one, lol, doesn't
'respond sometimes.)
'Here you go.
'Here we give Hal the ability to learn and sing songs.
'you will have to teach your bot new songs by
'following Hals instructions so that songs are saved
'and used later when asked to sing.
'you'll need the Songs.brn/SongsDetect.brn/TellASong.brn
'and download them to your Hals default folder.
If HalBrain.TopicSearch(OriginalSentence, WorkingDir & "SongDetect.brn") = "TRUE" Then
GetResponse = "Ok, sing me the full song right now and nothing else."
End If
If Instr (1, PrevSent, "Ok, sing me the full song right now and nothing else.", VbTextCompare) > 0 Then
AnswerSent = OriginalSentence
GetResponse = AnswerSent & ", That's a really nice song, Thanks."
HalBrain.AppendFile WorkingDir & "Songs" & ".brn", Trim(OriginalSentence)
End If
If HalBrain.TopicSearch(OriginalSentence, WorkingDir & "TellASong.brn") = "TRUE" Then
HalSings = HalBrain.ChooseSentenceFromFile(WorkingDir & "Songs.brn")
GetResponse = HalSings & vbCrLf
DebugInfo = DebugInfo & "Hal is going to sing a song: " & HalSings & vbCrLf
Else
DebugInfo = DebugInfo & "Hal doesn't feel like singing: " & HalSings & vbCrLf
End If
'Best of wishes and new discoveries.
'Jerry
Download Attachment:
Songs.brn487 Bytes
Download Attachment:
TellASong.brn765 Bytes
Download Attachment:
SongDetect.brn1.02 KB