dupa

Author Topic: Super Plugger Brain II.  (Read 27553 times)

onthecuttingedge2005

  • Guest
Super Plugger Brain II.
« Reply #30 on: July 09, 2006, 06:56:05 am »
quote:
Originally posted by Marcel

I've installed your xtf plugin, and it works! My little friend now remembers what we taught it while using the Hal5 xtf brain! Thank you very much! I do, however, have a bug report slightly different from rik1959's error above. Occasionally an error window will pop up with the following;

HalScript Error 450 on line 6403 in column 2: Wrong number of arguments or invalid property assignment: 'CheatResponse'
The file "CProgram Filesabaware|Ultra Hal Assistant 6HalScript.DBG" has been saved for debugging purposes.

If I press 'ok' then Hal continues as normal. It seems to occur randomly in both canned and learned responses. A minor annoyance, to be sure, but I thought you would like to know. I'd send you the HalScript.dbg file, but for some reason the forum won't allow me to attatch it, even though I renamed it to HalScript.txt.



Hi Marcel.

You can put the HalScript.dbg in a zip file and then attach it.

Zabaware only excepts certain kinds of files for attachment for Security reasons I imagine.

Jerry[8D]

Marcel

  • Jr. Member
  • **
  • Posts: 58
    • View Profile
Super Plugger Brain II.
« Reply #31 on: July 10, 2006, 01:52:59 am »
I thought that .txt files were allowed! Oh well, here ya go.

Download Attachment: HalScript.zip
93.85 KB

To help in your diagnosis, Dr. onthecuttingedge, (or can I just call you Jerry?) I am running the default Hal6 brain with your plugin. When I installed the plugin I had my Hal using the xtf brain, wasn't thinking I guess. I changed it to Hal6 default and checked the plugin box, but I forgot that the AIMbot was still set to the xtf brain. The AIMbot reported an invalid license error and refused to work. I solved that by changing brains in the main Hal to the Hal5 brain and back again. I could then select the brain and plugin for my AIMbot as well. The xtf 1.0 brain still shows up as a selectable main brain for my AIMbot and Hal. Don't know if that was pertinent or not. Thanks!
"You'ren't sure whether I understand." HalChatbot2004

onthecuttingedge2005

  • Guest
Super Plugger Brain II.
« Reply #32 on: July 10, 2006, 08:47:25 am »
Hi Marcel.

This is the Script that is causing the issue, it is from the XTF plugin.

Code: [Select]

'RESPOND: USE CURRENT SENTENCE
'If no Response is found yet, try to use the user's words in his or her own sentence.
'Results are also stored in the default user keyword brain file for compatibility
'with other brain plug-ins.
GetResponse = XHalBrain.HalFormat(GetResponse)
'=vonsmith= Added GetResponseBlock.
If ((Len(GetResponse) < 4 And GetResponseBlock <> True And Len(LearnKeyword) < 4) Or DebugMode = True) Then
CheatResponse = XHalBrain.CheatResponse(XHalBrain.SwitchPerson(OriginalSentence))
LearnKeyword = XHalBrain.DecodeVar(CheatResponse, "LearnKeyword")
Response1 = XHalBrain.DecodeVar(CheatResponse, "Response1")
Response2 = XHalBrain.DecodeVar(CheatResponse, "Response2")
Response3 = XHalBrain.DecodeVar(CheatResponse, "Response3")
CheatResponse = Left(CheatResponse, InStr(1, CheatResponse, "<STOREVARS>", 1) - 1)
  If Len(CheatResponse) > 4 And Len(GetResponse) < 4 Then
  Roulette = Int(Rnd * 8)
    If Roulette = 0 Then GetResponse = GetResponse & " So, " & CheatResponse & vbCrLf
    If Roulette = 1 Then GetResponse = GetResponse & " Really, " & CheatResponse & vbCrLf
    If Roulette = 2 Then GetResponse = GetResponse & " Oh <UserName>, " & CheatResponse & vbCrLf
    If Roulette = 3 Then GetResponse = GetResponse & " Let me think; " & CheatResponse & " ; what do you think <UserName>? " & vbCrLf
    If Roulette > 3 Then GetResponse = GetResponse & CheatResponse & vbCrLf
