[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 639
  • Last Modified:

VBscript error with MS Agent Control

Getting an error on line 11 of this program.  I have loaded the Agent software properly.  Thanks for any ideas.
'
' Popup message using Microsoft Agent
'
Set MSAgent = CreateObject("Agent.Control.2")
'
If IsObject(MSAgent) = False Then
   MsgBox "Microsoft Agent is not installed."
   Quit
End If
'
MSAgent.Characters.Load "merlin", "merlin.acs"   ' <--- getting error on this line
Set Merlin = MSAgent.Characters("merlin")
'
With Merlin
    .MoveTo 600,100
    .Show
    .Play("Read")
    .Speak("Your message is ready for you to read.")
End With
'
For z = 1 To 9
    While DateDiff("s", dl, Now) < 1
    Wend
Next
'
Merlin.Hide
'
Set MSAgent = Nothing
Set Merlin = Nothing
'
0
mistert006
Asked:
mistert006
1 Solution
 
crazymanCommented:
What is the error ?
0
 
sokolovskyCommented:
Try this:
<OBJECT ID="AgentControl" width=0 height=0
 CLASSID="CLSID:D45FD31B-5C6E-11D1-9EC1-00C04FD7081F"
 CODEBASE="#VERSION=2,0,0,0">
</OBJECT>

<OBJECT ID="TruVoice" width=0 height=0
 CLASSID="CLSID:B8F2846E-CE36-11D0-AC83-00C04FD97575"
 CODEBASE="#VERSION=6,0,0,0">
</OBJECT>

<SCRIPT language=VBScript>
' In this example the Microsoft Agent control is managed using VBScript.
' Alternatively, JScript could be used.

Dim Robby      ' a global variable to hold the character object
Sub window_OnLoad
      AgentControl.Connected = True      ' necessary for IE3
      AgentControl.Characters.Load "Robby", "http://agent.microsoft.com/agent2/chars/robby/robby.acf"
      Set Robby = AgentControl.Characters("Robby")
      Robby.LanguageID = &H0409            ' needed under some conditions (English)
      Robby.Get "State", "Showing, Speaking"
      Robby.Get "Animation", "Greet, GreetReturn"
      Robby.Show
      Robby.Get "State", "Hiding"
      Robby.Play "Greet"
      Robby.Speak "Hello, World!"
      Robby.Hide
End Sub
</SCRIPT>

Change Robby to Merlin. Works FINE!
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now