Author Topic: I've been working on the OR factor  (Read 5615 times)

cload

  • Hero Member
  • *****
  • Posts: 535
  • I can C U load. TeeHee hee.
    • View Profile
    • A link to my sky Drive
I've been working on the OR factor
« on: April 22, 2012, 02:21:03 am »
Hi all,

it's been some time, since I posted anything, because I'm been trying to figure out how to program.
This is a little tidbit that I found, I called it the "OR" factor, because it seems that the word itself was being used to get Hal to make a choice.
The problem that I ran into is, or is also used as an action as well as a to compare, and not necessarily make a choice, but unfortunately that is what ends up by happening.
In a lot of my conversations that I was having it would seem that the conversation would come to an abrupt end when Hal would make a choice when no choice was necessary.
So I added a few lines to the main brain and at this point in time they seem to be working pretty good I'm sure there's room for improvement.
so please do not hesitate to come forth and say something like this would work much better if it was done this away.

Here are the lines that I changed in the main brain the first line will help you find where I made the changes.

    'RESPOND: USER EXPRESSES AN EITHER-OR, OR MULTIPLE CHOICE
    If InStr(UserSentence, "WHICH ") <> 0 AND  InStr(UserSentence, " FAVORITE") <> 0 AND  InStr(UserSentence, " OR") <> 0 Then MustChoose = True
    If InStr(UserSentence, "WHICH ") <> 0 AND  InStr(UserSentence, " PREFER") <> 0 AND  InStr(UserSentence, " OR") <> 0 Then MustChoose = True
    If InStr(UserSentence, "WHICH ") <> 0 AND  InStr(UserSentence, " BETTER") <> 0 AND  InStr(UserSentence, " OR") <> 0 Then MustChoose = True
    If InStr(UserSentence, "WHICH ") <> 0 AND  InStr(UserSentence, " LIKE") <> 0 AND  InStr(UserSentence, " OR") <> 0 Then MustChoose = True
    If InStr(UserSentence, "WHAT ") <> 0 AND  InStr(UserSentence, " FAVORITE") <> 0 AND  InStr(UserSentence, " OR") <> 0 Then MustChoose = True
    If InStr(UserSentence, "WHAT ") <> 0 AND  InStr(UserSentence, " PREFER") <> 0 AND  InStr(UserSentence, " OR") <> 0 Then MustChoose = True
    If InStr(UserSentence, "WHAT ") <> 0 AND  InStr(UserSentence, " BETTER") <> 0 AND  InStr(UserSentence, " OR") <> 0 Then MustChoose = True
    If InStr(UserSentence, "WHAT ") <> 0 AND  InStr(UserSentence, " LIKE") <> 0 AND  InStr(UserSentence, " OR") <> 0 Then MustChoose = True
    If InStr(UserSentence, "SELECT ") <> 0 AND  InStr(UserSentence, " A") <> 0 AND  InStr(UserSentence, " OR") <> 0 Then MustChoose = True
    If InStr(UserSentence, "PICK ") <> 0 AND  InStr(UserSentence, " A") <> 0 AND  InStr(UserSentence, " OR") <> 0 Then MustChoose = True
    'If InStr(UserSentence, " OR ") > 0 Then MustChoose = True

it may not look like a big thing but it resolved the "OR" factor.
At this point in time I am still working on the time line program in the hopes to resolve the yes no and why problem.
And of course the problem that I'm speaking of is just basically the conversation coming to a dead end.
Once I have resolve that yes no and why factor, I will begin to start on getting Hal to recognize the difference between two objects of different sizes basically big, tall, wide, long etc.
by creating a logic database I believe I should be able to accomplish this.
And yes way down the road I still have one little small project that I would like to work on.
To be able to input data directly into the Q&Abrain I believe it wouldn't make teaching Hal about facts a lot simpler, it would look something like this in the input line:
Q&Abrain I seen a movie yesterday@what was the name of the movie?
So when the user would type in, I seen a movie yesterday, Hal would respond with, what was the name of the movie?