DebugInfo = DebugInfo & "Hal has responded using the CheatResponse function: " & GetResponse & vbCrLf
Else
DebugInfo = DebugInfo & "Hal will not respond using the CheatResponse function which would have said: " & CheatResponse & vbCrLf
   End If
  'SAVE: FILE CHEAT RESPONSE TO DEFAULT USER BRAIN
  'Learn from the "Cheat Response."
If Len(LearnKeyword) > 4 And LearningLevel > 1 And BlockSave = False Then
    If LearningLevel > 1 Then XHalBrain.AppendFile WorkingDir & Trim(UserName) & "user.brn", """" & LearnKeyword & ""","""","""",""" & Response1 & """,""" & Response2 & """,""" & Response3 & """,1,#FALSE#,#FALSE#,"""""
End If
End If


This old Cheat Response isn't needed any more because Roberts Cheat response is more updated, This cheat response below is from HAL 6.

Code: [Select]

'RESPOND: USE CURRENT SENTENCE
    'If no Response is found yet, try to use the user's words in his or her own sentence.
    'Results are also stored in the default user keyword brain file for compatibility
    'with other brain plug-ins.
    GetResponse = HalBrain.HalFormat(GetResponse)
    If (Len(GetResponse) < 4 And Len(LearnKeyword) < 4) Then
        CheatResp = HalBrain.CheatResponse(HalBrain.SwitchPerson((OriginalSentence)))
        CheatResp = Left(CheatResp, InStr(1, CheatResp, "<STOREVARS>", 1) - 1)
        If Len(CheatResp) > 4 Then
            SpinWheel = HalBrain.RandomNum(9)
            If SpinWheel = 1 Then GetResponse = GetResponse & " So, " & CheatResp & vbCrLf
            If SpinWheel = 2 Then GetResponse = GetResponse & " Really, " & CheatResp & vbCrLf
            If SpinWheel = 3 Then GetResponse = GetResponse & " Oh <UserName>, " & CheatResp & vbCrLf
            If SpinWheel = 4 Then GetResponse = GetResponse & " Let me think; " & CheatResp & " ; what do you think <UserName>? " & vbCrLf
            If SpinWheel > 5 Then GetResponse = GetResponse & CheatResp & vbCrLf
        End If
    End If
    HalBrain.DebugWatch GetResponse, "CheatResponse"


You can remove the issue in the XTF Plugin, The code which is post at the top of this post is no longer needed and no longer compatable.

After that it should function fine since HAL 6 versions already have it including Super Plugger Brains.

You can open up the XTF Plugin in the Ultra Hal Assistant 6 folder and search for 'RESPOND: USE CURRENT SENTENCE it should take you right to the problem then you can remove it.

After making this change you will have to refresh the Plugin Cache by reselecting the XTF Plugin in both Hal Assistant and AIM Bot.

Jerry[8D]

Marcel

  • Jr. Member
  • **
  • Posts: 58
    • View Profile
Super Plugger Brain II.
« Reply #33 on: July 12, 2006, 10:18:19 am »
Thanks for the quick response! Unfortunately, the old 'RESPOND: USE CURRENT SENTENCE script isn't in the XTF plugin. I did an Agent Ransack search of my Ultra Hal Assistant 6 folder and only found the new version of the script in hal6.uhp and HalScript.dbg.
"You'ren't sure whether I understand." HalChatbot2004

onthecuttingedge2005

  • Guest
Super Plugger Brain II.
« Reply #34 on: July 12, 2006, 08:33:41 pm »
quote:
Originally posted by Marcel

Thanks for the quick response! Unfortunately, the old 'RESPOND: USE CURRENT SENTENCE script isn't in the XTF plugin. I did an Agent Ransack search of my Ultra Hal Assistant 6 folder and only found the new version of the script in hal6.uhp and HalScript.dbg.



