lcCharFile = "C:\WINNT\msagent\chars\merlin.acs" * Change path above to point to your ACS file with Thisform.oAgent .Characters.Load("MyCharacter", lcCharFile) .Characters("MyCharacter").SoundEffectsOn = .f. with .Characters("MyCharacter") .Show() nLeft = Thisform.Left+Thisform.oAgent.Left nTop = Thisform.Top+Thisform.oAgent.Top .MoveTo(nLeft,nTop) .Play("Greet") * Add commands that may be spoken or selected * from context menu with .Commands .Add("One", "&1", "1") .Add("Two", "&2", "2") .Add("Three", "&3", "3") .Add("Four", "&4", "4") .Add("Five", "&5", "5") endwith * Turn listen mode on .listen(.t.) endwith endwithIn the Agent.Command Event:
*** ActiveX Control Event *** LPARAMETERS userinput *Speak the command the user spoke/selected Thisform.oAgent.Characters("MyCharacter").Speak(userinput.name)Note that the user can invoke listening mode by pressing the hotkey. The default hot key is Scroll Lock.