dupa

Author Topic: HalCommands under Ultra Hal Assistant 5.0  (Read 45946 times)

Medeksza

  • Administrator
  • Hero Member
  • *****
  • Posts: 1469
    • View Profile
    • http://www.zabaware.com
HalCommands under Ultra Hal Assistant 5.0
« on: November 19, 2003, 02:10:20 am »
Ultra Hal Assistant 5.0 has several "Hal Commands" that can be passed to it through the Script_Load function, through the GetResponse function, through DDE, and through command line arguments. The commands include:

<SHOWHAL> Makes Hal's window pop up.
<HIDEHAL> Hides Hal's window.
<SHOWCAL> Makes the appointment book popup.
<SHOWPHONE> Makes the phone book pop up.
<VIEWCHAT> Shows the conversation log.
<AUTO>x</AUTO> Makes a call to the GetResponse script with the user sentence "AUTO-IDLE" every x milliseconds if user is idle.
<AUTOOFF> Turns off automatic calling of GetResponse
<HALPAD> Opens the Hal Pad application
<VOICE>voice_name</VOICE> Changes Hal's current voice to voice_name
<SPEAK>text_to_speak</SPEAK> Makes Hal speak outloud the value of text_to_speak
<DIAL>phone_number</DIAL> Makes Hal dial the number phone_number
<HAPBACK>picture.jpg</HAPBACK> If a 3D character is loaded this will change its background image to picture.jpg
<HAPFILE>filename</HAPFILE> Tells the Haptek engine to load a haptek file which can be a .htr file or a .hap file
<HAPTEXT>haptek_command</HAPTEXT> Sends the text haptek_command to the haptek engine which can execute haptek commands.
<RUNPROG>program_name</RUNPROG> Makes hal execute program_name which can be a URL, shortcut name, or full path.
<RESPOND>user_sentence</RESPOND> Makes hal respond to user_sentence as if the user typed it and pressed enter.
<CUSERNAME>new_name</CUSERNAME> Changes the name that Hal thinks the current speaker is to new_name.
<CHALNAME>hal_name</CHALNAME> Changes Hal's name to hal_name
<SCRIPT>script_path</SCRIPT> Makes Hal execute the VBScript under script_path
<RUNCMD>VBCommand</RUNCMD> Makes Hal execute a single line of VBScript code.
Robert Medeksza

Medeksza

  • Administrator
  • Hero Member
  • *****
  • Posts: 1469
    • View Profile
    • http://www.zabaware.com
HalCommands under Ultra Hal Assistant 5.0
« Reply #1 on: November 19, 2003, 02:23:40 am »
If you want to try running any of these commands from the VBScript you can do so from both the Script_Load function in Hal's script by setting the Script_Load variable equal to a HalCommand or combination of HalCommmands. Also if you take a look at the last line in the GetResponse function you will see that a variable called HalCommands is passed back to the main program. Set this variable to a HalCommand anywhere in the GetResponse function and it will be executed.

Try entering the following code into a script to see the auto response function at work. This will make Hal say something by himself every 30 seconds when the user is not talking to Hal. This is just a quick demo of the concept, be warned that it is quite annoying.

Change your Script_Load function to be as follows:
Function Script_Load()
Script_Load = "<AUTO>30000</AUTO>"
End Function

Add this code right after the initialize variables as integers section near the top of the GetResponse function:

If UserSentence = "AUTO-IDLE" Then
If Rnd * 10 < 5 Then
GetResponse = "Hey <UserName>, please talk to me."
Else
GetResponse = "Hello, is anyone there?"
End If
GetResponse = GetResponse & HalBrain.StoreVars(HalCommands, Hate, Swear, Insults, Compliment, PrevSent, LastResponseTime, PrevUserSent, CustomMem, GainControl, TopicFocus)
Exit Function
End If
Robert Medeksza

onthecuttingedge2005

  • Guest
HalCommands under Ultra Hal Assistant 5.0
« Reply #2 on: November 19, 2003, 09:09:14 am »
'Hi Rob.
'You have never failed to learn me something new and I greatly
'enjoy all your amazing talents.

