The Agent--Part 1


Click here for Microsoft's Agent Homepage.  You can download the Agent program, Speech Engines and different characters.  You can also get info about all of the different options available to each character.

Documentation:

To see what the agents can do, see the animation lists: Genie     Robby    Peedy     Merlin

Speech Output Tags

Agent Programming guide

Free software 

One of the best things about the Agent is that it's all free. Here's some useful links on the Microsoft website:

Agent main page
Download Agent components


 

From Visual Basic's Menu bar, choose Project> Components

Check Microsoft Agent Control 2.0, OK

You should have the agent in your toolbox.  Add an agent control to your form.

Important note:  Since we have added a component to our project, we will need to finally save the project file.  Later on, when you want to look at this project again, you'll double-click on the project file, not just the form.

This is the basic code to get the Genie setup, appear on the screen, say Hello and read.
  Here's the list of all of the different animations that the Genie can do.
   
Here's a simple example of using the agent, a textbox and a button to make the Genie speak what you type.
To see what the agents can do, see the animation lists:

 Genie     Robby    Peedy     Merlin

Option Explicit
Dim Genie

Private Sub Command1_Click()
   Genie.Speak Text1.Text
End Sub


Private Sub Form_Load()
   Agent1.Characters.Load "genie", "genie.acs"
   Set Genie = Agent1.Characters("genie")
   Genie.Show
End Sub

The Agent--Part 2

Specifications:  

  • Make make a double-click procedure for the the agent
  • Make a dragcomplete procedure that will move the agent back to a set location
  • Add a show procedure that will make the agent say random things .  You can make the agent say random things by using the | character.  Like this:
    •   genie.speak "I'm back | Thanks for getting me out of that bottle | Why did you leave me so long?"
  • Add a button that will make the agent tell a joke
  • Add a button that will make the agent hide, and one that will make him show.
  • Add a button that will make the agent fly to all four corners of the screen.
  • Use some of the different character animations.
  • agent.think
  • Make the agent tell time.
    • Add a timer, 2 option buttons (optOn, optOff)
    • In the form_load:  optOff=true, timer1.enabled=false
    • Timer interval:  10000 (10 seconds)
    • Timer code:  genie.speak "At the tone, the time will be " & time
    • If you want the agent to speak the time more clearly use this:
    • Genie.Speak "At the tone, the time will be " & Format(Time, "h") & Format(Time, "mm") & "and " & Format(Time, "s") & "seconds"
    • optOff code:   timer1.enabled=false
    • optOn code:  timer1.enabled=true