Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.
Keywords: microsoft agent example.wbt
;******************************************************************************** ; Microsoft Agent Example ; ; Requires: ; Microsoft Agent ; Merlin character ; (optional) Lernout & Hauspie TruVoice TTS engine - American english ; ; Downloaded from: ; Microsoft Agent: http://activex.microsoft.com/activex/controls/agent2/msagent.exe ; Various Character files: http://www.microsoft.com/msagent/downloads/user.asp#character ; For this example download the Merlin character. ; Text To Speach engine files: http://www.microsoft.com/msagent/downloads/user.asp#tts ; ; Notes: Install the SAPI 4.0 runtime support below if you are using the Windows XP operating ; system and intend to use any of the speech components here with Microsoft Agent. ; ; Also, install this SAPI 4.0 runtime support if you intend to use the L&H TTS3000 ; engines with the Microsoft Agent Genie, Merlin, Peedy and Robby characters. These ; characters are compiled to use the L&H TruVoice engine as the default speech output engine ; and the SAPI 4.0a runtime is necessary to set these characters' TTSModeID property to use ; the TTS3000 engines. Other Microsoft Agent characters may also require this SAPI 4.0 runtime ; support to set their TTSModeID property. ; http://www.microsoft.com/msagent/downloads/user.asp#sapi ; ; ; ; ;******************************************************************************** ; Create an instance of the control MyAgent = ObjectOpen("Agent.Control.2") MyAgent.Connected = @TRUE Characters = MyAgent.Characters ; Load the character Characters.Load("Merlin", "Merlin.acs") ;Characters.Load("Genie", "Genie.acs") ;Characters.Load("Peedy", "peedy.acs") ;Characters.Load("Goober", "Robby.acs") Merlin = Characters.Character("Merlin") ;Genie = Characters.Character("Genie") ;Peedy = Characters.Character("Peedy") ;Robby = Characters.Character("Goober") ; Display the character Merlin.Show Merlin.MoveTo(900,620,10000) Merlin.Play('Confused') Merlin.Speak("Hello all.") Merlin.MoveTo(340,240) ;Note the use of single quotes so you can use double quotes in the map command ;The map command has 2 parameters. The first is how you want the text pronounced. ;The second is how you want it shown in the balloon Merlin.Speak('Using agent within \Map="Win Batch"="WinBatch"\ is not that difficult.') Merlin.Speak('Since you are running an \Map="Oh Lay"="OLE"\ object,') Merlin.Speak('In order to sync \Map="Win Batch"="WinBatch"\ commands with things happening in agent,') Merlin.Speak("You loop until the 'status' of a command is complete.") Merlin.think('Any idiot ought to know that!') Merlin.MoveTo(620,460) GestureRight = Merlin.Play("GestureRight") While @TRUE If GestureRight.Status == 0 then break ;if gesture command has succesfully completed EndWhile Merlin.Think('Man, this machine is slooooow...') Run("notepad","") TimeDelay(3) SendKey("This is a notepad example.{ENTER}") Merlin.Play("RestPose") Merlin.Speak("Now I'll close notepad, choosing not to save the file") TimeDelay(5) SendKey("!fx") TimeDelay(1) SendKey("n") AgentDone = Merlin.Speak("Thus ends this agent example.") While @true If AgentDone.Status == 0 Merlin.Hide Exit EndIf TimeDelay(0.5) EndWhile
Article ID: W14955
File Created: 2003:09:04:15:22:00
Last Updated: 2003:09:04:15:22:00