Author Topic: Transferring info from one brain to another  (Read 6657 times)

castonguayh

  • Jr. Member
  • **
  • Posts: 51
    • View Profile
    • http://www.nashua.edu/castonguayh
Transferring info from one brain to another
« 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.
HANK

onthecuttingedge2005

  • Guest
Transferring info from one brain to another
« Reply #1 on: November 10, 2007, 06:59:19 pm »
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

castonguayh

  • Jr. Member
  • **
  • Posts: 51
    • View Profile
    • http://www.nashua.edu/castonguayh
Transferring info from one brain to another
« Reply #2 on: November 10, 2007, 08:37:09 pm »
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
HANK

onthecuttingedge2005

  • Guest
Transferring info from one brain to another
« Reply #3 on: November 11, 2007, 05:24:18 am »
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]

castonguayh

  • Jr. Member
  • **
  • Posts: 51
    • View Profile
    • http://www.nashua.edu/castonguayh
Transferring info from one brain to another
« Reply #4 on: November 11, 2007, 08:17:33 am »
   '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?
HANK

onthecuttingedge2005

  • Guest
Transferring info from one brain to another
« Reply #5 on: November 11, 2007, 11:34:46 am »
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]

castonguayh

  • Jr. Member
  • **
  • Posts: 51
    • View Profile
    • http://www.nashua.edu/castonguayh
Transferring info from one brain to another
« Reply #6 on: November 11, 2007, 12:21:50 pm »
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!
HANK

onthecuttingedge2005

  • Guest
Transferring info from one brain to another
« Reply #7 on: November 11, 2007, 07:02:16 pm »
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.  

Code: [Select]
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]
« Last Edit: November 11, 2007, 07:46:27 pm by onthecuttingedge2005 »

castonguayh

  • Jr. Member
  • **
  • Posts: 51
    • View Profile
    • http://www.nashua.edu/castonguayh
Transferring info from one brain to another
« Reply #8 on: November 11, 2007, 08:28:51 pm »
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!
HANK

onthecuttingedge2005

  • Guest
Transferring info from one brain to another
« Reply #9 on: November 11, 2007, 10:37:25 pm »
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]

castonguayh

  • Jr. Member
  • **
  • Posts: 51
    • View Profile
    • http://www.nashua.edu/castonguayh
Transferring info from one brain to another
« Reply #10 on: November 12, 2007, 03:28:00 pm »
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.
HANK

onthecuttingedge2005

  • Guest
Transferring info from one brain to another
« Reply #11 on: November 13, 2007, 12:37:15 am »
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]

castonguayh

  • Jr. Member
  • **
  • Posts: 51
    • View Profile
    • http://www.nashua.edu/castonguayh
Transferring info from one brain to another
« Reply #12 on: November 17, 2007, 04:27:37 pm »
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
HANK

onthecuttingedge2005

  • Guest
Transferring info from one brain to another
« Reply #13 on: November 17, 2007, 09:06:36 pm »
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.


Code: [Select]
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]