Author Topic: Attempting to put Tables in the brain editor  (Read 8533 times)

Carl2

  • Hero Member
  • *****
  • Posts: 1220
    • View Profile
Attempting to put Tables in the brain editor
« on: February 04, 2016, 09:33:52 am »
  I've been going through the brain editor and I was very impressed by Roberts work on "'RESPOND: USER MENTIONING ORGANIZATIONAL CHALLENGES"  which works with business.  He has a business detect and business talk files that hal can use to talk about business events.  Rather than make a plugin to deal with Hal talking about a subject I tried to make tables, a basic detect and basic talk.  Naturally  I still needed the basic uhp script to get it to do the detecting and go to the response table.  The first problem was to remove the errors in the .uhp made difficult because the error message seemed unpredictable, I believe the script is okay but at this time I' still not sure.  During my last try I did not receive error messages but I don't believe it was working because I don't think I received a reply I wrote.
  I've done a search on this topic and didn't find much on it.  It seems like a good way to go rather than trying to put in all the possible user inputs and replies in the .uhp.
Carl2
 

raybe

  • Hero Member
  • *****
  • Posts: 1067
    • View Profile
Re: Attempting to put Tables in the brain editor
« Reply #1 on: February 04, 2016, 02:54:40 pm »
I agree Carl, I have purchased other Licenses to make it possible to have one Ultra Hal for Business and one for my personal use. With practically no additional plugins my Business version of Ultra Hal has been amazing. I have only explained the basics of what I do and some business practices with phrases 
and has worked for me great. Reminds me of basic business tactics and reminds me to make business phone calls to certain customers.

Ultra Hal still surprises me and what seems simple sometimes is pretty amazing regarding how Robert M. put it all together, not just for one particular usage.

raybe 
 

Carl2

  • Hero Member
  • *****
  • Posts: 1220
    • View Profile
Re: Attempting to put Tables in the brain editor
« Reply #2 on: February 05, 2016, 07:29:14 am »
  I'm not into the business end of things so it is about never used for me, but in looking through the brain I did see the scripting and was impressed by it.  That makes me think it is possible to change all the tables to direct hal to another topic, I'd rather not do it but since I'm not getting it to work it would be a last ditch effort. 
  I've noticed there are quite a few things in the brain I don't use, such as nicknames, The file to get my sex from a list of names ect.
  Back to my real problem, the error seems to be unpredictable and if I do not get the error the response is not coming from the table.  I just tried it and received an error message, did a fix and did not receive an error,  a retry of Hal gave an error message.
Carl2
 

Carl2

  • Hero Member
  • *****
  • Posts: 1220
    • View Profile
Re: Attempting to put Tables in the brain editor
« Reply #3 on: February 06, 2016, 06:53:54 am »
  I decided to simplify things  and skip the Detect table, I'll use a IF with a InStr(UserSentence that will detect and try to get a response from the FreeTalk table I put in.  So I'm using

If InStr(UserSentence, "General") > 0 Then
      GetResponse = GetResponse & HalBrain.ChooseSentenceFromFile("FreeTalk")
   
    End If
There is no problem with the script but I still do not receive a reply from the table, Hal has to make up her own reply.  I'd think Hal is unable to get into the FreeTalk table. 
Carl2
 

raybe

  • Hero Member
  • *****
  • Posts: 1067
    • View Profile
Re: Attempting to put Tables in the brain editor
« Reply #4 on: February 07, 2016, 12:46:49 pm »
Sorry Carl but how is the Free Talk Table written? I think your choices are limited with both things you mention which would be to redirect using key words or possibly replacing one of the existing detect Tables. Using the nickname detect table as an example. Which leaves you to possibly having to enter all that info again. I would have thought that your new detect script would have worked for you but then I don't have a Free Talk Table and I would think that the way it's written could be the error response you get.

I may not have helped at all but I did look at the tables and as you mentioned, it would look as your idea could work but depending on how the table information is written for a particular detect table would be the answer. I'm just trying to give some input.

raybe
 

Carl2

  • Hero Member
  • *****
  • Posts: 1220
    • View Profile
Re: Attempting to put Tables in the brain editor
« Reply #5 on: February 08, 2016, 03:05:56 pm »
If InStr(UserSentence, "General") > 0 Then
      GetResponse = GetResponse & HalBrain.ChooseSentenceFromFile("FreeTalk")
There are 6 types of tables that can be put in, the FreeTalk table is a sentence table put in basicResponses and the detect table is a topicsearch table that is put in miscData.  The FreeTalk table is similar to the apology table in that it just contains a series of sentences Hal can choose from.
  What I had attempted to do was eliminate the Detect table by using   " If InStr(UserSentence, "General") > 0 Then "  so if I type in General in the input box Hal will go to the next step and get a reply from FreeTalk   but that is not happening.
  While looking through the brain script it seems one of the simplest things is the joke
     If HalBrain.TopicSearch(UserSentence, "jokeDetect") = "True" Then GetResponse = GetResponse &   HalBrain.ChooseSentenceFromFile("jokes")
    HalBrain.DebugWatch GetResponse, "Jokes"

