dupa

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Judge

Pages: [1]
1
Ultra Hal 7.0 / Run Program Response
« on: August 08, 2008, 07:28:33 pm »
Thank you for the reply.

Is there any way to have HAL open a program without having him know that he is opening it?

2
Ultra Hal 7.0 / Run Program Response
« on: August 08, 2008, 12:46:02 pm »
Everytime I ask Hal to run a program, he says, "I will open this program for you." Where is this reply located, and how can I change it?

3
General Discussion / Run Program Response
« on: August 07, 2008, 12:42:26 pm »
Everytime I ask Hal to run a program, he says, "I will open this program for you."  Where is this reply located, and how can I change it?

4
Ultra Hal 7.0 / Error need HELP
« on: August 03, 2008, 01:02:01 pm »
I tried reinstalling again and the error message has changed to "UNKNOWN RETURN CODE: 0"  I still don't know what to do.

5
Ultra Hal 7.0 / Error need HELP
« on: August 03, 2008, 12:40:20 pm »
Hello,

   I purchased HAL6 and everything worked fine for over a month.  I now receive an error message about FALSE_MAIN_LF_CORRUPT.  The authorization request code is blank.  I tried reinstalling HAL but the same problem occured.  What do I do?

Thank you

6
Ultra Hal 7.0 / Scripting Help Needed
« on: June 06, 2008, 01:06:33 pm »
I've discovered that putting the subroutine in the Functions section allows it to run without error.  But now it won't allow the GetResponse to work. I've also found that:

'RESPOND: JOKES
'If the user wants Hal to tell a joke, then Hal will tell one

If HalBrain.TopicSearch(UserSentence, "jokeDetect") = "True" Then GetResponse = GetResponse & HalBrain.ChooseSentenceFromFile("jokes")
HalBrain.DebugWatch GetResponse, "Jokes"


Works the same as:

'RESPOND: JOKES
'If the user wants Hal to tell a joke, then Hal will tell one

If HalBrain.TopicSearch(UserSentence, "jokeDetect") = "True" Then GetResponse = GetResponse & HalBrain.ChooseSentenceFromFile("jokes")

What does HalBrain.DebugWatch GetResponse, "Jokes" do?
How can I modify the subroutine to work as I desire?

Thank you

7
Ultra Hal 7.0 / Scripting Help Needed
« on: June 06, 2008, 12:11:11 pm »
I'm trying to make a plugin work similar to how HAL's joke script works.  My plugin works exactly as the joke script does, but I want to make it better.  I want HAL to ask the joke question, and if the user replies correctly, HAL will congratulate the user.  The opposite will also be true: if the user replies incorrectly, HAL will correct the user.  The basic joke script in the HAL brain is:

'RESPOND: JOKES
'If the user wants Hal to tell a joke, then Hal will tell one

If HalBrain.TopicSearch(UserSentence, "jokeDetect") = "True" Then GetResponse = GetResponse & HalBrain.ChooseSentenceFromFile("jokes")
HalBrain.DebugWatch GetResponse, "Jokes"


Essentially, the user can type anything after HAL asks the joke -- during the DebugWatch time -- and HAL will respond with the answer.

I think my goal should be accomplished by a simple subroutine.  But, whenever I put a subroutine or function into a plugin or even directly into the brain, it comes up with error 1002 "Syntax Error".  I'm using "VBScript in a Nutshell" as a reference and I see no problem with my subroutine syntax.  I'm thinking it's a HAL-specific issue.  This is my basic script:

'RESPOND: JOKES
'If the user wants Hal to tell a joke, then Hal will tell one

If HalBrain.TopicSearch(UserSentence, "jokeDetect") = "True" Then TellJoke

Sub TellJoke
GetResponse = HalBrain.ChooseSentenceFromFile("Jokes")
If InStr(UserSentence, "ROAMING CATHOLIC") > 0 Then GetResponse = "Correct! Well Done!"
If InStr(UserSentence, "ROAMING CATHOLIC") = 0 Then GetResponse = "A roaming Catholic"
End Sub


To simplify the matter, I'm using just 1 joke and the answer is "A roaming Catholic".  The joke is typed in the Hal Brain Editor file Jokes including the <topic> </topic> dividers, so there should be an easy way to access the answer by using a function of HAL without saying the answer in the script.

To summarize: Why do I get a syntax error when I use a subroutine?  How can I access the answer to the joke without stating the answer in my script?  I want the scipt to work for all jokes, I'm trying to simplify it by getting it to work for one joke first.

I'm new to HAL and I've only started trying to program two days ago, so any assistance will be greatly appreciated.

Thanks!

Pages: [1]