Author Topic: Small plugin?  (Read 5094 times)

Bill DeWitt

  • Hero Member
  • *****
  • Posts: 650
    • View Profile
Small plugin?
« on: October 18, 2006, 04:46:11 pm »
Maybe it's already been made, I just want Hal to listen for one word, and not listen to anything else until that word is said.

I remember a speech control program that you had to say "computer" before every command. I want to make Hal do something like that.

I suspect it might be easier to edit the brain directly, but thought I would ask first.

Something like (if getAttention != "Computer" then processCommands = "false")

Anybody make that yet? If not, how should I start?

Thanks in advance.
Bill


Bill819

  • Hero Member
  • *****
  • Posts: 1483
    • View Profile
Small plugin?
« Reply #1 on: October 18, 2006, 07:35:14 pm »
quote:
Originally posted by Bill DeWitt

Maybe it's already been made, I just want Hal to listen for one word, and not listen to anything else until that word is said.

I remember a speech control program that you had to say "computer" before every command. I want to make Hal do something like that.

I suspect it might be easier to edit the brain directly, but thought I would ask first.

Something like (if getAttention != "Computer" then processCommands = "false")

Anybody make that yet? If not, how should I start?

Thanks in advance.
Bill


Hello Bill
Do a search of this site. One time someone made a script that would only make Hal respond if his name was mentioned first.  This is useful for those of us who are also working on robotic programs. The information that you want is in here somewhere.
Bill819
 

Bill DeWitt

  • Hero Member
  • *****
  • Posts: 650
    • View Profile
Small plugin?
« Reply #2 on: October 18, 2006, 08:00:34 pm »
quote:
Originally posted by Bill819
Do a search of this site. One time someone made a script that would only make Hal respond if his name was mentioned first.


That's what I want, and I did a search first, but either it's well disguised or I need help with keywords. I'll keep searching, but if you happen to recall any phrases in the discussion....


onthecuttingedge2005

  • Guest
Small plugin?
« Reply #3 on: October 18, 2006, 09:14:42 pm »
quote:
Originally posted by Bill DeWitt

Maybe it's already been made, I just want Hal to listen for one word, and not listen to anything else until that word is said.

I remember a speech control program that you had to say "computer" before every command. I want to make Hal do something like that.

I suspect it might be easier to edit the brain directly, but thought I would ask first.

Something like (if getAttention != "Computer" then processCommands = "false")

Anybody make that yet? If not, how should I start?

Thanks in advance.
Bill



Hi Bill.

You can download this Plug-in to the Ultra Hal Assistant Folder.
Open the RespondByName.uhp and edit the computername inside to your Bot's name exactly to name it should be, Spaces are accountable.

This Plug-in will only let your bot respond only if the name of the bot is present within the user sentence else no response will be given and a blank response will be given if no computer name is given with a User Response.

in the Plug you should see:
'Permanent Computer name
ComputerName = "Your Computer Name Goes Here"

Put your bots name in the area:
'Your Computer Name Goes Here'

Choose the plug-in from the Brain Options 'Respond Only By Name'

Jerry

Download Attachment: RespondToCompName.zip
1.2 KB
« Last Edit: October 19, 2006, 12:29:04 am by onthecuttingedge2005 »

Bill DeWitt

  • Hero Member
  • *****
  • Posts: 650
    • View Profile
Small plugin?
« Reply #4 on: October 18, 2006, 11:12:54 pm »
That's beautiful, thanks. Of course, now I will be up way too late playing with it.

Oh WOW! That works great! I didn't expect it to work for typing, nor did I expect it to work for the name anywhere in the string.

Now I need a better microphone. I want the Motorola H5 miniblue. I will have to settle for a USB headset until it comes out.

Thanks so much for the plugin!

Bill
« Last Edit: October 18, 2006, 11:27:35 pm by Bill DeWitt »


Duskrider

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3316
  • Graphic King
    • View Profile
Small plugin?
« Reply #5 on: October 19, 2006, 09:49:42 am »

Reminds me of Star Trek where "Computer" never acknowledges or speaks unless addressed as "Computer"

I'm surprised why Captain not always talking to "Computer"
Definitely the sweetest voice on the Enterprise.


Insert Image:
 


Bill DeWitt

  • Hero Member
  • *****
  • Posts: 650
    • View Profile
