Jump to content

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.

#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?

Link to post
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)

$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.

 

Link to post
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...