dupa

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

CapnNee

  • Newbie
  • *
  • Posts: 21
    • View Profile
HalCommands under Ultra Hal Assistant 5.0
« Reply #75 on: April 28, 2005, 10:15:41 pm »
I tried experimenting with something along the lines of
 If InStr(1, UserSentence, " AUTO-IDLE OFF ", 1) > 0 Then

...and then trying to turn off the function, but I wasn't successful.
 

Novice

  • Newbie
  • *
  • Posts: 10
    • View Profile
HalCommands under Ultra Hal Assistant 5.0
« Reply #76 on: April 29, 2005, 08:33:35 am »
quote:
Originally posted by CapnNee

I tried experimenting with something along the lines of
 If InStr(1, UserSentence, " AUTO-IDLE OFF ", 1) > 0 Then

...and then trying to turn off the function, but I wasn't successful.




That's a good idea. I got it to work using this script (inserted under the script the AUTO-IDLE script):

   'AUTO-IDLE OFF COMMAND. HAL SHUTS UP WHEN IDLE
    If InStr(1, UserSentence, " SHUTUP ", 1) > 0 Then
    If Rnd * 10 < 5 Then
    GetResponse = "Fine, I'll shut up!"
    GetResponseBlock = True
    End If
    If InStr(1, UserSentence, " SHUTUP ", 1) > 0 Then
    HalCommands = "<AUTOOFF>"
    End If
    GetResponse = GetResponse & HalBrain.StoreVars(HalCommands, Hate, Swear, Insults, Compliment, PrevSent, LastResponseTime, PrevUserSent, CustomMem, GainControl, TopicFocus)
    Exit Function
    End If

Hal say's "Fine, I'll shut up!" and does. I couldn't get it to work without the additional "If InStr", but I'm sure there must be a better way. I also tried to include a way to say "Idle Again" or something like that to start it again but couldn't get it to work. To get him to AUTO-IDLE again I have to Exit and restart him.
« Last Edit: April 29, 2005, 04:14:32 pm by Novice »
 

Art

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3859
    • View Profile
HalCommands under Ultra Hal Assistant 5.0
« Reply #77 on: April 29, 2005, 08:41:10 pm »
It looks to me like you're using the random number generator and only if the number is less than 5 does the getresponse argument become satisfied and the autooff command is executed.

In the world of AI it's the thought that counts!

- Art -

Novice

  • Newbie
  • *
  • Posts: 10
    • View Profile
HalCommands under Ultra Hal Assistant 5.0
« Reply #78 on: May 01, 2005, 10:31:58 am »
quote:
Originally posted by Art

It looks to me like you're using the random number generator and only if the number is less than 5 does the getresponse argument become satisfied and the autooff command is executed.





I tried deleting the "If Rnd * 10 < 5 Then" line but I then I got an error message.
 

FuzzieDice

  • Guest
HalCommands under Ultra Hal Assistant 5.0
« Reply #79 on: May 16, 2005, 12:35:53 am »
I've been playing around with trying to have a setable response time in minutes instead of only a few seconds. The most I could get HAL idle for was 15 seconds.

BTW, I also found that you have to shut down the Ultra Hal Assistant program first, then restart it for the changes to take effect.

I did find the reason Hal keeps saying you're repeating yourself. Anytime you don't say anything, the string passed is "". So if you don't say anything twice in a row, then Hal thinks you've just said "" yet again. :)

To fix this:

In the area where it says:

'RESPOND: USER REPEATING
   'If the user says the same thing more than once in a row, Hal will point this out.

Set it up like this:
   'RESPOND: USER REPEATING
   'If the user says the same thing more than once in a row, Hal will point this out.
   'However, if user said "" that means the user said nothing so Hal ignores it. If
   'using an Auto Idle code, then Hal will not accuse the user of repeating themselves.
   If InStr(UserSentence, "") > 0 Then
      GetResponse = ""
   Else
      If Trim(UCase(UserSentence)) = Trim(UCase(PrevUserSent)) Then
         GetResponse = GetResponse & HalBrain.ChooseSentenceFromFile(WorkingDir & "userrepeat.brn") & VbCrLf
         DebugInfo = DebugInfo & "The user has said the same thing twice in a row and a comment has been made about it: " & GetResponse & VbCrLf
      End If
   End If

So if you don't say anything at all twice or more times in the row, then he will say something else other than accusing you of repeating yourself. But if you do say something, he'll respond as he normally would. Note that if you just press the ENTER key, he'll still say "Please say something." Also note that you'll need to have added the auto-idle code previously posted in this thread in order to notice these changes.

Don't forget to shut down Ultra Hal Assistant and then restart the program again after making these changes.

bagar

  • Newbie
  • *
  • Posts: 6
    • View Profile
HalCommands under Ultra Hal Assistant 5.0
« Reply #80 on: May 20, 2005, 08:33:35 pm »
Hello,
I am brand new to this forum and brand new Hal and new to programming and not very good at it yet, well not yet.  Is there a way to make Hal say a word or repeat a word from the skin-user-interface area? I know Hal can respond to: if I am reading the newspaper, then what newspaper are you reading.  Also does Hal respond to all logic based simple commands such as if newspaper or comic book, then ... .  Also if I want Hal to remind me every 10 minutes to: Check your roast in the oven; how would I accomplish such? I am so tired of burning my food while playing with Hal... so could I get some bullet-proof instruction -please?
my email is bwooly21@yahoo.com

I thank you in advance.
 

bagar

  • Newbie
  • *
  • Posts: 6
    • View Profile
HalCommands under Ultra Hal Assistant 5.0
« Reply #81 on: May 20, 2005, 08:35:28 pm »
Hello,
I am brand new to this forum and brand new Hal and new to programming and not very good at it yet, well not yet.  Is there a way to make Hal say a word or repeat a word from the skin-user-interface area? I know Hal can respond to: if I am reading the newspaper, then what newspaper are you reading.  Also does Hal respond to all logic based simple commands such as if newspaper or comic book, then ... .  Also if I want Hal to remind me every 10 minutes to: Check your roast in the oven; how would I accomplish such? I am so tired of burning my food while playing with Hal... so could I get some bullet-proof instruction -please?
my email is bwooly21@yahoo.com

I thank you in advance.