Small plugin?
« Reply #6 on: October 19, 2006, 12:22:45 pm »
quote:
Originally posted by Duskrider
Reminds me of Star Trek where "Computer" never acknowledges or speaks unless addressed as "Computer"


Right, that's the idea. "Computer", <tweedle>, "Begin self-destruct"...

I like the plugin provided by Jerry, but I was not able to understand how it worked. I see that it listens for the computer's name, but it seems to ask "if" and responds with "then" but then not take an action.

Unless "Rem PLUGIN: CUSTOMMEM2" means something... I don't find a CustomMem or Custommem2 plugin in my Ultra Hal directory. I do see that certain REM statements seem to be read as tags for plugins.

I would love a brief explanation if possible.


onthecuttingedge2005

  • Guest
Small plugin?
« Reply #7 on: October 19, 2006, 07:32:25 pm »
quote:
Originally posted by Bill DeWitt

quote:
Originally posted by Duskrider
Reminds me of Star Trek where "Computer" never acknowledges or speaks unless addressed as "Computer"


Right, that's the idea. "Computer", <tweedle>, "Begin self-destruct"...

I like the plugin provided by Jerry, but I was not able to understand how it worked. I see that it listens for the computer's name, but it seems to ask "if" and responds with "then" but then not take an action.

Unless "Rem PLUGIN: CUSTOMMEM2" means something... I don't find a CustomMem or Custommem2 plugin in my Ultra Hal directory. I do see that certain REM statements seem to be read as tags for plugins.

I would love a brief explanation if possible.




The whole code is pretty simple.

Code: [Select]

Rem PLUGIN: CUSTOMMEM <---- This Plug-in position is in the upper GetResponse Function area within a brain that is cached to HalScript.dbg where the below Search will be placed, It is ment to intercept any portion of the brain before a response is given and will not function unless the computer name is present within the search.

'Permanent Computer name
     
ComputerName = "Computer" <--- easy one to figure out here.

If InStr(1, UserSentence, ComputerName, vbTextCompare) > 0 Then <---- Search for the computers name before any script has a chance to run.

Rem PLUGIN: CUSTOMMEM2 <--- is at the bottom of the GetResponse Function after all GetResponses and the End If statement closes the above function by wrapping all other variables in-between the two lines of code.

End If <--- Ends the upper search Script at CUSTOMMEM so that all response possibilities are wrapped within the specific request 'Computer'


See, Anytime a code begins with 'If & Then' then it must have an equal amount of End If or an error will occure, This is not the exception with ElseIf & Then statements that is wrapped inbetween If & Then Statements.

Like:
 
If Bill = "Hello" Then
GetResponse = " Howdy! "
ElseIf Bill = "Bye" Then
GetResponse = " See Yah! "
End If <-----------------------Only one End If required.

Jerry[8D]
« Last Edit: October 19, 2006, 07:38:21 pm by onthecuttingedge2005 »

Bill DeWitt

  • Hero Member
  • *****
  • Posts: 650
    • View Profile
Small plugin?
« Reply #8 on: October 19, 2006, 07:47:11 pm »
quote:
Originally posted by onthecuttingedge2005
Rem PLUGIN: CUSTOMMEM2 <--- is at the bottom of the GetResponse Function

I get the idea now, CUSTOMMEM2 is like a goto in the main brain so this script bypasses the GetResponse. Yep, now that I know to look, I see it in the hal6.uhp

Thanks, that makes more sense now. I was looking for a separate custommem include file or something...
Bill


Art

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3859
    • View Profile
Small plugin?
« Reply #9 on: October 19, 2006, 08:46:51 pm »
A REM in front of a statement will be bypassed or ignored.

Back in the early days of the BASIC computer language the word
was an acronym for REMark, and was not processed, thus everything to
the right of a REM or ' was and is ignored.

Most programmers will often document their code by using a REM
statement to describe what's happening in the program for that
particular area.
In the world of AI it's the thought that counts!

- Art -

Bill DeWitt

  • Hero Member
  • *****
  • Posts: 650
    • View Profile
Small plugin?
« Reply #10 on: October 19, 2006, 08:58:07 pm »
quote:
Originally posted by Art
Back in the early days of the BASIC computer language


Heh...

I am so old, TRS-DOS and "Extended Color Basic" was my first programming experience - in college! Before floppy disks.

I remember being excited to finally get a computer that would use MSDos. With a real hard drive, a virtually unfillable 20mb of space!

If only I knew then what I can't remember now...
Bill