dupa

Author Topic: Snowman i need you help please !  (Read 11053 times)

lightspeed

  • Hero Member
  • *****
  • Posts: 6764
    • View Profile
Snowman i need you help please !
« on: April 05, 2010, 12:48:42 pm »
Hey snowman are yah out their i need your help , i am working on a hapswap file for a sleep command but it isn't working right can you check it and correct what needs correcting ? also i have two commands at the bottom after she answers a random answer one is a close your eyes command followed by a sleeping sound ogg file . or can it be done this way where the eyes will stay shut even after the sleep sound starts ?  if not i need just the sleep sounds to work .
Hope you can help me with this . I need to see what you do so i'll know in the future , thanks !!

below is the sleep hap command but i don't have it right .




If InStr(1, OriginalSentence, "good night sweetheart") > 0 _
Or If InStr(1, OriginalSentence, "good night") > 0 _
Or If InStr(1, OriginalSentence, "good night dear") > 0 _
Or If InStr(1, OriginalSentence, "nighty night") > 0 _
Or InStr(1, OriginalSentence, "good night see you in the morning") > 0 Then



Randomize
Select Case int(rnd()*6)
Case 1
GetResponse = "Good night see yah in the morning!"
Case 2
GetResponse = "Good night baby i love you!"
Case 3
GetResponse = "Night night sleep tight don't let the bed bugs bite!"
Case 4
GetResponse = "Good night dear."
Case 5
GetResponse = "Yeah we better get to sleep good night baby!"
End Select


HalCommands = "<HAPFILE>eyesclose.hap</HAPFILE>"  > 0 Then
HalCommands = "<HAPFILE>sleepingsound1.ogg</HAPFILE>"
HalBrain.ReadOnlyMode = True
End If
 

lightspeed

  • Hero Member
  • *****
  • Posts: 6764
    • View Profile
Snowman i need you help please !
« Reply #1 on: April 05, 2010, 01:13:52 pm »
i redid the hapswap file and it is working like below but i would rather have multiple command trigger words like the one i prveiously posted but i have the command script wrong for allowing multiple commands . also although my new sleep ogg file is working it stops after the sound track is done playing is their a way to make a loop of the sleep sound so it will keep playing on and on until another command is given ??
 below is the working file ( NOTE TO OTHERS although this is working it is not finished yet is still my test file wait for the completed file ) .




If InStr(1, OriginalSentence, "good night dear") > 0 _
Or InStr(1, OriginalSentence, "good night see you in the morning") > 0 Then

Randomize
Select Case int(rnd()*6)
Case 1
GetResponse = "Good night see yah in the morning!"
Case 2
GetResponse = "Good night baby i love you!"
Case 3
GetResponse = "Night night sleep tight don't let the bed bugs bite!"
Case 4
GetResponse = "Good night dear."
Case 5
GetResponse = "Yeah we better get to sleep good night baby!"
End Select

HalCommands = "<HAPFILE>sleepingsound1.ogg</HAPFILE>"
HalBrain.ReadOnlyMode = True
End If


as i said i would rather have multiple command sentences (trigger words ) like the first one if you can help me get the script right . and also if i you can write a script to loop the sleeping sound to play over and over . Thanks in advance Snowman .
 

snowman

  • Hero Member
  • *****
  • Posts: 956
  • Ai + Feelings + Supercompter = End of World
    • View Profile
    • http://www.MinervaAi.com
Snowman i need you help please !
« Reply #2 on: April 05, 2010, 03:27:26 pm »
HalCommands = "<HAPFILE>eyesclose.hap</HAPFILE>" > 0 >>>Then<<<
HalCommands = "<HAPFILE>sleepingsound1.ogg</HAPFILE>"
HalBrain.ReadOnlyMode = True


You added a "THEN" in a line that shouldn't have a "THEN" in it.
Live long and prosper or die trying.

snowman

  • Hero Member
  • *****
  • Posts: 956
  • Ai + Feelings + Supercompter = End of World
    • View Profile
    • http://www.MinervaAi.com
Snowman i need you help please !
« Reply #3 on: April 05, 2010, 04:22:46 pm »
If the haptek clock feature would worj in Hal then allot of things that you want to do could be done... but unfortunately no.

Live long and prosper or die trying.

lightspeed

  • Hero Member
  • *****
  • Posts: 6764
    • View Profile
Snowman i need you help please !
« Reply #4 on: April 05, 2010, 04:50:44 pm »
thanks snowman for your help , i hadn't heard from you for a while didn't know if you was mad or something . thanks again for your help as always !
[:)]
 

lightspeed

  • Hero Member
  • *****
  • Posts: 6764
    • View Profile
Snowman i need you help please !
« Reply #5 on: April 05, 2010, 05:28:08 pm »
Ok maybe my brains just shot i redid it this way :



