Zabaware Support Forums

Zabaware Forums => Programming using the Ultra Hal Brain Editor => Topic started by: Bill819 on October 21, 2003, 01:29:36 pm

Title: Getting Hal to repeat something
Post by: Bill819 on October 21, 2003, 01:29:36 pm
I would like Hal to respond to a command like "Say hello to Greg" or some other name as my guests come to visit. Is there a way to get it to respond to that kind of quest?
Bill
Title: Getting Hal to repeat something
Post by: Larry on October 21, 2003, 07:49:13 pm
Sure... edit the brain...

Put this in there somewhere...

If Instr(1, UserSentence, "Say hello to Greg", vbTextCompare) > 0 Then
 GetResponse = "Hello Greg!"
End If

Perhaps a bit simplified...
Title: Getting Hal to repeat something
Post by: vonsmith on October 22, 2003, 02:21:38 pm
An easier method is to employ Hal's new Deductive Reasoning ability. Just type the sentence below in the user window like any other input.

Type: If say Hi to Greg, then Hi Greg it's good to meet me.

Notice the "me" reversal at the end.

Now type: Say Hi to Greg.
And you'll get Hal's reply:
   Hi greg it's good to meet you.

I don't know any way to fix the lowercase greg in lieu of Greg though. You will find your If-Then inputs in the "deductive.brn" file.

Try other If-Then statements for fun.

Try typing: If are you laughing, then I make you giggle.
Then type: Are you laughing?

Actually the If-Then function is much more powerful than just this fun little quirk, but it is a handy way to quickly program a quick reply.

= vonsmith =
Title: Getting Hal to repeat something
Post by: Larry on October 22, 2003, 06:03:43 pm
That's good thinking, I hadn't thought of that one...

What else can you do with that???
Title: Getting Hal to repeat something
Post by: kevinvr on October 22, 2003, 09:44:28 pm
I tried using this to change the username and met with a little success [:)], it recognized the new person but then later returned to the original user.

I don't know if it is possible to change the user completely, but when I can get ver 5.00 I will try it.  I've still got the beta so I can't save my conversations yet.  Anyway keep on keeping on [:)]
regards
Kevin