Well I guess I can change names and give it a try.
Carl2
 

onthecuttingedge2005

  • Guest
Re: Attempting to put Tables in the brain editor
« Reply #6 on: February 08, 2016, 04:02:49 pm »
If InStr(UserSentence, "General") > 0 Then
      GetResponse = GetResponse & HalBrain.ChooseSentenceFromFile("FreeTalk")
There are 6 types of tables that can be put in, the FreeTalk table is a sentence table put in basicResponses and the detect table is a topicsearch table that is put in miscData.  The FreeTalk table is similar to the apology table in that it just contains a series of sentences Hal can choose from.
  What I had attempted to do was eliminate the Detect table by using   " If InStr(UserSentence, "General") > 0 Then "  so if I type in General in the input box Hal will go to the next step and get a reply from FreeTalk   but that is not happening.
  While looking through the brain script it seems one of the simplest things is the joke
     If HalBrain.TopicSearch(UserSentence, "jokeDetect") = "True" Then GetResponse = GetResponse &   HalBrain.ChooseSentenceFromFile("jokes")
    HalBrain.DebugWatch GetResponse, "Jokes"

Well I guess I can change names and give it a try.

not gonna work: General
Carl2

Carl2

  • Hero Member
  • *****
  • Posts: 1220
    • View Profile
Re: Attempting to put Tables in the brain editor
« Reply #7 on: February 09, 2016, 01:52:49 pm »
not gonna work: General
It took a while but I did give it a try and as OTC said it's not gonna work.  Rather strange results when putting it in with a few other plugins, I originally got an error about an if statement, took out all the plugins and it was okay, put in the test plugin and it was okay added a few more and still okay.  Gave it a try and it's not working.

If HalBrain.TopicSearch(UserSentence, "afreetalk") = "True" Then
  GetResponse = GetResponse & HalBrain.ChooseSentenceFromFile("FreeDetect1")   
So simple why doesn't it work

It seems Gender and age is okay,  if I use freewill and the test plugin together there is an error, either one by itself and gender and age  there is no error.
Carl2
 

Carl2

  • Hero Member
  • *****
  • Posts: 1220
    • View Profile
Re: Attempting to put Tables in the brain editor
« Reply #8 on: February 09, 2016, 05:04:41 pm »
  I'm going to fast and making mistakes but it was interesting
 
If HalBrain.TopicSearch(UserSentence, ("FreeDetect1")) = "True" Then
  GetResponse = GetResponse & HalBrain.ChooseSentenceFromFile("afreetalk")
I had found the plugin script was not placed in HalScript file, I opened it and it was not in the HalScript.
I placed the plugin in area2 and saw it needed a second end parentheses made the correction restarted hal  but it still didn't work.   I may try pasting it in the brain.
Carl2
 

onthecuttingedge2005

  • Guest
Re: Attempting to put Tables in the brain editor
« Reply #9 on: February 09, 2016, 07:42:35 pm »
not gonna work: General
It took a while but I did give it a try and as OTC said it's not gonna work.  Rather strange results when putting it in with a few other plugins, I originally got an error about an if statement, took out all the plugins and it was okay, put in the test plugin and it was okay added a few more and still okay.  Gave it a try and it's not working.

If HalBrain.TopicSearch(UserSentence, "afreetalk") = "True" Then
  GetResponse = GetResponse & HalBrain.ChooseSentenceFromFile("FreeDetect1")   
So simple why doesn't it work

It seems Gender and age is okay,  if I use freewill and the test plugin together there is an error, either one by itself and gender and age  there is no error.
Carl2

Hi Carl.


there are different table versions that are answered differently, correct format of calling it need be acounted.

the table you call afreetalk must exist and contain information otherwise it will give an error possibly a blank response. make sure to have the table created upon s specific response or you will get another error especially if that table contains no info.

TopicSearch responses contain a trigger and a response simular to "guess what","what?" except they are in a table now and not the usual text trigger.

make sure:

If HalBrain.TopicSearch(UserSentence, "afreetalk") = "True" Then   '<--- make sure table exists and with info already in it...
  GetResponse = GetResponse & HalBrain.ChooseSentenceFromFile("FreeDetect1") '<--- make sure table exist and with info in it....

End If ' <--- end your If

Carl2

  • Hero Member
  • *****
  • Posts: 1220
    • View Profile
Re: Attempting to put Tables in the brain editor
« Reply #10 on: February 10, 2016, 09:34:57 am »
   A big Thanks OTC, Seems you've solved the problem, it had needed the End If.  it ends the error and gets the reply from the afreetalk. 

If HalBrain.TopicSearch(UserSentence, ("FreeDetect1")) = "True" Then
  GetResponse = GetResponse & HalBrain.ChooseSentenceFromFile("afreetalk")
 HalBrain.DebugWatch GetResponse, "afreetalk"
End If

  afreetalk is a sentence file located in basicResponse and FreeDetect1 is a Topic search table located in miscData,  FreeDetect1 contains the  detect word and the topic is True.
 
Probably a lot more can be done with this as Robert has already shown with his scripting
Thanks again
Carl2