Jump to content

MS Agent Implimentation


Recommended Posts

I want to include Microsoft Agent characters (you know like the Genie and the Robot) into the tutorial of my AutoIt program.  I"m sure it can be done, but I'm at a loss as to how.  HELP!  Can someone spare the time to show me the function and syntax?!?!?  :whistle:  Thanks.

Here's a link to the MS Agent help site...

http://www.microsoft.com/msagent/default.asp

<{POST_SNAPBACK}>

Search in the forums :dance:
Link to comment
Share on other sites

Search in the forums  :whistle:

<{POST_SNAPBACK}>

Thanks Josbe!

I searched but was somehow unable to find that myself.

Now that I have played with this for a while I stand in need of some more help...

(please have patience with me I'm learning...slowly)

I want to use the popup menu available via MS Agent, but have so far failed to get my application to read the event (sorry if my terminology is bad). Here's what I have so far...

HotKeySet("{F5}","Leave")

Global $oAgent
Global $oChar
Global $oAgentPath
Global $oStatus

$oAgentPath = @WindowsDir & "\Msagent\Chars\Merlin.acs"
$oAgent = ObjCreate("Agent.Control.2")
$oAgent.Connected = "True"
$oAgent.Characters.Load("Merlin", $oAgentPath)
$oChar = $oAgent.Characters("Merlin")

;Add Commands to PopupMenu
$oChar.Commands.Add ("NumberOne", "Window 1", "Window 1", True, True)
$oChar.Commands.Add ("NumberTwo", "Window 2", "Window 2", True, True)
$oChar.Commands.Add ("NumberThree", "Window 3", "Window 3", True, True)

$oChar.Show
$oChar.Play("Wave")

While 1
    sleep(1000)
WEnd

Func Leave()
    $oStatus = $oChar.Hide
    While $oStatus.Status > 0
        Sleep(100)
    WEnd
    Exit
EndFunc

I have figured out how to add user defined options to the menu, but how to I get my application to recognize when something is selected?

Anybody...anybody...Bueller?

Oops...this is dealing more with COM and Active X controls...maybe I should have posted this in the 'v3 AutoItX' forum...sorry!

Edited by Chris2137378
Link to comment
Share on other sites

  • 1 year later...

Look this example, I believe it will help you:

;a lot of code before
...

Global $o_Char = LoadCharacter( "peedy.acs", "peedy" )
If IsObj( $o_Char ) Then
    $o_Char.Commands.Add ( "TellTime", "Tell me last time" )
    $o_Char.Commands.Add ( "GoodBye", "Good bye!" )
    
    $SinkObject=ObjEvent( $oAgent,"MsAgent_" )

        While 1
                Sleep( 100 )
        Wend

EndIf

Func MsAgent_Command( $UserInput )
    If IsObj( $UserInput ) Then
        Local $oCharacter = $o_Char
        Select
            Case $UserInput.Name = "TellTime"
                TellLastTime( $oCharacter )
            Case $UserInput.Name = "GoodBye"
                _MAShowChar( $oCharacter )
                _MAScriptPlay( $oCharacter, "play;Sad|speak;bye!" )
                $oCharacter.Commands.RemoveAll
                                _MAQuitChar( $oCharacter )
                    Exit
            Case Else
                ;;;;;
        EndSelect
    EndIf
EndFunc

...
;a lot of code after

and pls, try to use my library at MSAgent UDF Library

bye :whistle:

Só o que posso lhe dizer, bom é quando faz mal!My work:Au3Irrlicht - Irrlicht for AutoItMsAgentLib - An UDF for MSAgentAu3GlPlugin T2 - A 3D plugin for AutoIt...OpenGl Plugin - The old version of Au3GlPlugin.MAC Address Changer - Changes the MAC AddressItCopter - A dragonfly R/C helicopter simulator[center]VW Bug user[/center]Pinheiral (Pinewood) city: http://pt.wikipedia.org/wiki/Pinheiral

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...