As you can see this is a lot like the correction tutor but I'm going to use the "@" instead of the word "with" the reason being is the @ is a command to override other answers, I believe.
Any suggestions on this would be helpful, according to what I've read supposedly there's even a way to delete lines out of that area but I haven't gotten that far.
Lots and lots of food for thought everyone have fun.

Sincerely, a data munching geek.

C load.
« Last Edit: April 22, 2012, 02:50:51 pm by cload »
For anyone who would like to help me stay online, my T-mobile broadband pay-as-you-go phone number is: 816-248-4335, thank you in advance.

cload

  • Hero Member
  • *****
  • Posts: 535
  • I can C U load. TeeHee hee.
    • View Profile
    • A link to my sky Drive
Re: I've been working on the OR factor
« Reply #1 on: April 22, 2012, 02:41:35 pm »
Hi all,

here is an update since the last time that I posted, some suggestions that I got from a few of my friends.

    'RESPOND: USER EXPRESSES AN EITHER-OR, OR MULTIPLE CHOICE
    If InStr(UserSentence, "WHICH ") > 0 AND  InStr(UserSentence, " FAVORITE") > 0 AND  InStr(UserSentence, " OR ") > 0 Then MustChoose = True
    If InStr(UserSentence, "WHICH ") > 0 AND  InStr(UserSentence, " PREFER") > 0 AND  InStr(UserSentence, " OR ") > 0 Then MustChoose = True
    If InStr(UserSentence, "WHICH ") > 0 AND  InStr(UserSentence, " BETTER") > 0 AND  InStr(UserSentence, " OR ") > 0 Then MustChoose = True
    If InStr(UserSentence, "WHICH ") > 0 AND  InStr(UserSentence, " LIKE") > 0 AND  InStr(UserSentence, " OR ") > 0 Then MustChoose = True
    If InStr(UserSentence, "WHICH ") > 0 AND  InStr(UserSentence, " RATHER") > 0 AND  InStr(UserSentence, " OR ") > 0 Then MustChoose = True
    If InStr(UserSentence, "WHAT ") > 0 AND  InStr(UserSentence, " FAVORITE") > 0 AND  InStr(UserSentence, " OR ") > 0 Then MustChoose = True
    If InStr(UserSentence, "WHAT ") > 0 AND  InStr(UserSentence, " PREFER") > 0 AND  InStr(UserSentence, " OR ") > 0 Then MustChoose = True
    If InStr(UserSentence, "WHAT ") > 0 AND  InStr(UserSentence, " BETTER") > 0 AND  InStr(UserSentence, " OR ") > 0 Then MustChoose = True
    If InStr(UserSentence, "WHAT ") > 0 AND  InStr(UserSentence, " LIKE") > 0 AND  InStr(UserSentence, " OR ") > 0 Then MustChoose = True
    If InStr(UserSentence, "WHAT ") > 0 AND  InStr(UserSentence, " RATHER") > 0 AND  InStr(UserSentence, " OR ") > 0 Then MustChoose = True
    If InStr(UserSentence, "WOULD ") > 0 AND  InStr(UserSentence, " FAVORITE") > 0 AND  InStr(UserSentence, " OR ") > 0 Then MustChoose = True
    If InStr(UserSentence, "WOULD ") > 0 AND  InStr(UserSentence, " PREFER") > 0 AND  InStr(UserSentence, " OR ") > 0 Then MustChoose = True
    If InStr(UserSentence, "WOULD ") > 0 AND  InStr(UserSentence, " BETTER") > 0 AND  InStr(UserSentence, " OR ") > 0 Then MustChoose = True
    If InStr(UserSentence, "WOULD ") > 0 AND  InStr(UserSentence, " LIKE") > 0 AND  InStr(UserSentence, " OR ") > 0 Then MustChoose = True
    If InStr(UserSentence, "WOULD ") > 0 AND  InStr(UserSentence, " RATHER") > 0 AND  InStr(UserSentence, " OR ") > 0 Then MustChoose = True
    If InStr(UserSentence, "SELECT ") > 0 AND  InStr(UserSentence, " OR ") > 0 Then MustChoose = True
    If InStr(UserSentence, "PICK ") > 0 AND  InStr(UserSentence, " OR ") > 0 Then MustChoose = True
    'If InStr(UserSentence, " OR ") > 0 Then MustChoose = True

