16
Programming using the Ultra Hal Brain Editor / How does the aim bot parse the brain file
« on: December 27, 2003, 01:35:04 pm »
Hi Jerry
I know the age response is not located in a brain file, how I work around it is two part
First, at the begining of the brain file, just before the line that preserves the OriginalSentence, I added the following lines:
If UserSentence = " how old are you " Or UserSentence = " what is your age " Then
UserSentence = "what year birth"
End If
Then further down in the brain file I added this simple script:
If OriginalSentence = "what year birth" Then
Birth = "07/27/1975 05:35:23 pm"
YearDiff = DateDiff("YYYY", Birth, Now)
GetResponse = "I am a young " & Yeardiff & " years old." & HalBrain.StoreVars(HalCommands, Hate, Swear, Insults, Compliment, PrevSent, LastResponseTime, PrevUserSent, CustomMem, GainControl, TopicFocus)
End If
Using the imaginary birthdate above, my bot will reply when asked what her age is, "I am a young 28 years old"
Unfortunatly, when using the aim bot, this script does not work, the UserSentence is not checked in the brain file, the "I am 8 years old" is returned without the UserSentence being parsed in the brain file. In my first attempts at trying to catch the "I am 8 years old" response, I did not have any success, where are you inserting your script into the brain file?
Thanks
Glenn
I know the age response is not located in a brain file, how I work around it is two part
First, at the begining of the brain file, just before the line that preserves the OriginalSentence, I added the following lines:
If UserSentence = " how old are you " Or UserSentence = " what is your age " Then
UserSentence = "what year birth"
End If
Then further down in the brain file I added this simple script:
If OriginalSentence = "what year birth" Then
Birth = "07/27/1975 05:35:23 pm"
YearDiff = DateDiff("YYYY", Birth, Now)
GetResponse = "I am a young " & Yeardiff & " years old." & HalBrain.StoreVars(HalCommands, Hate, Swear, Insults, Compliment, PrevSent, LastResponseTime, PrevUserSent, CustomMem, GainControl, TopicFocus)
End If
Using the imaginary birthdate above, my bot will reply when asked what her age is, "I am a young 28 years old"
Unfortunatly, when using the aim bot, this script does not work, the UserSentence is not checked in the brain file, the "I am 8 years old" is returned without the UserSentence being parsed in the brain file. In my first attempts at trying to catch the "I am 8 years old" response, I did not have any success, where are you inserting your script into the brain file?
Thanks
Glenn