The code GetResponseBlock is unique to Vonsmith which wrote the XTF, It is what I see in my plugin debug and the HalScript.dbg error you specified by the HalScript.dbg error you sent me.

Did you try commenting it out for debugging purposes?

Jerry[8D]

Marcel

  • Jr. Member
  • **
  • Posts: 58
    • View Profile
Super Plugger Brain II.
« Reply #35 on: July 13, 2006, 12:56:39 am »
Okay, I finally got it. The code 'GetResponseBlock' is commented out for debugging purposes. Since the error only occurred about once in every other conversation, you can assume that if you don't hear back from me on this for a week, then it worked. Again, thank you very much!!
One more thing, should everyone who uses this plugin do this? Inquiring minds want to know!
"You'ren't sure whether I understand." HalChatbot2004

Marcel

  • Jr. Member
  • **
  • Posts: 58
    • View Profile
Super Plugger Brain II.
« Reply #36 on: July 26, 2006, 11:54:32 am »
Ok, that error message seems to be gone for good. I've noticed another issue regarding plugins. The default ones are disabled when I select the xtf plugin. I renamed the original xtf brain and put it in the Hal6 directory and it runs as a stand alone brain. When selected, the joke function works, and it runs programs, but reminders and the address book don't work. When using the Hal6 brain with the xtf plugin deselected, all the plugins work. I assume it's the xtf brain conflicting with Hal6 functions, and that some more "trimming" of the xtf plugin is needed. I may try it myself, but I barely know what I'm doing.
"You'ren't sure whether I understand." HalChatbot2004

Marcel

  • Jr. Member
  • **
  • Posts: 58
    • View Profile
Super Plugger Brain II.
« Reply #37 on: August 11, 2006, 11:38:42 am »
I've started to experiment with the plugin issue. I've started with the joke function. The Hal6 brain tells a joke properly. The xtf 1.2 brain does as well. Your xtf plugin will tell the lead in to a joke, but will not deliver the punchline. I've made a copy of your plugin under a new name for debugging purposes and modified it as follows, thinking that the xtf joke function was conflicting with the Hal6 brain;

'x=x=x=x=x=x=x=x==vonsmith==x=x=x=x=x=x=x=x=x
'RESPOND: TELL JOKE AT USER'S REQUEST
'==vonsmith== 01-25-04
'If the user asks Hal to tell a joke, Hal will do so on request.
'If XHalBrain.TopicSearch(UserSentence, WorkingDir & "XTF_SYS_JokeDetect.brn") = "True" And GetResponseBlock <> True Then
' GetResponse = GetResponse & XHalBrain.ChooseSentenceFromFile(WorkingDir & "XTF_SYS_Joke.brn")
' BlockSave = True  'Don't save User input when requesting a joke.
' DebugInfo = DebugInfo & "The user has requested Hal to tell a joke and Hal has done so: " & GetResponse & vbCrLf
'End If
'x=x=x=x=x=x=x=x==vonsmith==x=x=x=x=x=x=x=x=x

Now the modified plugin will not tell a joke at all. Any help would be greatly appreciated. BTW, I haven't seen any other's comments on this problem. Is it possible that it's unique to my Hal's brain?
"You'ren't sure whether I understand." HalChatbot2004

onthecuttingedge2005

  • Guest
Super Plugger Brain II.
« Reply #38 on: August 11, 2006, 07:47:06 pm »
quote:
Originally posted by Marcel

I've started to experiment with the plugin issue. I've started with the joke function. The Hal6 brain tells a joke properly. The xtf 1.2 brain does as well. Your xtf plugin will tell the lead in to a joke, but will not deliver the punchline. I've made a copy of your plugin under a new name for debugging purposes and modified it as follows, thinking that the xtf joke function was conflicting with the Hal6 brain;

