Jump to content

MS Agent Viewer


Recommended Posts

I saw this done in VBScript and just had to try to recreate it in AutoIt.

Merlin lives in a different directory than the Office helpers, but should be present on all xp computers. The office helpers are only present if you have Microsoft Office installed. I have Office 2003 so you will have to change the path to match your office installation. Let me know what you think.

Feel free to modify and change whatever you like.

GuiCreate("MSAgent Viewer", 280, 100)
GuiCtrlCreateLabel("Select Character", 15, 10, 125, 20)
GuiCtrlCreateLabel("Select Animation", 150, 10, 125, 20)
$combo_name = GuiCtrlCreateCombo("", 10, 35, 125, 20)
GuiCtrlSetData($combo_name, "Merlin|Clippit|Dot|F1|Logo|Mnature|OffCat|Rocky")
$combo_1 = GuiCtrlCreateCombo("", 145, 35, 125, 20)
$btn_submit = GuiCtrlCreateButton("Submit", 80, 65, 125, 20)
While 1
    $msg = GUIGetMsg()
    Case $msg = $combo_name
        $oAgentName = GuiCtrlRead($combo_name)
        If $oAgentName <> "Merlin" Then
            $oAgentPath = @ProgramFilesDir & "\Microsoft Office\Office11\" & _ 
            $oAgentName & ".acs"
            $oAgentPath = @WindowsDir & "\Msagent\Chars\" & $oAgentName & ".acs"
        $oAgent = ObjCreate("Agent.Control.2")
        $oAgent.Connected = "True"
        $oAgent.Characters.Load($oAgentName, $oAgentPath)
        $oChar = $oAgent.Characters($oAgentName)
        For $name in $oChar.AnimationNames
        GuiCtrlSetData($combo_1, $name & "|")
    Case $msg = $btn_submit
        $anim = GuiCtrlRead($combo_1)
        $oStatus = $oChar.Play($anim)
        While $oStatus.Status > 0
    If $msg = $GUI_EVENT_CLOSE Then ExitLoop

This works with AutoIt Beta Version

Edited by sykes

We have enough youth. How about a fountain of SMART?

Link to comment
Share on other sites

try out this line right after the $oChar.show

$oChar.speak('\Chr="Whisper"\Hello\Chr="Normal"\ \pau=2000\I am ' & $oAgentName)



Edit: or the loop after the animate

Edited by gafrost

SciTE for AutoItDirections for Submitting Standard UDFs


Don't argue with an idiot; people watching may not be able to tell the difference.


Link to comment
Share on other sites

  • 2 weeks later...
  • 2 months later...

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

  • Recently Browsing   0 members

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