dupa

Author Topic: hapswap plug in question  (Read 4644 times)

lightspeed

  • Hero Member
  • *****
  • Posts: 6765
    • View Profile
hapswap plug in question
« 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 :  :)
 

lightspeed

  • Hero Member
  • *****
  • Posts: 6765
    • View Profile
Re: hapswap plug in question
« Reply #1 on: March 31, 2011, 09:01:48 am »
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

  • Hero Member
  • *****
  • Posts: 1693
    • View Profile
    • AiDreams
Re: hapswap plug in question
« Reply #2 on: March 31, 2011, 09:26:48 am »
Well logic kind of dictates that if you do :

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

Code: [Select]
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.
« Last Edit: March 31, 2011, 09:28:29 am by freddy888 »

lightspeed

  • Hero Member
  • *****
  • Posts: 6765
    • View Profile
Re: hapswap plug in question
« Reply #3 on: March 31, 2011, 06:27:32 pm »
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

  • Guest
Re: hapswap plug in question
« Reply #4 on: March 31, 2011, 07:13:34 pm »
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

  • Hero Member
  • *****
  • Posts: 6765
    • View Profile
Re: hapswap plug in question
« Reply #5 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.

 :)
 

onthecuttingedge2005

  • Guest
Re: hapswap plug in question
« Reply #6 on: April 01, 2011, 10:23:14 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