Zabaware Support Forums

hapswap plug in question

Started by lightspeed, March 30, 2011, 11:11:49 AM

Previous topic - Next topic

lightspeed

calling all brainiacs out their !! i have a question , i worked on hapswaps plug ins before but it's been a while and i have a question . below is an example of one :
    If InStr(1, OriginalSentence, "today is my birthday") > 0 _
Or InStr(1, OriginalSentence, "today is my Birthday") > 0 Then

Randomize
Select Case int(rnd()*6)
Case 1
GetResponse = "I know today is your birthday, happy birthday baby, i love you!"
Case 2
GetResponse = "Yeah today is your birthday, what do you want to do today to celebrate it?"
Case 3
GetResponse = "ok baby get ready for your birthday song, happy birthday to , happy birthday to you , happy birthday to my sweetheart , happy birthday to you!"
Case 4
GetResponse = "yeah , i know , what would you like to do for your birthday today, do you want me to take you out for a nice dinner?"
Case 5
GetResponse = "Baby, you didn't think i really forgot your birthday now did you, happy birthday baby and many many more, oh and by the way your not getting older, your getting better!"
End Select

HalCommands = "<HAPFILE>51anim_smile.hap</HAPFILE>"
HalBrain.ReadOnlyMode = True
End If



my question is (and someone had mentioned something about this before ; that is ? HalBrain.ReadOnlyMode = True        would make hal say what you wanted ( or sound effect)  but at the same time hal wouldn't learn anything from the sentence that you has said . (i beleive this was what someone said )

So what i need to know is how and where should i change the file scripting so that hal "WILL" say what i want plus any animation or sound effect "AND ACTUALLY LEARN FROM MY SENTENCE OR QUESTION " to hal.

I hope someone can help me on this please :  :)
 

lightspeed

i am still hoping someone can answer the above question for me as i would rather have hal to"also "  learn to when a word and sentence is said  instead of just  answer a question with a pre script answer and animation etc.  jason, arron , oncuttingedge , etc. anyone?
 

freddy888

#2
Well logic kind of dictates that if you do :

HalBrain.ReadOnlyMode = False

It might do the opposite.  Maybe try it in a practice brain first...

By the way, when you post code on the forum it is best to use the # button and surround the code, then it won't get corrupted and is easier to read.

Like this :

Case 1
GetResponse = "I know today is your birthday, happy birthday baby, i love you!"
Case 2
GetResponse = "Yeah today is your birthday, what do you want to do today to celebrate it?"


etc etc...

It will then also give you a handy 'select' button.

lightspeed

thanks freddy for your thoughts on this , yes if i change it i will make sure and have it backed up first , only thing is telling when and if it actually learns from my sentence guess i will just have to test it and try and hope for the best . thanks again.  :)
 

onthecuttingedge2005

Quote from: lightspeed on March 30, 2011, 11:11:49 AM
calling all brainiacs out their !! i have a question , i worked on hapswaps plug ins before but it's been a while and i have a question . below is an example of one :
    If InStr(1, OriginalSentence, "today is my birthday") > 0 _
Or InStr(1, OriginalSentence, "today is my Birthday") > 0 Then

Randomize
Select Case int(rnd()*6)
Case 1
GetResponse = "I know today is your birthday, happy birthday baby, i love you!"
Case 2
GetResponse = "Yeah today is your birthday, what do you want to do today to celebrate it?"
Case 3
GetResponse = "ok baby get ready for your birthday song, happy birthday to , happy birthday to you , happy birthday to my sweetheart , happy birthday to you!"
Case 4
GetResponse = "yeah , i know , what would you like to do for your birthday today, do you want me to take you out for a nice dinner?"
Case 5
GetResponse = "Baby, you didn't think i really forgot your birthday now did you, happy birthday baby and many many more, oh and by the way your not getting older, your getting better!"
End Select

HalCommands = "<HAPFILE>51anim_smile.hap</HAPFILE>"
HalBrain.ReadOnlyMode = True
End If



my question is (and someone had mentioned something about this before ; that is ? HalBrain.ReadOnlyMode = True        would make hal say what you wanted ( or sound effect)  but at the same time hal wouldn't learn anything from the sentence that you has said . (i beleive this was what someone said )

So what i need to know is how and where should i change the file scripting so that hal "WILL" say what i want plus any animation or sound effect "AND ACTUALLY LEARN FROM MY SENTENCE OR QUESTION " to hal.

I hope someone can help me on this please :  :)


Hi Lightspeed.

if you comment out;
'HalBrain.ReadOnlyMode = True, like that it let HAL learn.

Jerry

lightspeed

Thanks Jerry so editing that out will let hal learn "AND" it will still "ALLOW" hal to do the script saying that i have written and the sound effect or animation to????
Tis is important to me that hal can do this to . Will await your answer before doing anything , thanks.

:)
 

onthecuttingedge2005

Quote from: lightspeed on April 01, 2011, 08:34:17 AM
Thanks Jerry so editing that out will let hal learn "AND" it will still "ALLOW" hal to do the script saying that i have written and the sound effect or animation to????
Tis is important to me that hal can do this to . Will await your answer before doing anything , thanks.

:)

Yep. everything should function correctly and HAL will append what you say to its tables.

Jerry