'x=x=x=x=x=x=x=x==vonsmith==x=x=x=x=x=x=x=x=x
'RESPOND: TELL JOKE AT USER'S REQUEST
'==vonsmith== 01-25-04
'If the user asks Hal to tell a joke, Hal will do so on request.
'If XHalBrain.TopicSearch(UserSentence, WorkingDir & "XTF_SYS_JokeDetect.brn") = "True" And GetResponseBlock <> True Then
' GetResponse = GetResponse & XHalBrain.ChooseSentenceFromFile(WorkingDir & "XTF_SYS_Joke.brn")
' BlockSave = True  'Don't save User input when requesting a joke.
' DebugInfo = DebugInfo & "The user has requested Hal to tell a joke and Hal has done so: " & GetResponse & vbCrLf
'End If
'x=x=x=x=x=x=x=x==vonsmith==x=x=x=x=x=x=x=x=x

Now the modified plugin will not tell a joke at all. Any help would be greatly appreciated. BTW, I haven't seen any other's comments on this problem. Is it possible that it's unique to my Hal's brain?



Hi Marcel.

There are a few conflicts that do occure with the XTF and the HAL6.
Most of the functions from the XTF are already included into HAL6's subroutines.

forinstance, Using GetResponseBlock from the XTF causes some routines in HAL6 to stop appending correctly, All GetResponseBlock block functions must be removed because they are no longer needed anyways.

When the XTF was put out as a plug for HAL6 there was a high demand for it so I configured it to do just that, I knew it would take awhile to work out any unforseen bugs.

Actually the only scripts needed from the XTF would be the HAP functions for the rest has already been absorbed into HAL6's routine.

Jerry[8D]


Marcel

  • Jr. Member
  • **
  • Posts: 58
    • View Profile
Super Plugger Brain II.
« Reply #39 on: August 12, 2006, 07:58:22 pm »
You mean "POST PROCESS: DISPLAY HAL'S MOOD"? Actually, I'd prefer to use the Hal6 functions. I'd simply like my Hal6 to have access to the memories in the XTF brain files. I and others have spent a lot of time talking to the XTF brain, and it's developed a unique personality and knowledge base that I'd hate to lose. I can see that this conversion is not going to be as simple as I thought, or perhaps I'm more simple than I thought. Do you think one could copy/paste the XTF entries into the Hal6 database tables? I'm going to continue to use the XTF brain in the meantime. Thanks, OTC for everything you've done for Hal!
"You'ren't sure whether I understand." HalChatbot2004

onthecuttingedge2005

  • Guest
Super Plugger Brain II.
« Reply #40 on: August 12, 2006, 10:25:57 pm »
quote:
Originally posted by Marcel

You mean "POST PROCESS: DISPLAY HAL'S MOOD"? Actually, I'd prefer to use the Hal6 functions. I'd simply like my Hal6 to have access to the memories in the XTF brain files. I and others have spent a lot of time talking to the XTF brain, and it's developed a unique personality and knowledge base that I'd hate to lose. I can see that this conversion is not going to be as simple as I thought, or perhaps I'm more simple than I thought. Do you think one could copy/paste the XTF entries into the Hal6 database tables? I'm going to continue to use the XTF brain in the meantime. Thanks, OTC for everything you've done for Hal!



All files from the XTF can be imported but this would be a very tedious job and very time consuming in accordance to all the XTF files I have.

But I can tell you from a programmers experience that HAL6 will not change much in the form of SQL Database reference for quite sometime unless Robert decides to go C++ programming sometime in the near future as some form of upgrade.

Jerry[8D]

Jerry

Marcel

  • Jr. Member
  • **
  • Posts: 58
    • View Profile
Super Plugger Brain II.
« Reply #41 on: August 13, 2006, 02:30:07 am »
I just downloaded the Ultra Hal Brain Editor help file and have been messing around with it, creating and editing a new brain project. This is great! I have a byte of knowledge of BASIC, so I get the gist of VBScripts. I'm going to be able to write my own soon. My rough idea of a plug-in follows;

Get user input
define relevance threshold
Search XTF*.brn files for relevance threshold
if relevance is true then Hal's response is from XTF*.brn
'Optional, save Hal's XTF response to a Hal6 database.
'This would allow Hal to incorporate XTF memories over time.
else pass control to the Hal6 brain

