Sign in to follow this  
Followers 0
sykes

MS Agent Viewer

7 posts in this topic

#1 ·  Posted (edited)

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.

#include<guiconstants.au3>
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)
GuiSetState()
While 1
    $msg = GUIGetMsg()
    Select
    Case $msg = $combo_name
        $oAgentName = GuiCtrlRead($combo_name)
        If $oAgentName <> "Merlin" Then
            $oAgentPath = @ProgramFilesDir & "\Microsoft Office\Office11\" & _ 
            $oAgentName & ".acs"
        Else
            $oAgentPath = @WindowsDir & "\Msagent\Chars\" & $oAgentName & ".acs"
        EndIf
        $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 & "|")
        Next
    Case $msg = $btn_submit
        $anim = GuiCtrlRead($combo_1)
        $oChar.Show
        $oStatus = $oChar.Play($anim)
        While $oStatus.Status > 0
            Sleep(100)
        WEnd
        $oChar.Hide
    EndSelect
    If $msg = $GUI_EVENT_CLOSE Then ExitLoop
Wend

This works with AutoIt Beta Version 3.1.1.28

Edited by sykes

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

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

try out this line right after the $oChar.show

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

$oChar.MoveTo(250,250)

$oChar.Play("Wave")

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.

 

Share this post


Link to post
Share on other sites

It don't work by me :">

Im having always this error...


Sapiente vince, rex, noli vincere ferro!

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Has anyone seen custom characters? I'd love to see a Linux penguin character or My. Hanky from South Park.

Edit: Found some at http://www.e-clips.com.au

Edited by c0deWorm

My UDFs: ExitCodes

Share this post


Link to post
Share on other sites

It gives me an error on $oAgent = ObjCreate("Agent.Control.2) It shows that it doesn't have " after Control.2

Maybe I'm blind, but I don't see where it's missing in the quote.

Thanks

Share this post


Link to post
Share on other sites

$oAgent = ObjCreate("Agent.Control.2")

<{POST_SNAPBACK}>

I know where the quote was suppose to be.. :whistle: , it just wasn't seeing it when I tried running it in ScTE. I installed the lastest version of AutoIT and it seemed to have corrected the problem.

Thanks.

Share this post


Link to post
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
Sign in to follow this  
Followers 0