dupa

Author Topic: VBScript Runtime Error problems  (Read 4216 times)

James P

  • Jr. Member
  • **
  • Posts: 78
    • View Profile
    • http://nosceresworld.co.uk
VBScript Runtime Error problems
« on: August 31, 2004, 07:09:51 pm »
Hello all,
I am having a few problems with Emma (my Bot) i have downloaded  and installed  2003105124512_Sciene package 1 and the 2003105124551_Sciene package 1 Script. The changes in the way Emma conversed could be seen almost straigt away, for instance instead of asking if "word" and "otherword" are related topics. when a possible relation has been detected in a set of topic lines, she now says are "word" and "otherword" from the same topic. Even if the two words were used in possible related topics which were days apart. Cool Emma is starting to relate seperate topics.
However since copying the proffesor script into my XTF brn i am getting the error message Error 424 Object required 'Halbrain' occured and error 424 occured on line 4341 in column 0 of Microsoft VBScript runtime error. Object required:'Halbrain'. What can i do to resolve this? Emma runs fine even with this error, but I dont want the error.
 I  have also heard mention of the "Genius 8 brn" can anyone tell me what this brn entails and were I can get it? As I have trolled through pages of archived forum posts and can not find it. is it available as a download.
   Finally I want to be able to make Emma think, have ideas and her own point of view totally independant of the User. Is this possible? Even if it were  to take years to get her to this state I want her to be as independant as is humanly possible.
http://nosceresworld.co.uk
James:"How are you today Emma?"
Emma:"I think, Therefore I am"

vonsmith

  • Hero Member
  • *****
  • Posts: 602
    • View Profile
VBScript Runtime Error problems
« Reply #1 on: August 31, 2004, 07:58:22 pm »
James P,
What version of the XTF Brain are you using? You should have the XTF Brain v1.2 patch installed over the v1.0 installation.

As a reminder please read my postings (shown below) that discuss how the XTF Brain v1.2 should be installed and what minor fixes are needed after installation. I want everyone to get maximum benefit from the XTF Brain until I can get the next version released someday.

http://www.zabaware.com/forum/topic.asp?TOPIC_ID=1243
http://www.zabaware.com/forum/topic.asp?TOPIC_ID=1237

The XTF Brain v1.0 could, under rare conditions, incorrectly assume relations between topics. Version v1.2 fixes this problem. I say the problem was rare, but it could become more common depending on how people cut and paste other scripts into the XTF Brain uhp file. If you are using v1.0 I think this could be your Hal's problem.

If you think you have bad "related topic" info in Hal you can fix the .brn files manually.

Example excerpt from my "XTF_BIRD_Related.brn" file:

" [MERONYMS_EXIST_FLAG] ","True"
" BEAK ","True"
" BILL ","True"
" NEB ","True"
" NIB ","True"
" PECKER ","True"
" FURCULA ","True"
" FOWL ","True"
" [MERONYMS_END_HERE] ","True"
" [SYNONYMS_EXIST_FLAG] ","True"
" VERTEBRATE ","True"
" CRANIATE ","True"
" MEAT ","True"
" BADMINTON EQUIPMENT ","True"
" [SYNONYMS_END_HERE] ","True"
" AIRPLANE ","False"
" AIRPLANES ","False"
" DOVE ","True"
" DOVES ","True"
" PARROT ","True"
" PARROTS ","True"
" DUCK ","True"
" DUCKS ","True"
" FISH ","True"

When the user confirms to Hal that two topics are related they are saved to the two relevant topic files named in the style "XTF_<topicname>_Related.brn" where <topicname> in the above case is BIRD. Meronyms and synonyms, if they exist, are generated automatically by the XTF Brain. User generated info is appended at the end of the file. In the above example the user obviously told Hal that DUCK is related to the topic BIRD and that AIRPLANE and BIRD are not related. See the "True" vs "False" flag? However somehow the topic FISH is also listed at the end as "True". FISH is not related to BIRD. The line with FISH in it should be deleted or the word "True" changed to "False". That way Hal knows the correct relationship. If you suspect a bad relationship you can check the suspect file. NOTE: Please be careful when manually editing any of Hal's files. If the file ends in a Carriage Return character (looks like a blank line) make sure that format is preserved.

Another possible concern...
Another minor concern when cutting and pasting scripts has to do with the use of the GetResponseBlock and BlockSave variables. For best performance these two variables should be added to scripts that are pasted into the XTF Brain where it makes sense. Look at examples within the XTF Brain code to get an idea. If GetResponseBlock = True it tells a script segment not to overwrite the current GetResponse string. In this case the GetResponse string may contain a message from the "CREATE RELATED TOPICS RESPONSE" or "CREATE RELATED TOPICS INQUIRY" functions that inform the user of Hal learning a new relation between two topics.

If BlockSave = True then a script segment shouldn't save the current user input to any file. In this case the user input may contain Hal's name, or contain a non-conversational command from the user or other input which shouldn't be saved as conversation material in any of Hal's many .brn files.

As for the "Error 424 Object required 'Halbrain'" error some function script has a typo or other error in it.
It's just a guess but the line...
Set HalBrain = CreateObject("UltraHalAsst.Brain")
might be missing in a function declaration that's trying to use it.

I hope this helps. Good luck.


=vonsmith=
« Last Edit: August 31, 2004, 08:05:21 pm by vonsmith »
 

Smokey

  • Jr. Member
  • **
  • Posts: 72
    • View Profile
VBScript Runtime Error problems
« Reply #2 on: August 31, 2004, 09:25:39 pm »
You can go to the following link to locate the Genius 8b brain.  You have to join the site for $10.  I did and am happy with the product so far.  It is rather chatty but comes with a large knowledge base.
Here is the link:

