Zabaware Support Forums
Zabaware Forums => Programming using the Ultra Hal Brain Editor => Topic started by: castonguayh on November 10, 2007, 08:00:15 am
-
I have created various brains for use in different classes during the school day (I am a teacher using Hal as a learning tool).
I have changed various files for each class, but have not figured out how to transfer a file or a table from one brain to another.
I tried,without success,to find the answer in help and in the brain editor documentation. My guess is that the info is there and I am simply not using the correct terminology in my searches.
Also, how can I transfer some of the information in the table of one brain into the matching table in a different brain?
Can anyone help?
Thanks in advance for you help.
-
quote:
Originally posted by castonguayh
I have created various brains for use in different classes during the school day (I am a teacher using Hal as a learning tool).
I have changed various files for each class, but have not figured out how to transfer a file or a table from one brain to another.
I tried,without success,to find the answer in help and in the brain editor documentation. My guess is that the info is there and I am simply not using the correct terminology in my searches.
Also, how can I transfer some of the information in the table of one brain into the matching table in a different brain?
Can anyone help?
Thanks in advance for you help.
Hi castonguayh.
the HAL brain editor has a learn from text file option, this only works for .txt type files.
I don't believe there is an option to import database tables yet, only text files or from the clipboard.
Jerry
-
Jerry, you gave me an idea so I tried it. I found I could copy from a Hal file and was able to paste into a text file. Then I copied from the text file and pasted it into a file of the same type in a different brain.
I WORKED!!!!!!
Now, can you help me with this.
I want to create a sentence table that has questions from the unit my students are studying. Then, I want to request Hal to "ask us a question." I would like Hal to go to the folder and ask a question from it. He does this sort of thing when you ask him to "tell a joke."
Can you help?
Hank
-
quote:
Originally posted by castonguayh
Jerry, you gave me an idea so I tried it. I found I could copy from a Hal file and was able to paste into a text file. Then I copied from the text file and pasted it into a file of the same type in a different brain.
I WORKED!!!!!!
Now, can you help me with this.
I want to create a sentence table that has questions from the unit my students are studying. Then, I want to request Hal to "ask us a question." I would like Hal to go to the folder and ask a question from it. He does this sort of thing when you ask him to "tell a joke."
Can you help?
Hank
Hi castonguayh.
if you look into the editor for HalBrain.ChooseSentenceFromFile("jokes") you will see the format by clicking on the hyperlink "jokes" which opens up that table.
like:
Did you hear about the two men who walked into a bar? <topic> The third one ducked. </topic>
we can use the <topic></topic> to do other stuff like:
Does anybody know what 1 + 1 equals? <topic> the answer is 1 + 1 = 2 </topic>
Jerry[8D]
-
'Respond: Questions
'If the user wants Hal to ask a question, then Hal will ask one
If HalBrain.TopicSearch(UserSentence, "QuestionDetect") = "True" Then GetResponse = GetResponse & HalBrain.ChooseSentenceFromFile("ScienceQuestions")
HalBrain.DebugWatch GetResponse, "scienceQuestions"
Jerry I tried copying the "get joke" script and came up with the above script. I also created a "questionDetect table based on the "jokedetect" table, and a "ScienceQuestions" tabe based on the "jokes" table. I placed them in the same locations as the correspondikng jokes tables.
NOTHING HAPPENS. Hal just responds to the statement as though that script was not there.
I have never programmed, so I am trying to figure things out by careful observation and deduction (I just said that because I wanted to sound like a real scientist[8D][8D]).
I inserted this script after the tell a joke script.
Any suggestions?
-
quote:
Originally posted by castonguayh
'Respond: Questions
'If the user wants Hal to ask a question, then Hal will ask one
If HalBrain.TopicSearch(UserSentence, "QuestionDetect") = "True" Then GetResponse = GetResponse & HalBrain.ChooseSentenceFromFile("ScienceQuestions")
HalBrain.DebugWatch GetResponse, "scienceQuestions"
Jerry I tried copying the "get joke" script and came up with the above script. I also created a "questionDetect table based on the "jokedetect" table, and a "ScienceQuestions" tabe based on the "jokes" table. I placed them in the same locations as the correspondikng jokes tables.
NOTHING HAPPENS. Hal just responds to the statement as though that script was not there.
I have never programmed, so I am trying to figure things out by careful observation and deduction (I just said that because I wanted to sound like a real scientist[8D][8D]).
I inserted this script after the tell a joke script.
Any suggestions?
Hi castonguayh.
make sure that your questions detection is reverse person for the UserSentence to work. Hal may be seeing the question detection wrong and not triggering a response, try to replace the UserSentence with OriginalSentence and see if that makes a difference.
the difference is this:
1. I like to walk on the beach. (OriginalSentence)
2. You like to walk on the beach. (UserSentence) or reverse person.
Jerry[8D]
-
Nope...Nothing yet even with that change. I am sure I have just done something wrong. It is figuring it out that is driving me crazy.
I am forming a new respect for programmers!
-
Hi castonguayh.
I wrote this just for you, you can copy and paste this code into a text file and save as PopQuiz.uhp into your Ultra Hal Assistant 6 folder and then go to the brain options and choose the Pop Quiz plugin.
after doing so, run HAL and ask it: Give us a question about our sun?
you can add more trigger searches and add more <topic> questions in any fashion you see fit.
make sure that you keep a space on both sides of <topic> and one space before </topic> but not after </topic> or it may not function correctly.
I could advance this for you to the hilt but what fun would that be if I hogged all the glory.
Rem Type=Plugin
Rem Name=Pop Quiz
Rem Author=ONTHECUTTINGEDGE2005
Rem Host=All
'This sub setups the plug-ins option panel in Hal's options dialog
Sub OptionsPanel()
'Test Variable
lblPlugin(0).Caption = "This plugin will allow HAL to ask topic type questions on the first response and give the answer on the second response."
lblPlugin(0).Move 120, 10, 3300, 1000
lblPlugin(0).WordWrap = True
lblPlugin(0).Visible = True
End Sub
Rem PLUGIN: PLUGINAREA7
'Here is our random Question Quizer Function.
PopQuiz = Questions(OriginalSentence)
'Here we see if the user is wanting a question from HAL about our sun as a type of Quiz.
If InStr(1, OriginalSentence, "Give us a question about our sun", vbTextCompare) > 0 Then
GetResponse = PopQuiz
End If
Rem PLUGIN: FUNCTIONS
Function Questions(OriginalSentence)
'This is where we can write pop quiz questions about our own Sun.
Select Case HalBrain.RandomNum(2)
Case 1
Quiz = "What type of star is our sun? <topic> Our Sun is a G2V class Star. </topic>"
Case 2
Quiz = "Can anyone tell me how many light years our Sun is from the center of the Milky Way Galaxy? <topic> The Sun orbits the center of the Milky Way galaxy at a distance of approximately 26,000 light-years from the galactic center, completing one revolution in about 225–250 million years. </topic>"
End Select
Questions = Quiz
End Function
Have Fun!
Jerry[8D]
-
Thanks, I got it set up and it works. I am now trying to figure our how to write and save banks of topic questions on specific topics. I will let you know how it goes.
Hank
I really appreciate the time you spent on this!
-
quote:
Originally posted by castonguayh
Thanks, I got it set up and it works. I am now trying to figure our how to write and save banks of topic questions on specific topics. I will let you know how it goes.
Hank
I really appreciate the time you spent on this!
Hi castonguayh.
no problem, it took me less than 5 minutes to throw it together, have fun!
Jerry[8D]
-
I tried using the plugin and ran into the difficulty that Hal would only ask the 1st two questions I put in. I change the number in the parentheses to 6 (the number of questions I was trying) but that didn't seem to help.
Remember, I know NOTHING about programming so I am sure I am making a mistake based on ignorance. (Isn't ignorance supposed to be bliss?)
Because of my time frame, I erased everything inside the Jokedetect table and switched them to "quiz us," "test us" items.
I then erased all the jokes in the joke folder and put in questions using the format you gave me.
That works fine provide I don't put anything with the word "Question" in the joke detect folder. There must be something somewhere else in the script that gives Hal directions if he sees the word "question" in something the user types in.
This is actually what I was hoping for without having to erase the jokes. I put in a lot of time on that folder eliminating the inappropriate jokes. The kids love them. However, we must make sacrifices.
My intention is to make multiple folders for different units of study and then just change the name on them when I want Hal to access questions. The way it is now, I will have to change their name to "jokes" when I want to use the folder.
I am pretty sure this will work, but it would be nice to be able to joke with Hal..........
Thanks again, and remember, I am clueless about programming. So, what is obvious to others is beyond my realm of experience.
-
quote:
Originally posted by castonguayh
I tried using the plugin and ran into the difficulty that Hal would only ask the 1st two questions I put in. I change the number in the parentheses to 6 (the number of questions I was trying) but that didn't seem to help.
Remember, I know NOTHING about programming so I am sure I am making a mistake based on ignorance. (Isn't ignorance supposed to be bliss?)
Because of my time frame, I erased everything inside the Jokedetect table and switched them to "quiz us," "test us" items.
I then erased all the jokes in the joke folder and put in questions using the format you gave me.
That works fine provide I don't put anything with the word "Question" in the joke detect folder. There must be something somewhere else in the script that gives Hal directions if he sees the word "question" in something the user types in.
This is actually what I was hoping for without having to erase the jokes. I put in a lot of time on that folder eliminating the inappropriate jokes. The kids love them. However, we must make sacrifices.
My intention is to make multiple folders for different units of study and then just change the name on them when I want Hal to access questions. The way it is now, I will have to change their name to "jokes" when I want to use the folder.
I am pretty sure this will work, but it would be nice to be able to joke with Hal..........
Thanks again, and remember, I am clueless about programming. So, what is obvious to others is beyond my realm of experience.
Hi castonguayh.
please post your 'updated' Pop quiz plugin so I can see what is happening and debug it for you.
Jerry[8D]
-
Sorry for the delay; school keeps me busy.
Here is a what I did:
Rem Type=Plugin
Rem Name=Pop Quiz
Rem Author=ONTHECUTTINGEDGE2005
Rem Host=All
'This sub setups the plug-ins option panel in Hal's options dialog
Sub OptionsPanel()
'Test Variable
lblPlugin(0).Caption = "This plugin will allow HAL to ask topic type questions on the first response and give the answer on the second response."
lblPlugin(0).Move 120, 10, 3300, 1000
lblPlugin(0).WordWrap = True
lblPlugin(0).Visible = True
End Sub
Rem PLUGIN: PLUGINAREA7
'Here is our random Question Quizer Function.
PopQuiz = Questions(OriginalSentence)
'Here we see if the user is wanting a question from HAL about our sun as a type of Quiz.
If InStr(1, OriginalSentence, "Give us a question about our sun", vbTextCompare) > 0 Then
GetResponse = PopQuiz
End If
Rem PLUGIN: FUNCTIONS
Function Questions(OriginalSentence)
'This is where we can write pop quiz questions about our own Sun.
Select Case HalBrain.RandomNum(4)
Case 1
Quiz = "What type of star is our sun? <topic> Our Sun is a G2V class Star. </topic>"
Case 2
Quiz = "Can anyone tell me how many light years our Sun is from the center of the Milky Way Galaxy? <topic> The Sun orbits the center of the Milky Way galaxy at a distance of approximately 26,000 light-years from the galactic center, completing one revolution in about 225–250 million years. </topic>"
Case 3
Quiz = "What is the difference between a pioneer and climax community? <topic> A pioneer community has little biodiversity, while a climax community has a high biodiversity. </topic>"
Case 4
Quiz = "what is the law of conservation of matter? <topic> Matter cannot be created or destroyed under ordinary circumstances, but it can be rearranged. </topic>"
End Select
Questions = Quiz
End Function
-
Hi castonguayh.
try replacing that code with this one, you will have to add lots of more case responses so you will have better randomness in responses.
Rem Type=Plugin
Rem Name=Pop Quiz
Rem Author=ONTHECUTTINGEDGE2005
Rem Host=All
'This sub setups the plug-ins option panel in Hal's options dialog
Sub OptionsPanel()
'Test Variable
lblPlugin(0).Caption = "This plugin will allow HAL to ask topic type questions on the first response and give the answer on the second response."
lblPlugin(0).Move 120, 10, 3300, 1000
lblPlugin(0).WordWrap = True
lblPlugin(0).Visible = True
End Sub
Rem PLUGIN: PLUGINAREA7
'Here is our random Question Quizer Function.
PopQuiz = Questions()
'Here we see if the user is wanting a question from HAL about our sun as a type of Quiz.
If InStr(1, OriginalSentence, "give us a question about our sun", vbTextCompare) > 0 Then
GetResponse = PopQuiz
End If
Rem PLUGIN: FUNCTIONS
Function Questions()
'This is where we can write pop quiz questions about our own Sun.
Select Case Int(Rnd * 4)
Case 1
Quiz = "What type of star is our sun? <topic> Our Sun is a G2V class Star. </topic>"
Case 2
Quiz = "Can anyone tell me how many light years our Sun is from the center of the Milky Way Galaxy? <topic> The Sun orbits the center of the Milky Way galaxy at a distance of approximately 26,000 light-years from the galactic center, completing one revolution in about 225–250 million years. </topic>"
Case 3
Quiz = "What is the difference between a pioneer and climax community? <topic> A pioneer community has little biodiversity, while a climax community has a high biodiversity. </topic>"
Case 4
Quiz = "what is the law of conservation of matter? <topic> Matter cannot be created or destroyed under ordinary circumstances, but it can be rearranged. </topic>"
End Select
Questions = Quiz
End Function
Jerry[8D]