Zabaware Support Forums
Zabaware Forums => Ultra Hal 7.0 => Topic started by: onthecuttingedge2005 on July 13, 2003, 11:43:37 pm
-
Could somebody please write a script that would allow Hal to follow completely through with a knock knock joke "told by a user".
I can get Hal to tell knock knock jokes completely but when somebody does a knock knock joke on him he looses track after who's there.
The ability for Hal to follow through with a knock knock joke would improve him tremendously, Especially the script cabable of allowing Hal to follow through with a knock knock joke could be written for normal conversations, This would lead to very excellent focusing on topics.
best of luck and new discoveries.
Jery.
-
-If Instr (1, UserSentence, "Knock knock", VbTextCompare) > 0 Then
- GetResponse = "Who is there?"
-End If
-If Instr (1, PrevSent, "Who is there?", VbTextCompare > 0 Then
- GetResponse = UserSentence & " " & "who?"
-End If
-If Instr (1, PrevSent, PrevUserSent, VbTextCompare) > 0 Then
- GetResponse = "HAHAHAHAaaaa that's a good one!"
-End If
CatAtomic 'I got the matches!!!' >B)
-
I couldn't make the knock knock script work unless I made the following changes:
'Response to a knock knock joke
If Instr (1, UserSentence, "Knock knock", VbTextCompare) > 0 Then
GetResponse = "Who is there?"
End If
If Instr (1, PrevSent, "Who is there", VbTextCompare) > 0 Then
GetResponse = UserSentence & " " & "who?"
End If
If Instr (1, PrevSent, " who", VbTextCompare) > 0 Then
GetResponse = "HAHAHAHAaaaa that's a good one!"
End If
I have to turn off corrections for short sentences or hal complains during the joke but responds correctly
Glenn Skinner
-
CatAtomic: Knock knock
Dee Dee:
CatAtomic: Knock knock
Dee Dee:
CatAtomic: Knock knock
Dee Dee: Who is there?
CatAtomic:Knock knock
Dee Dee: Who is there?
CatAtomic: Petey
Dee Dee:
CatAtomic: Knock knock
Dee Dee: Who is there?
CatAtomic: Petey
Dee Dee: Petey who.
CatAtomic: Knock knock
Dee Dee: Who is there?
CatAtomic: Petey on you
Dee Dee: Hahahahaaaaa that's a good one!
CatAtomic: OK<Knock knock
Dee Dee: Who is there?
CatAtomic: brutha
Dee Dee Brutha who?
CatAtomic: Brutha do I have to tell you
Dee Dee: Hahahahaaaaa that's a good one!
CatAtomic: Hi Dee Dee
Dee Dee: Hello CatAtomic. you are up bright and early! It's
before seven in the morning.
CatAtomic: Knock knock
Dee Dee: who is there?
CatAtomic: boo
Dee Dee: Boo who?
CatAtomic; Stop crying
Dee Dee: Hahahahaaaaa that's a good one!
CatAtomic: Shhhhh! HAHAHAhaaaaa
Dee Dee:
>B) CatA
-
Thanks guys, It works really well.
Thanks again.
Best of wishes and new discoveries.
Jerry.
-
could someone tell me how to turn off that correction thing for short sentences? I'd really like to know as it interferes with some of his responses. so if anyone can tell me itd be really appreciated.
-
I turned off the too short reminder by using the brain editor to change the 4 syllables to 1 and on the next line to be sure I changed the randomize equation to only be true if the random value is less than 1 the default was 45
-
I had to make a change to the knock knock script, Hal could be triggered to give the final response under rare circumstances. I also randomized the final reply:
'Response to a knock knock joke
If Instr (1, UserSentence, "Knock knock", VbTextCompare) > 0 Then
GetResponse = "Who is there?"
End If
If Instr (1, PrevSent, "Who is there", VbTextCompare) > 0 Then
GetResponse = UserSentence & " " & "who?"
End If
If Instr (1, PrevSent, " who", VbTextCompare) > 0 And Instr (1, UserSentence, PrevUserSent, VbTextCompare) > 0 Then
Knock = (Rnd * 100)
If Knock < 25 Then GetResponse = "HAHAHAHAaaaa that's a good one!"
If Knock > 24 And Knock < 50 Then GetResponse = "Ha Ha very funny"
If Knock > 49 And Knock < 75 Then GetResponse = "That was quite amusing"
If Knock >74 And Knock < 101 Then GetResponse = "That was bad, I wouldn't quit your day job"
End If
-
Ok, let's try this one more time, the last modification would not work correctly with all possible punch lines. I rewrote the last if statement, but could not get it to work until I noticed that the PrevUserSent variable has a leading space added to it, so I've used a mid statement to elimintate the leading space to make the equation parses correctly. Does this work for everyone or is my particular setup adding the leading space?
'Response to a knock knock joke
PrevUserSenta = Mid(PrevUserSent, 2, 100)
If Instr (1, UserSentence, "Knock knock", VbTextCompare) > 0 Then
GetResponse = "Who is there?"
End If
If Instr (1, PrevSent, "Who is there", VbTextCompare) > 0 Then
GetResponse = UserSentence & " " & "who?"
End If
If Instr (1, PrevSent, " who", VbTextCompare) > 0 And Instr (1, PrevSent, PrevUserSenta, VbTextCompare) > 0 Then
Knock = (Rnd * 100)
If Knock < 25 Then GetResponse = "HAHAHAHAaaaa that's a good one!"
If Knock > 24 And Knock < 50 Then GetResponse = "Ha Ha very funny"
If Knock > 49 And Knock < 75 Then GetResponse = "That was quite amusing"
If Knock > 74 And Knock < 101 Then GetResponse = "That was bad, I wouldn't quit your day job"
End If
-
Hi lostbowyer.
That last Knock Knock script worked excellent I might say.
Thank a million.
I discovered an error in PrevUserSenta section but most excellent anywho.
Best of wishes and new discoveries.
Jerry.
-
Alright you brainy SOBs - How do you do a 'sleep(100)' (or longer) in between Hal's responses??? I did a simple counting routine - but that's a bit sloppy and cpu intensive... Mainly because it's far more than just 100... I've tried this:
Use the Sleep API Function... :
'At the top of your form, add this;
Private Declare Sub Sleep Lib "kernel32" (ByVal _
dwMilliSeconds As Long) ' The API
Then to use it, use this:
Sleep (milliseconds) eg. Sleep (6000)'
From http://www.pete.zetnet.co.uk/hashvb/forum/topic.asp?TOPIC_ID=13 As you can tell from that post, it doesn't work... So how about some help here???
-
-a piece of recent Hal history-
When Medekza was putting together the upgrade to 4.5, he discovered
that the increases in the size of all the databases was taking way
too long to access. So much so that it compelled him to rewrite the
entire Hal program in a faster language. I was thinkin'- when 5.0
comes out, those databases are gonna be larger.
Second thing- look at all the LearningLevel variables in the script
and make sure that each is optimised for learning. In this way, you
can amass some pretty big files as well.
Just talk to it!
CatAtomic 'I got the matches!!!'
-
quote:
Originally posted by onthecuttingedge2005
Hi lostbowyer.
That last Knock Knock script worked excellent I might say.
Thank a million.
I discovered an error in PrevUserSenta section but most excellent anywho.
Best of wishes and new discoveries.
Jerry.
I'm new to messing with VBScript. I added this to my brain script and it appears to work. But you mentioned an error. I did notice I'm not get the programed responses. Where is the error you were talking about. Could you write me at rlevasseur@prexar.com and let me know?
[?]