If InStr(1, OriginalSentence, "good night dear") > 0 _
Or InStr(1, OriginalSentence, "good night see you in the morning") > 0 Then

Randomize
Select Case int(rnd()*6)
Case 1
GetResponse = "Good night see yah in the morning!"
Case 2
GetResponse = "Good night baby i love you!"
Case 3
GetResponse = "Night night sleep tight don't let the bed bugs bite!"
Case 4
GetResponse = "Good night dear."
Case 5
GetResponse = "Yeah we better get to sleep good night baby!"
End Select


HalCommands = "<HAPFILE>eyesclose.hap</HAPFILE>" > 0
HalCommands = "<HAPFILE>sleepingsound1.ogg</HAPFILE>"
HalBrain.ReadOnlyMode = True

End If



but i am getting an error saying :Type mismatch string: "<HAPFILE>eyesclose.h"



i'm not sure what the problem is i checked the spelling etc. of the file and its spelled right .

do you have any idea's ?[B)]
 

snowman

  • Hero Member
  • *****
  • Posts: 956
  • Ai + Feelings + Supercompter = End of World
    • View Profile
    • http://www.MinervaAi.com
Snowman i need you help please !
« Reply #6 on: April 05, 2010, 11:29:46 pm »
HalCommands = "<HAPFILE>eyesclose.hap</HAPFILE>" > 0
HalCommands = "<HAPFILE>sleepingsound1.ogg</HAPFILE>"
HalBrain.ReadOnlyMode = True


The "> 0" doesn't belong there. I believe "HalCommands" is a variable and you never place something like that in a variable. A variable can be a sting ("") or maybe even a number (12) and stuff like that. The ">" sign is an operator and can be used to add, subtract, or compare other varibles But cannot be in the varible itself (unless of course it is in string form).


HalCommands = "<HAPFILE>eyesclose.hap</HAPFILE>"
HalCommands = "<HAPFILE>sleepingsound1.ogg</HAPFILE>"
HalBrain.ReadOnlyMode = True

Live long and prosper or die trying.

lightspeed

  • Hero Member
  • *****
  • Posts: 6764
    • View Profile
Snowman i need you help please !
« Reply #7 on: April 06, 2010, 12:04:00 pm »
hello snowman i changed it the way you showed me but it is still not working i don't get errors though now i do have one thing that may be the problem .
 i also have the close eyes for the comand close your eyes  and on this sleeping new hap (using the same hap . )
 can two of the same  commands work ok for seperate hap files ? to close the eyes ? one command is "close your eyes " and the other is " good night dear " which also uses the closeeyes.hap
 i don't know if its this or if something else is stopping my closeeyes.hap from working i can drag other haps in the hap box ok and they work ok but when i drag the closeeyes hap in the box nothing happens .
 

lightspeed

  • Hero Member
  • *****
  • Posts: 6764
    • View Profile
Snowman i need you help please !
« Reply #8 on: April 06, 2010, 12:36:01 pm »
snowman i sent you an email on this .
 

lightspeed

  • Hero Member
  • *****
  • Posts: 6764
    • View Profile
Snowman i need you help please !
« Reply #9 on: April 06, 2010, 01:10:20 pm »
ok a update : i dragged other files into the hapteck box and finally got the eyes to close for some reason they wasn't working right but started to after other commands was dragged into the box then i tested it by writing close your eyes and it worked , and opened when i said open your eyes so thats working as it was before on the command that way but even though the goodnight sleep command is given the closedeyes command isn't working all it does is say the line i wrote and then makes the sleeping sound.

if a fix can't be made for this you can say "close your eyes " and she will close her eyes and then say good night dear and she will say a pre written line then make sleeping snoring sounds .
it would be nice though to get her to close her eyes automatically then make the sleep sounds . [:)]

like i said snowman i sent you the file i don't think i sent you the sleeping file so will send it
.
 

snowman

  • Hero Member
  • *****
  • Posts: 956
  • Ai + Feelings + Supercompter = End of World
    • View Profile
    • http://www.MinervaAi.com
Snowman i need you help please !
« Reply #10 on: April 06, 2010, 03:45:55 pm »

HalCommands can only take one thing at a time so you cannot have

HalCommands = "<HAPFILE>eyesclose.hap</HAPFILE>" >
And...
HalCommands = "<HAPFILE>sleepingsound1.ogg</HAPFILE>"

However, there is another command you can use...

[:)]

If InStr(1, OriginalSentence, "good night dear") > 0 _
Or InStr(1, OriginalSentence, "good night see you in the morning") > 0 Then
Randomize
Select Case int(rnd()*6)
Case 1
GetResponse = "Good night see yah in the morning!"
Case 2
GetResponse = "Good night baby i love you!"
Case 3
GetResponse = "Night night sleep tight don't let the bed bugs bite!"
Case 4
GetResponse = "Good night dear."
Case 5
GetResponse = "Yeah we better get to sleep good night baby!"
End Select