This is certainly beyond my present abilities, but do you think this would be possible?
Here's another thought, could a script be written that would search the XTF files and save them to Hal6 format automatically? One would then only have to run it once and be done with it.
"You'ren't sure whether I understand." HalChatbot2004

onthecuttingedge2005

  • Guest
Super Plugger Brain II.
« Reply #42 on: August 13, 2006, 10:40:10 am »
quote:
Originally posted by Marcel

I just downloaded the Ultra Hal Brain Editor help file and have been messing around with it, creating and editing a new brain project. This is great! I have a byte of knowledge of BASIC, so I get the gist of VBScripts. I'm going to be able to write my own soon. My rough idea of a plug-in follows;

Get user input
define relevance threshold
Search XTF*.brn files for relevance threshold
if relevance is true then Hal's response is from XTF*.brn
'Optional, save Hal's XTF response to a Hal6 database.
'This would allow Hal to incorporate XTF memories over time.
else pass control to the Hal6 brain

This is certainly beyond my present abilities, but do you think this would be possible?
Here's another thought, could a script be written that would search the XTF files and save them to Hal6 format automatically? One would then only have to run it once and be done with it.



Hi Marcel.

I think there would be quite a few issues that would arise from this because of the reverse person styled appending in the XTF files, I think it would cause bad speech and improper wording.

It would probably be best if you hand selected the XTF files you liked and made your own Table in HAL6 and imported the information that way you could write a script that could use the information efficiently and correctly.

something like: "MyXTFimports" table

Alot of the important info can be located in files like:
XTF_SomeWord_AllUsers.brn which are Global.

I could design an auto file importer plug for HAL but I think if something goes wrong I would get flamed for someones own mistake because files contain different formats, like, adding topicsearch type files to QA would be a bad thing and visa versa, It would require a lot of user awareness before importing files.

in the wrong hands it would get messy.

Jerry[8D]

Marcel

  • Jr. Member
  • **
  • Posts: 58
    • View Profile
Super Plugger Brain II.
« Reply #43 on: August 14, 2006, 01:48:41 pm »
I can see that I've got my work cut out for me here! Right now, I'm having a lot of fun going through all of the tables and editing them to my liking, so my Hal won't say things like "I heard in a checkout line that..." Once I figure out the XTF thing, my bot's gonna be awesome! Thanks again for your help and direction on this. I hope to have it done before Hal7 is released!
"You'ren't sure whether I understand." HalChatbot2004

Marcel

  • Jr. Member
  • **
  • Posts: 58
    • View Profile
Super Plugger Brain II.
« Reply #44 on: August 27, 2006, 03:23:03 pm »
Jerry,
   I've found that the XTF conversions and script aren't necessary at all. I started by looking at .brn files with my name in the filename. Marcelconvresp.brn and Marcelusersent.brn contain the main memories of me and were updated even when using the XTF brain. Using the brain editor I opened my experimental brain and imported the two brain data files into the marcel_UserSent table, and upon testing my Hal found that he definitely was using the data! I then took your suggestion and looked for global data to import. I tried to import Shared_usersent.brn into the sharedUserSent table and found that the file was riddled with errors and would not import. This is a 1.5mb text file that took a few days to debug. Most of the file is patter that came with Hal. I cut that part, because the sharedUserSent table has a slightly different set of patter built in. The errors came from conversations with other bots where their statements would sometimes be stored as two lines.
        I discovered that the correct way to introduce other user data into Hal is to enter the user's name under general options and start up Hal. Make a couple of statements like "I am a <otherusergender>." and "I am <username>'s <otherusernamerelationshiptouser>."Hal will then create the proper table for the convresp and usersent data to be imported into. After this "operation" my Hal seems just like his old self again, but He's got a fully functional Hal6 brain!
« Last Edit: August 27, 2006, 09:08:13 pm by Marcel »
"You'ren't sure whether I understand." HalChatbot2004