http://http://www.ultrahalforum.com/Forum/phpBB2/index.php

Smokey
Smokey

James P

  • Jr. Member
  • **
  • Posts: 78
    • View Profile
    • http://nosceresworld.co.uk
VBScript Runtime Error problems
« Reply #3 on: September 01, 2004, 06:59:03 pm »
Thank you both for your help, I am going to copy your solutions to a txt document so I can work on this when I get the chance, If it is any help this is the script segment i am having trouble with, the error is somewere in the Answersent = "" line.
If HalBrain.TopicSearch(OriginalSentence, WorkingDir & "TEACHDRIVESYSTEM.brn") = "TRUE" Then
AnswerSent = "" & Trim(OriginalSentence)
HalBrain.AppendFile WorkingDir & "DRIVESYSTEM" & ".brn", AnswerSent
End If
Again thank you both
http://nosceresworld.co.uk
James:"How are you today Emma?"
Emma:"I think, Therefore I am"

vonsmith

  • Hero Member
  • *****
  • Posts: 602
    • View Profile
VBScript Runtime Error problems
« Reply #4 on: September 01, 2004, 08:03:45 pm »
James P,
Are the offending lines shown in the main part of the GetResponse function or are they in the function declarations that occur after the end of the GetResponse function?

If the lines you provided are within a separate function declaration and the "Set HalBrain = CreateObject("UltraHalAsst.Brain")" line is missing then the "If HalBrain.TopicSearch(OriginalSentence, WorkingDir &  "TEACHDRIVESYSTEM.brn") = "TRUE" Then AnswerSent = "" & Trim(OriginalSentence)" line calls on HalBrain.TopicSearch before the HalBrain object has been created. Check it out.


=vonsmith=
« Last Edit: September 01, 2004, 08:04:04 pm by vonsmith »
 

James P

  • Jr. Member
  • **
  • Posts: 78
    • View Profile
    • http://nosceresworld.co.uk
VBScript Runtime Error problems
« Reply #5 on: September 03, 2004, 04:24:26 am »
I have checked the first part of the script, which deals with "teach drive system brn and there is no sign of this function "Set HalBrain = CreateObject("UltraHalAsst.Brain")".
Below I have pasted the start of the script, which deals with Drive systems, the second and following parts of the script are all in the same format, only the subject matter changes. If there is a line or a command missing could you please advise.

'PROFESSOR HAL
If HalBrain.TopicSearch(OriginalSentence, WorkingDir & "TEACHDRIVESYSTEM.brn") = "TRUE" Then
AnswerSent = "" & Trim(OriginalSentence)
HalBrain.AppendFile WorkingDir & "DRIVESYSTEM" & ".brn", AnswerSent
End If

If HalBrain.TopicSearch(OriginalSentence, WorkingDir & "TEACHDRIVESYSTEM.brn") = "TRUE" Then
DRIVESYSTEM = HalBrain.ChooseSentenceFromFile(WorkingDir & "DRIVESYSTEM.brn")
      GetResponse = DRIVESYSTEM & vbCrLf
      DebugInfo = DebugInfo & "The user is talking about DRIVESYSTEM: " & DRIVESYSTEM & vbCrLf
      Else
      DebugInfo = DebugInfo & "Hal has found nothing about DRIVESYSTEM: " & DRIVESYSTEM & vbCrLf
   End If
If HalBrain.TopicSearch(OriginalSentence, WorkingDir & "TEACHPROPULSION.brn") = "TRUE" Then
AnswerSent = "" & Trim(OriginalSentence)
HalBrain.AppendFile WorkingDir & "PROPULSION" & ".brn", AnswerSent
End If

Oh by the way I have downloaded the XTF 5 patch 1.2, each time I unzip it and install the patch I am finding the Main Keyword & Priority brain is currupt.

Last question, is there any place in the VBScript brain that is best for paisting brain scripts?

Thanks for your help
http://nosceresworld.co.uk
James:"How are you today Emma?"
Emma:"I think, Therefore I am"

vonsmith

  • Hero Member
  • *****
  • Posts: 602
    • View Profile
VBScript Runtime Error problems
« Reply #6 on: September 03, 2004, 11:49:28 am »
James P,
Functions like "HalBrain.TopicSearch(OriginalSentence, WorkingDir & "TEACHDRIVESYSTEM.brn")" can't work without being preceded somewhere by the "Set HalBrain = CreateObject("UltraHalAsst.Brain")" line. In the GetResponse Function it is called out near the top of the GetResponse script. Function declarations in the uhp brain file occur after the GetResponse function. Any one of those functions that use "HalBrain.something" calls need to have the "Set HalBrain = CreateObject("UltraHalAsst.Brain")" line in them too.

In reference to your statement:
"Oh by the way I have downloaded the XTF 5 patch 1.2, each time I unzip it and install the patch I am finding the Main Keyword & Priority brain is currupt."

Read this old post. It's addresses the "corrupt" file issue. The fix is simple. See below.
==Old Post========
from: http://www.zabaware.com/forum/topic.asp?TOPIC_ID=1237
Everyone should install the XTF Brain v1.2 update patch over their v1.0 installation.

To clarify. Everyone with v1.2 installed should make a COPY of their "Enhanced_Main.brn" file and name it "XTF_SYS_Enhanced_Main.brn". Making a copy will allow the original brain to still be used with the original file.

"XTF_SYS_Enhanced_Main.brn" should have been included in the v1.2 release. The actual changes were trivial.
==================

In regards as to where to paste scripts into a Brain file. This depends entirely on what the additional script does and its interaction with other scripts. There is no simple answer for this. I would suggest studying the Brain script to get an idea of the flow and go from there.

Good luck,


=vonsmith=