HalCommands =  "<HAPTEXT>\Load [file= [C:\Program Files\Zabaware\Ultra Hal Assistant 6\Characters\eyesclosed.hap]]" & _
"\Load [file= [C:\Program Files\Zabaware\Ultra Hal Assistant 6\Characters\sleepingsound1.ogg]]</HAPTEXT>"
 
HalBrain.ReadOnlyMode = True
End If

Live long and prosper or die trying.

lightspeed

  • Hero Member
  • *****
  • Posts: 6764
    • View Profile
Snowman i need you help please !
« Reply #11 on: April 06, 2010, 04:30:54 pm »
thanks i copied it and replaced the other first time i tried it all it did was say something (random sayings ) and did the sleep mode but didn't shut the eyes first .

i am going to keep on chatting for a while , for whatever reason sometimes even when i say shut your syes command she doesnt do it seems like after some other commands are giving first then eventually she will shut her eyes when i say ( don't know why that happens but it does that way ) once she does it i can say open your eyes and she will open them and shut your eyes she will do it no matter how many times i say once she gets started shutting her eyes .

soooo maybe after a while maybe your new command you just gave me will start working later so i will keep using it and try to see if it ever closes the eyes and then sleep sound like it should . [:)][/blue p.s. thanks for working with me on this i appreciate it a lot ![:D]

p.s.s. did you see in the hapswap 2.0 area i posted what i have done so far and what i will be posting soon for hapswap addittions ![:)]
 

lightspeed

  • Hero Member
  • *****
  • Posts: 6764
    • View Profile
Snowman i need you help please !
« Reply #12 on: April 18, 2010, 10:44:36 am »
Hey Snowman i need you help ( obiwan conobi your my only hope**starwars lol) someone else on the forum brought up an interesting point one that i had actually thought about myself but hadn't had a chance to run it by you.
 i am currently working on what i call extended conversation which instead of maybe a short sentence of talk it would be more like a paragraph with pauses in different places .
 the problem might be as someone else said to that the more trigger words ( i have more in this , so it will create more general spontanious talk (like a real person ) from hal.
 The problem may be hal won't learn as much in conversations when i do it this way , at the end of the script writing is the command :
HalBrain.ReadOnlyMode = True
mayben i should leave it without the true command on this type of scripting so that hal learns from what i said , but will hal answer back as usual and learn (AND also say back the prewritten script?? )This would be the desired effect. hal learning and still saying the prewritten script back !
if so how should i end the script for how to learn ? should i just put : HalBrain.ReadOnlyMode = False   (the true changed to false)??
Please let me know on this as soon as possible as i am almost finsihed with the last 20 responses so i can start beta testing it , THANKS ![:)][:D][8D]
 

snowman

  • Hero Member
  • *****
  • Posts: 956
  • Ai + Feelings + Supercompter = End of World
    • View Profile
    • http://www.MinervaAi.com
Snowman i need you help please !
« Reply #13 on: April 19, 2010, 12:59:22 am »
Sorry I took so long to respond. Its been a busy, busy weekend for me. Birthday parties and entertaining cousins.

Your hapswap plugin needed the HalBrain.ReadOnlyMode = true function because you often gave it commands that you didn't want Hal to remember... And Contrariwise, you should have HalBrain.ReadOnlyMode = false if you were to have a natural conversation...

Basically, you did good and your reasoning is sound.

It should be in its own plugin. Like ExtendedHal.uhp or HalCon.uhp or something like that.

Just remember that if you say anything that will trigger your HapSwap then Hal will not (maybe) remember it, if and only if your Hapswap plugin is run after your new plugin. Because if your new plugin is run after HapSwap then HalBrain.ReadOnlyMode = False will reset it to remembering mode.

I think thats how it works but I haven't tested it so I could be wrong.

Anyway, I think it sounds great and your headed in the right direction, so if you disagree with anything I said here I'll probably back you on it.
« Last Edit: April 19, 2010, 01:02:33 am by snowman »
Live long and prosper or die trying.

lightspeed

  • Hero Member
  • *****
  • Posts: 6764
    • View Profile
Snowman i need you help please !
« Reply #14 on: April 19, 2010, 06:35:59 am »
Thanks snowman, thats no problem about you taking a while even though i do get ancy sometimes lol , do you feel like being a beta tester with this ? first i need to try to find a mistake if i can on my own i am getting an error problem and have to back track a little , thats from not checking as i go all the time .

If you do feel like beta testing let me know on here and i will e mail it to you with a header "beta testing extended talk". oh and by the way after hearing what all you are doing lately your new nick name is "The great entertainer!!" lol !![:D]


  p.s. i beleive as long as you are willing to help me on things i will always post them here since this area say's " snowman i need your help!" . [:)]