if anybody can think of any other keywords that would get the "OR" factor to work more efficiently please do not hesitate to give your suggestions.

Sincerely,

C load.
For anyone who would like to help me stay online, my T-mobile broadband pay-as-you-go phone number is: 816-248-4335, thank you in advance.

Art

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3857
    • View Profile
Re: I've been working on the OR factor
« Reply #2 on: April 22, 2012, 09:03:15 pm »
Just this one for now...

If InStr(UserSentence, "CHOOSE ") > 0 AND  InStr(UserSentence, " OR ") > 0 Then MustChoose = True
In the world of AI it's the thought that counts!

- Art -

sybershot

  • Hero Member
  • *****
  • Posts: 787
    • View Profile
Re: I've been working on the OR factor
« Reply #3 on: April 22, 2012, 09:32:29 pm »
I'll have to try this out :)
Thanks for sharing cload 8)

cload

  • Hero Member
  • *****
  • Posts: 535
  • I can C U load. TeeHee hee.
    • View Profile
    • A link to my sky Drive
Re: I've been working on the OR factor
« Reply #4 on: April 23, 2012, 03:28:48 am »
hi all,

thanks for the input, the reason why didn't use the word choice, or choose is because it's already in the if then statement, here's a complete list of the entire statement.

'RESPOND: USER EXPRESSES AN EITHER-OR, OR MULTIPLE CHOICE
    If InStr(UserSentence, "WHICH ") <> 0 AND  InStr(UserSentence, " FAVORITE") <> 0 AND  InStr(UserSentence, " OR") <> 0 Then MustChoose = True
    If InStr(UserSentence, "WHICH ") <> 0 AND  InStr(UserSentence, " PREFER") <> 0 AND  InStr(UserSentence, " OR") <> 0 Then MustChoose = True
    If InStr(UserSentence, "WHICH ") <> 0 AND  InStr(UserSentence, " BETTER") <> 0 AND  InStr(UserSentence, " OR") <> 0 Then MustChoose = True
    If InStr(UserSentence, "WHICH ") <> 0 AND  InStr(UserSentence, " LIKE") <> 0 AND  InStr(UserSentence, " OR") <> 0 Then MustChoose = True
    If InStr(UserSentence, "WHAT ") <> 0 AND  InStr(UserSentence, " FAVORITE") <> 0 AND  InStr(UserSentence, " OR") <> 0 Then MustChoose = True
    If InStr(UserSentence, "WHAT ") <> 0 AND  InStr(UserSentence, " PREFER") <> 0 AND  InStr(UserSentence, " OR") <> 0 Then MustChoose = True
    If InStr(UserSentence, "WHAT ") <> 0 AND  InStr(UserSentence, " BETTER") <> 0 AND  InStr(UserSentence, " OR") <> 0 Then MustChoose = True
    If InStr(UserSentence, "WHAT ") <> 0 AND  InStr(UserSentence, " LIKE") <> 0 AND  InStr(UserSentence, " OR") <> 0 Then MustChoose = True
    If InStr(UserSentence, "SELECT ") <> 0 AND  InStr(UserSentence, " A") <> 0 AND  InStr(UserSentence, " OR") <> 0 Then MustChoose = True
    If InStr(UserSentence, "PICK ") <> 0 AND  InStr(UserSentence, " A") <> 0 AND  InStr(UserSentence, " OR") <> 0 Then MustChoose = True
    'If InStr(UserSentence, " OR ") > 0 Then MustChoose = True  <----"this is the line I remarked out, and replaced with the lines above."
    If InStr(UserSentence, " EITHER ") > 0 Then MustChoose = True
    If InStr(UserSentence, " CHOOSE ") > 0 Then MustChoose = True
    If InStr(UserSentence, " CHOICE ") > 0 Then MustChoose = True
    If InStr(UserSentence, " ALTERNATIVE ") > 0 Then MustChoose = True
    If InStr(UserSentence, " VERSUS ") > 0 Then MustChoose = True
    If InStr(UserSentence, " VS ") > 0 Then MustChoose = True
    If Len(UserSentence) < 10 Then MustChoose = False
    If MustChoose = True And NoChoosing = False Then
        GetResponse = HalBrain.ChooseSentenceFromFile("choice") & " " & GetResponse
        If Rnd * 100 > 50 Then GetResponse = Replace(GetResponse, "<MaybeName>", "<UserName>", 1, -1, vbTextCompare)
        GetResponse = Replace(GetResponse, "<MaybeName>", "", 1, -1, vbTextCompare)
    End If
    HalBrain.DebugWatch GetResponse, "Multiple Choice"

