Results 1 to 7 of 7

Thread: MsAgent

  1. #1

    Thread Starter
    Hyperactive Member Zaphod64831's Avatar
    Join Date
    Mar 2000
    Posts
    268

    Question

    I have a few questions regarding the MsAgent control.

    Is there any way to make the character pop up at a certain point, instead of in the upper-left corner of the screen?

    How do I make him listen and react to the words spoken by the user? I.e.

    Code:
    If UserSpeech = "This" Then
        'Do this
    Else
        'Do this
    End If
    Can anyone help? I've looked everywhere!
    Email: [email protected]

    Home Page: www.olemac.net/~hutch

    I'm bored, VERY bored, and I got bored with my sig. So I changed it to this.

  2. #2
    I have mailed you some sample projects. check it out

  3. #3
    Conquistador
    Join Date
    Dec 1999
    Location
    Australia
    Posts
    4,527
    the agent has to be loaded before he accepts voice commands, then you can add a voice command to his menu

    also, you can move him around, why don't you just download the cap project from msdn???

    this has most of this informatiopn enclosed

  4. #4
    Hyperactive Member
    Join Date
    Mar 2000
    Location
    Canada
    Posts
    264
    Please help, I am tryin to get more information about using the MSagent with voice commands.

    Couldn't find any information that shows how to do it.

    In the beginning the universe was created. This has made a lot of people very angry and is generally regarded as a bad idea.

    - Douglas Adams
    The Hitchhiker's Guide to the Galaxy

  5. #5
    Guest
    Code:
    If Text1.text = "Can't we all just go to Vb-World?" Then
    Speaker1.Speak "Sure we can."
    Else
    Speaker1.Speak "Don't forget to visit the Forums today."
    End If

  6. #6
    Hyperactive Member
    Join Date
    Mar 2000
    Location
    Canada
    Posts
    264
    that's very nice :-) but it doesn't help me with voice commands (me speaking to a microphone, agent -> do stuff) ..

    In the beginning the universe was created. This has made a lot of people very angry and is generally regarded as a bad idea.

    - Douglas Adams
    The Hitchhiker's Guide to the Galaxy

  7. #7
    Lively Member eric445's Avatar
    Join Date
    Aug 2000
    Location
    Seattle, WA (USA)
    Posts
    70

    Smile

    To add commands to an agent do this:

    First, If you have Microsoft Command and Control installed and a microphone then you should be able to say "Open Voice Commands Window" anytime to the agent. Make sure that works before trying to program your own commands. The voice commands windows is the list of all the things you can say to your agent. Now, to add commands to the window type this.

    Lets assume that the agent control is on form1, its called agent1 and the agent ID is merlin. Lets also assume that the agent works (you can see it on the screen when you run the program).

    Code:
    Private Sub Form_Load()
    Form1.Agent1.Characters("Merlin").Commands.add "Exit","Quit","(Quit|Exit|End)",True,True
    
    End Sub
    
    ' What That Does is add a command named "Exit" with the caption as quit, lets you say either Quit Exit or End, sets enabled to true and visible to true. Visible means if you can see it when you right-click on the agent.
    
    ' Now, to make the command so it does something, do this:
    ' This should me put in the command sub in the agent control
    
    Private Sub Agent1_Command(ByVal UserInput As Object)
    
    Select Case UserInput.name
    
    Case "Exit" ' Remember that we named the command "Exit" above
    
    End ' End the Program
    
    End Select
    
    End Sub
    
    ' This makes it so when the user activates the command named Exit (by saying Quit, Exit, or End) it Ends the program. Not to hard huh?
    If you have any other problems or questions, feel free to e-mail me. Also, beleve it or not, Microsoft has a really good section on MS Agnet programming. Just visit http://www.microsoft.com/msagent

    Regards,

    Eric Butler

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width