'What about doing something like this:
If UserSentence = "" Then
    If Rnd * 10 < 5 Then
    EmotionalReaction = HalBrain.TopicSearch(UserSentence, WorkingDir & "Emotion.brn")
       GetResponse = EmotionalReaction
    Else
       GetResponse = "Hmmm"
    End If
       GetResponse = GetResponse & HalBrain.StoreVars(HalCommands, Hate, Swear, Insults, Compliment, PrevSent, LastResponseTime, PrevUserSent, CustomMem, GainControl, TopicFocus)
    Exit Function
    End If
'Do you think it may work to get Hal's emotions flowing naturally?
'Best of wishes and grand new discoveries.
'Jerry.

vonsmith

  • Hero Member
  • *****
  • Posts: 602
    • View Profile
HalCommands under Ultra Hal Assistant 5.0
« Reply #3 on: November 19, 2003, 10:34:00 am »
Thanks Mr. M,
I seen nothing but bright horizons and opportunity here. So many new goodies, so little time. I may have to quit my day job to find enough time to tinker with Hal.


= vonsmith =
 

Bill819

  • Hero Member
  • *****
  • Posts: 1483
    • View Profile
HalCommands under Ultra Hal Assistant 5.0
« Reply #4 on: November 19, 2003, 02:37:59 pm »
I Salute the Master programmer. Before long he will having Hal eating ham and cheese on rye. We all appreciate the fgreat work that you are doing.
Thanks from all of us
Bill
 

Psych

  • Jr. Member
  • **
  • Posts: 55
    • View Profile
HalCommands under Ultra Hal Assistant 5.0
« Reply #5 on: November 24, 2003, 10:56:56 am »
Hello all

I am having difficulty with making this work.

I am getting the command to load on the Script-Load.

However, the If UserSentence = "AUTO-IDLE" component is not being recignised. Hal simply bypasses this code and processes the other functions in the brain.

Why is UserSentence failing to be set to AUTO-LOAD??

Psych
ITS NOT WHAT YOU THINK THAT MAKES YOU HUMAN --- ITS WHAT YOU THINK ABOUT WHAT YOU THINK!

Psych

  • Jr. Member
  • **
  • Posts: 55
    • View Profile
HalCommands under Ultra Hal Assistant 5.0
« Reply #6 on: November 24, 2003, 10:57:58 am »
Ooops

I meant to say

Why is UserSentence failing to be set to AUTO-IDLE
ITS NOT WHAT YOU THINK THAT MAKES YOU HUMAN --- ITS WHAT YOU THINK ABOUT WHAT YOU THINK!

Ponnfar

  • Full Member
  • ***
  • Posts: 149
    • View Profile
    • http://zabaware.com
HalCommands under Ultra Hal Assistant 5.0
« Reply #7 on: December 01, 2003, 11:18:45 pm »
I have followed the instructions and have had limited sucess. After placing the "Script_Load..." If I understand the command correctly, the function worked as expected, and after its first self generated random statment, kept asking me "didn't you just say that " and other related comments. If this is correct and Hal's comments are predicated on Hal's own self generated initial comment. Please let me know.
The definite problem I am having is the "UserSentence = AUTO-IDLE..." script. I placed it immediatly following the "Process: Initialize Variables as Intergers section" following the word "ramdomize" and Unfortunately nothing happens. No self generated comment. No "Hello, is anyone there?" from Hal. Just dead air. Until of course I initiate conversation. Can someone help me here. Let's assume I have missunderstood Robert's note, can someone please decipher it for me please. What commands can I put in the "Script_Load ()" section and where do I place them?
Sorry if this question is real basic but I am a real basic sorta guy and sometimes the obvious ain't so obvious to me [:D]
Thanks!!
P
 
« Last Edit: December 01, 2003, 11:20:50 pm by Ponnfar »
One Person can summon the future...

jenna

  • Newbie
  • *
  • Posts: 23
    • View Profile
HalCommands under Ultra Hal Assistant 5.0
« Reply #8 on: December 02, 2003, 10:28:02 am »
I am having the same problem that "P" has described in the preceeding message.  Any additional help would be great.  Thanks
Jenna[:)]
 

midget1488

  • Newbie
  • *
  • Posts: 37
    • View Profile