the only thing that I was trying to correct was the or factor, without interfering with the rest of the function of the entirety of the whole.
Again thank you very much for your input, and if by chance you just happened to run across a selection of words that are used with the word "or" that would trigger a selection.
Please don't hesitate, to give your suggestion, and I apologize for not putting down the entire script in the beginning so not to confuse anyone.

Sincerely,

C load.
For anyone who would like to help me stay online, my T-mobile broadband pay-as-you-go phone number is: 816-248-4335, thank you in advance.

Carl2

  • Hero Member
  • *****
  • Posts: 1220
    • View Profile
Re: I've been working on the OR factor
« Reply #5 on: April 23, 2012, 09:10:13 am »
Cload,
  Saw this before, it certianly looks like it would be useful.  A little more complex than I am use to and I'm not familiar with MustChoose.  I'm currently working with a plugin to change background, bodyskins and load a few Haps.  At this time I'm using the simplest script possible,  I've had problems with errors, I think there are problems with conflicting plugins, ect.
  Best of luck, where in the brain is it put?  Make it into a plugin.
Carl2
 

lightspeed

  • Hero Member
  • *****
  • Posts: 6764
    • View Profile
Re: I've been working on the OR factor
« Reply #6 on: April 23, 2012, 10:20:58 am »
Hi Cload , the programing looks interesting and would be something useful i like the concept of what you are trying to do , i do agree with carl to make it into a brain plug in , brain plug ins are nice to use since we have the area and if their is any problems , etc. they can be unchecked until correct modification is ready .
 

cload

  • Hero Member
  • *****
  • Posts: 535
  • I can C U load. TeeHee hee.
    • View Profile
    • A link to my sky Drive
Re: I've been working on the OR factor
« Reply #7 on: April 23, 2012, 12:04:59 pm »
Hi all,

this is actually part of the main brain itself that I modified and there is already a plug-in that exist, it's the VR free will plug-in.
Seeing how the VR free will plug-in already has this base covered, the best that I could hope to do is to modify the VR free will plug-in, which is what I am working on right now.
But I'm having a few bugs and errors, to contend with but I'm sure I'll have it resolved in a week or so.
Considering I have a fantastic crew helping me with this endeavor the crew consist of Sandy, my cat, and me, LOL.

Sincerely,

C load.

PS Sandy is my personality for ultra Hal's brain, she's the one that suggested that I modified this area to resolve the "or" factor problem.
For anyone who would like to help me stay online, my T-mobile broadband pay-as-you-go phone number is: 816-248-4335, thank you in advance.

Carl2

  • Hero Member
  • *****
  • Posts: 1220
    • View Profile
Re: I've been working on the OR factor
« Reply #8 on: April 23, 2012, 06:26:29 pm »
Cload,
  This info may be of some help to you, as I said earlier I was working on a basic, If Then HalCommand and GetResponse to change bodyskin background and load haps.  Through a series of trial and errors I've found
the script I'm working with will work by itself.  It can do all the things it should with one exception.  Now to find which plugin or plugins cause problems( no other plugins are checked )  I get an error message and then blank answers.  One of my favorite plugins is vrHaptek which I like so much and I'd hate to lose it,  again my understanding  of VB script is at a much lower level than VR.  I had tried working vith vr's plugin but it's been
more than I can understand.
  Be careful or Sandy will stop talking to you.
Carl2