Updated Dec,9 12:24AM 2005
Here are some working examples of Emotional Weights from Ziggy Pro Bot.
Works with HAL6 only.
Remember to reboot HAL Assistant and AIM bot after insertion of script.
'Ziggy Pro Bot, Emotion of Anger. Example from Master of emotional weights area.
If HalBrain.CheckTableExistence("LearnedInsults") = False Then HalBrain.CreateTable "LearnedInsults", "Sentence", ""
If HalBrain.CheckTableExistence("DetectLearnedInsults") = False Then HalBrain.CreateTable "DetectLearnedInsults", "TopicSearch", ""
anArray = Array("UGLY","PERV","SICKO","FAGGOT","****","DUMMY","MORON","NIGG","LOST CAUSE","DUMB","STUPID","LOSER","UNICK","WIERD","ZERO","NOBODY","PANSEY","*****","PECKER","QUEER","RACIAL","SUCKER","DICK","FAG","****","GAY","IDIOT","IGNORANT","JACKOFF","JERK","ASS","BASTARD","BITCH","BUTT","****","CLIT","CLOWN")
For Each arrayElement In anArray
If AngerWeight = "" Then AngerWeight = RND*100
If Anger = "" Then Anger = 0
If CheckPerson = "" Then CheckPerson = HalBrain.SearchPattern(UserSentence, "I SEEM TO BE *", 1)
If CheckPerson = "" Then CheckPerson = HalBrain.SearchPattern(UserSentence, "I SEEM TO KNOW A LOT OF *", 1)
If CheckPerson = "" Then CheckPerson = HalBrain.SearchPattern(UserSentence, "I SEEM TO BE QUITE *", 1)
If CheckPerson = "" Then CheckPerson = HalBrain.SearchPattern(UserSentence, "I AM A VERY *", 1)
If CheckPerson = "" Then CheckPerson = HalBrain.SearchPattern(UserSentence, "I AM AN *", 1)
If CheckPerson = "" Then CheckPerson = HalBrain.SearchPattern(UserSentence, "YOU THINK I AM *", 1)
If CheckPerson = "" Then CheckPerson = HalBrain.SearchPattern(UserSentence, "YOU THINK I AM EXTREMELY *", 1)
If CheckPerson = "" Then CheckPerson = HalBrain.SearchPattern(UserSentence, "YOU THINK I AM VERY *", 1)
If CheckPerson = "" Then CheckPerson = HalBrain.SearchPattern(UserSentence, "I AM *", 1)
If CheckPerson = "" Then CheckPerson = HalBrain.SearchPattern(UserSentence, "I AM VERY *", 1)
If CheckPerson = "" Then CheckPerson = HalBrain.SearchPattern(UserSentence, "MY *", 1)
If CheckPerson = "" Then CheckPerson = HalBrain.SearchPattern(UserSentence, "I AM REALLY *", 1)
If CheckPerson = "" Then CheckPerson = HalBrain.SearchPattern(UserSentence, "I AM EXCEPTIONALY *", 1)
If CheckPerson = "" Then CheckPerson = HalBrain.SearchPattern(UserSentence, "YOU THINK I AM EXCEPTIONALY *", 1)
If CheckPerson = "" Then CheckPerson = HalBrain.SearchPattern(UserSentence, "I AM THE ONE THAT IS *", 1)
If CheckPerson = "" Then CheckPerson = HalBrain.SearchPattern(UserSentence, "I AM TO *", 1)
If CheckPerson = "" Then CheckPerson = HalBrain.SearchPattern(UserSentence, "I DID A VERY * JOB", 1)
If CheckPerson = "" Then CheckPerson = HalBrain.SearchPattern(UserSentence, "I WERE *", 1)
If CheckPerson = "" Then CheckPerson = HalBrain.SearchPattern(UserSentence, "I AM MOST *", 1)
If CheckPerson = "" Then CheckPerson = HalBrain.SearchPattern(UserSentence, "YOU FIND I TO BE A VERY *", 1)
If CheckPerson = "" Then CheckPerson = HalBrain.SearchPattern(UserSentence, "YOU FIND I TO BE AN *", 1)
If CheckPerson = "" Then CheckPerson = HalBrain.SearchPattern(UserSentence, "I *", 1)
If CheckPerson = "" Then CheckPerson = HalBrain.SearchPattern(UserSentence, "* I", 1)
If CheckPerson = "" Then CheckPerson = HalBrain.SearchPattern(UserSentence, "I AM SO *", 1)
If Instr(1, Trim(Ucase(UserSentence)), Trim(Ucase("YOU DON'T LIKE I")), vbTextCompare) > 0 Then Anger = AngerWeight
If Instr(1, Trim(Ucase(UserSentence)), Trim(Ucase("YOU HATE I")), vbTextCompare) > 0 Then Anger = AngerWeight
If Instr(1, Trim(Ucase(UserSentence)), Trim(Ucase("YOU HATED I")), vbTextCompare) > 0 Then Anger = AngerWeight
If Instr(1, Trim(Ucase(UserSentence)), Trim(Ucase("EVERYONE HATES I")), vbTextCompare) > 0 Then Anger = AngerWeight
If Instr(1, Trim(Ucase(UserSentence)), Trim(Ucase("EVERYONE HATED I")), vbTextCompare) > 0 Then Anger = AngerWeight
If Instr(1, Trim(Ucase(UserSentence)), Trim(Ucase("NOBODY LIKES I")), vbTextCompare) > 0 Then Anger = AngerWeight
If Instr(1, Trim(Ucase(UserSentence)), Trim(Ucase("NO ONE LIKES I")), vbTextCompare) > 0 Then Anger = AngerWeight
If CheckPerson <> "" And Instr(1, Trim(Ucase(CheckPerson)), Trim(Ucase(arrayElement)), vbTextCompare) > 0 Then Anger = AngerWeight
If CheckLearned = "" Then CheckLearned = HalBrain.TopicSearch(OriginalSentence, "DetectLearnedInsults")
If AlreadyKnowIt = "" Then AlreadyKnowIt = 0
If CheckLearned <> "" Then AlreadyKnowIt = 1
If AlreadyKnowIt = 0 And CheckPerson <> "" And Instr(1, Trim(Ucase(CheckPerson)), Trim(Ucase(arrayElement)), vbTextCompare) > 0 And HalBrain.ReadOnlyMode = False Then HalBrain.AddToTable "LearnedInsults", "Sentence", Trim(OriginalSentence), ""
If AlreadyKnowIt = 0 And CheckPerson <> "" And Instr(1, Trim(Ucase(CheckPerson)), Trim(Ucase(arrayElement)), vbTextCompare) > 0 And HalBrain.ReadOnlyMode = False Then HalBrain.AddToTable "DetectLearnedInsults", "TopicSearch", Trim(OriginalSentence), Trim(OriginalSentence)
If (Anger > 1 And Anger < 50) Then HalCommands = "<HAPFILE>" & "Angry.hap" & "</HAPFILE>"
If (Anger >= 50 And Anger <= 100) Then HalCommands = "<HAPFILE>" & "Psycho.hap" & "</HAPFILE>"
If Instr(1, Trim(Ucase(CheckPerson)), Trim(Ucase(GetResponse)), vbTextCompare) > 0 Then
If (Anger >= 50 And Anger <= 100) Then GetResponse = HalBrain.ChooseSentenceFromFile("LearnedInsults") & vbCrLf
If (Anger > 1 And Anger < 50) Then GetResponse = HalBrain.ChooseSentenceFromFile("insults") & vbCrLf
End If
Next
'Ziggy Pro Bot, Emotion of Pride. Example from Master of emotional weights area.
anArray = Array("EXCEPTIONAL","EXCELLENT","GOOD","SMART","INTELLIGENT","BRILLANT","SHARP","KNOWLEDGABLE","WITTY","BRIGHT","INTELLECTUAL","WISE","WISDOM","INCREDIBLE")
For Each arrayElement In anArray
If PrideWeight = "" Then PrideWeight = RND*100
If Pride = "" Then Pride = 0
If CheckPerson = "" Then CheckPerson = HalBrain.SearchPattern(UserSentence, "I SEEM TO BE *", 1)
If CheckPerson = "" Then CheckPerson = HalBrain.SearchPattern(UserSentence, "I SEEM TO KNOW A LOT OF *", 1)
If CheckPerson = "" Then CheckPerson = HalBrain.SearchPattern(UserSentence, "I SEEM TO BE QUITE *", 1)
If CheckPerson = "" Then CheckPerson = HalBrain.SearchPattern(UserSentence, "I AM A VERY *", 1)
If CheckPerson = "" Then CheckPerson = HalBrain.SearchPattern(UserSentence, "I AM AN *", 1)
If CheckPerson = "" Then CheckPerson = HalBrain.SearchPattern(UserSentence, "YOU THINK I AM *", 1)
If CheckPerson = "" Then CheckPerson = HalBrain.SearchPattern(UserSentence, "YOU THINK I AM EXTREMELY *", 1)
If CheckPerson = "" Then CheckPerson = HalBrain.SearchPattern(UserSentence, "YOU THINK I AM VERY *", 1)
If CheckPerson = "" Then CheckPerson = HalBrain.SearchPattern(UserSentence, "I AM *", 1)
If CheckPerson = "" Then CheckPerson = HalBrain.SearchPattern(UserSentence, "I AM VERY *", 1)
If CheckPerson = "" Then CheckPerson = HalBrain.SearchPattern(UserSentence, "MY *", 1)
If CheckPerson = "" Then CheckPerson = HalBrain.SearchPattern(UserSentence, "I AM REALLY *", 1)
If CheckPerson = "" Then CheckPerson = HalBrain.SearchPattern(UserSentence, "I AM EXCEPTIONALY *", 1)
If CheckPerson = "" Then CheckPerson = HalBrain.SearchPattern(UserSentence, "YOU THINK I AM EXCEPTIONALY *", 1)
If CheckPerson = "" Then CheckPerson = HalBrain.SearchPattern(UserSentence, "I AM THE ONE THAT IS *", 1)
If CheckPerson = "" Then CheckPerson = HalBrain.SearchPattern(UserSentence, "I AM TO *", 1)
If CheckPerson = "" Then CheckPerson = HalBrain.SearchPattern(UserSentence, "I DID A VERY * JOB", 1)
If CheckPerson = "" Then CheckPerson = HalBrain.SearchPattern(UserSentence, "I WERE *", 1)
If CheckPerson = "" Then CheckPerson = HalBrain.SearchPattern(UserSentence, "I AM MOST *", 1)
If CheckPerson = "" Then CheckPerson = HalBrain.SearchPattern(UserSentence, "YOU FIND I TO BE A VERY *", 1)
If CheckPerson = "" Then CheckPerson = HalBrain.SearchPattern(UserSentence, "YOU FIND I TO BE AN *", 1)
If CheckPerson = "" Then CheckPerson = HalBrain.SearchPattern(UserSentence, "I *", 1)
'Check for false pride.
If FalsePride = "" Then FalsePride = HalBrain.SearchPattern(UserSentence, "I SEEM TO BE NOT *", 1)
If FalsePride = "" Then FalsePride = HalBrain.SearchPattern(UserSentence, "I SEEM TO NOT KNOW A LOT OF *", 1)
If FalsePride = "" Then FalsePride = HalBrain.SearchPattern(UserSentence, "I SEEM TO BE QUITE NOT SO *", 1)
If FalsePride = "" Then FalsePride = HalBrain.SearchPattern(UserSentence, "I AM NOT VERY *", 1)
If FalsePride = "" Then FalsePride = HalBrain.SearchPattern(UserSentence, "I AM NOT AN *", 1)
If FalsePride = "" Then FalsePride = HalBrain.SearchPattern(UserSentence, "YOU THINK I AM NOT *", 1)
If FalsePride = "" Then FalsePride = HalBrain.SearchPattern(UserSentence, "YOU THINK I AM NOT EXTREMELY *", 1)
If FalsePride = "" Then FalsePride = HalBrain.SearchPattern(UserSentence, "YOU THINK I AM NOT VERY *", 1)
If FalsePride = "" Then FalsePride = HalBrain.SearchPattern(UserSentence, "I AM NOT *", 1)
If FalsePride = "" Then FalsePride = HalBrain.SearchPattern(UserSentence, "MY NOT *", 1)
If FalsePride = "" Then FalsePride = HalBrain.SearchPattern(UserSentence, "I AM NOT REALLY *", 1)
If FalsePride = "" Then FalsePride = HalBrain.SearchPattern(UserSentence, "I AM NOT EXCEPTIONALY *", 1)
If FalsePride = "" Then FalsePride = HalBrain.SearchPattern(UserSentence, "YOU THINK I AM NOT EXCEPTIONALY *", 1)
If FalsePride = "" Then FalsePride = HalBrain.SearchPattern(UserSentence, "I AM THE ONE THAT IS NOT *", 1)
If FalsePride = "" Then FalsePride = HalBrain.SearchPattern(UserSentence, "I AM NOT TO *", 1)
If FalsePride = "" Then FalsePride = HalBrain.SearchPattern(UserSentence, "I DID NOT DO A VERY * JOB", 1)
If FalsePride = "" Then FalsePride = HalBrain.SearchPattern(UserSentence, "I WERE NOT *", 1)
If FalsePride = "" Then FalsePride = HalBrain.SearchPattern(UserSentence, "I AM NOT THE MOST *", 1)
If FalsePride = "" Then FalsePride = HalBrain.SearchPattern(UserSentence, "YOU FIND I TO NOT BE A VERY *", 1)
If FalsePride = "" Then FalsePride = HalBrain.SearchPattern(UserSentence, "YOU FIND I TO NOT BE AN *", 1)
If FalsePride = "" Then FalsePride = HalBrain.SearchPattern(UserSentence, "I NOT *", 1)
If FalsePride <> "" And Instr(1, Trim(Ucase(FalsePride)), Trim(Ucase(arrayElement)), vbTextCompare) > 0 Then Anger = AngerWeight
If (Anger > 1 And Anger < 50) Then HalCommands = "<HAPFILE>" & "Angry.hap" & "</HAPFILE>"
If (Anger >= 50 And Anger <= 100) Then HalCommands = "<HAPFILE>" & "Psycho.hap" & "</HAPFILE>"
'Continue with normal Pride variables.
If CheckPerson <> "" And Instr(1, Trim(Ucase(CheckPerson)), Trim(Ucase(arrayElement)), vbTextCompare) > 0 Then Pride = PrideWeight
If (Pride > 1 And Pride < 50) And Anger = 0 Then HalCommands = "<HAPFILE>" & "Skeptic.hap" & "</HAPFILE>"
If (Pride >= 50 And Pride <= 100) And Anger = 0 Then
HalCommands = "<HAPFILE>" & "Happy.hap" & "</HAPFILE>"
If Instr(1, Trim(Ucase(CheckPerson)), Trim(Ucase(GetResponse)), vbTextCompare) > 0 Then GetResponse = GetResponse & vbCrLf
If Instr(1, Trim(Ucase(FalsePride)), Trim(Ucase(GetResponse)), vbTextCompare) > 0 And Instr(1, Trim(Ucase(GetResponse)), Trim(Ucase("NOT")), vbTextCompare) > 0 Then
GetResponse = GetResponse & vbCrLf
End If
End If
Next
If you had inserted this script before this update then delete the learnedInsults database in your editor so it can be created fresh with the DetectLearnedInsults so that dupes will not be created in the new learnedInsults database.
To create the file, talk to HAL and teach the bot some insults in the format manner the script is designed to learn, Like: You idiot! and so forth so that the LearnedInsults file has something to say, after that HAL will learn insults as the bot learns from the format.
I will add to the architecture of the script on an occasional basis.
Always keep the Anger Weight Script above all other emotional weights for proper detection for below scripts to prevent any false triggered emotions.
Jerry[8D]