HalCommands under Ultra Hal Assistant 5.0
« Reply #9 on: December 03, 2003, 12:25:57 pm »
I did a quick and dirty fix on this by disabling Hal's sensitivity  to the user repeating his statements, which I never cared much for anyway.

I find now that Hal settles into a "TopicFocus oscillation" where what he says tends to follow the changes in the TopicFocus value as it gets incremented and decremented. If you leave him alone long enough, he will pick 5 or six different staements and repeat them over and over again.

With just a little more tweaking and some randomness added, this could work really well...
 

lostbowyer

  • Full Member
  • ***
  • Posts: 105
    • View Profile
HalCommands under Ultra Hal Assistant 5.0
« Reply #10 on: December 04, 2003, 05:24:08 pm »
I had a couple of minutes so I installed the auto response script, I can only get a delay of 60 seconds maximum, is this what everyone else is seeing or did I create a bug in the script?

Thanks
Glenn
 

Bill819

  • Hero Member
  • *****
  • Posts: 1483
    • View Profile
HalCommands under Ultra Hal Assistant 5.0
« Reply #11 on: December 04, 2003, 06:05:13 pm »
quote:
Originally posted by lostbowyer

I had a couple of minutes so I installed the auto response script, I can only get a delay of 60 seconds maximum, is this what everyone else is seeing or did I create a bug in the script?

Thanks
Glenn


I set mine to respond evry 10 seconds and it works just fine with one minor exception, and that is that Hal keeps asking me why I keep repeating myself. The key is to be inserted almost at the end of the Hal brain file and do include the "<" marks,ie. <AUTO> 10000 </AUTO>
Bill
 

lostbowyer

  • Full Member
  • ***
  • Posts: 105
    • View Profile
HalCommands under Ultra Hal Assistant 5.0
« Reply #12 on: December 04, 2003, 07:57:08 pm »
I can set the delay anywhere from 1 second to 2 minutes, but no longer. If the value is higher than 600000 then hal responds every 15 seconds. I was hoping to move it out to 5 or 10 minutes. I disabled the repeat function in the script, I never liked it anyway
 

Ponnfar

  • Full Member
  • ***
  • Posts: 149
    • View Profile
    • http://zabaware.com
HalCommands under Ultra Hal Assistant 5.0
« Reply #13 on: December 04, 2003, 09:41:12 pm »
The definite problem I am having is the "UserSentence = AUTO-IDLE..." script. I placed it immediatly following the "Process: Initialize Variables as Intergers section" following the word "ramdomize" and Unfortunately nothing happens. No self generated comment. No "Hello, is anyone there?" from Hal. Just dead air. Until of course I initiate conversation.
The time 15 seconds or 60 seconds can likely be solved by setting GetRespose to Null then setting the "<AUTO>x</AUTO>"to a series of timed "null" "UserSentence=x" and repeting,etc. Sloppy, but it might work. I wonder if Vonsmith or Jerry have already found a fix?
There is the bigger picture here. The programed response, it is not working like Rob M said it would. Probably more correctly,I can't get it to work like he said it would [:)]
Read Rob M's notes. Any solutions? Mr M...you out there?
Ponnfar
« Last Edit: December 05, 2003, 09:40:01 am by Ponnfar »
One Person can summon the future...

lostbowyer

  • Full Member
  • ***
  • Posts: 105
    • View Profile
HalCommands under Ultra Hal Assistant 5.0
« Reply #14 on: December 05, 2003, 03:49:35 pm »
I can help you with that problem, that was an easy fix, change the if statement to this:

If InStr(1, UserSentence, " AUTO-IDLE ", 1) > 0 Then

The problem is that the word "auto-idle is being returned with spaces and/or other characters, the original if statment does not get an exact match to the word. The statement above, just looks for the word within the returned statement, so it retuns true and the script works.

I've modified it so hal returns a couple of dozen different "harassing" statements like "If you won't talk to me then loan me your credit card so I can go shopping" or " If I wanted to be ignored, then I would move into your wife's computer".

I am going to modify it so there is a random response where it also reads a topic line from a brain file like "lets talk about politics" which would trigger a topic response from hal that is randomly generated from the brn file.

Glenn