ilovecui Posted November 4, 2007 Share Posted November 4, 2007 I want to use the com&obj function to show the ms agent,but .... here is the code: Hold the expert could help me ,thanks. #include <GUIConstants.au3> #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Form1", 223, 182, 193, 125) $Obj1 = ObjCreate("Agent.Control.2") $Obj1_ctrl = GUICtrlCreateObj($Obj1, 56, 80, 32, 32) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE dim $name="merlin" $Obj1.Connected = true; $Obj1.Characters.Load("merlin","merlin.acs");< --- the function could not run at this point $name = agent.Characters("merlin"); $name.MoveTo(200,200); $name.Show(); Exit EndSwitch WEnd Link to comment Share on other sites More sharing options...
Developers Jos Posted November 4, 2007 Developers Share Posted November 4, 2007 (edited) Here is a working version of merlin which is a translation of the vbs script found here ... maybe that helps:$strAgentName = "Merlin" $strAgentPath = "C:\Windows\Msagent\Chars\" & $strAgentName & ".acs" $Obj1 = ObjCreate("Agent.Control.2") $Obj1.Connected = 1 $Obj1.Characters.Load ($strAgentName, $strAgentPath) if @error then exit $objCharacter = $obj1.Characters.Character($strAgentName) $objCharacter.Show sleep(200) $objCharacter.Play("GetAttention") $objCharacter.Speak("Hello, how are you?") $objCharacter.Speak("I'm going now. Goodbye.") $objCharacter.Hide While $objCharacter.Visible = TRUE Sleep(250) WEnd ; This is my custom error handler Func MyErrFunc() $HexNumber=hex($oMyError.number,8) Msgbox(0,"","We intercepted a COM Error !" & @CRLF & _ "LineNumber is: " & $oMyError.scriptline & @CRLF & _ "Number is: " & $HexNumber & @CRLF & _ "Desc is: " & $oMyError.description & @CRLF & _ "Windescription is: " & $oMyError.windescription ) SetError(1); something to check for when this function returns Endfunc Edited November 4, 2007 by Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
ilovecui Posted November 7, 2007 Author Share Posted November 7, 2007 thanks for your help :^^ Link to comment Share on other sites More sharing options...
TaPuZ Posted June 30, 2009 Share Posted June 30, 2009 And... 2 years later.... How do you change the language of Merlin? Thanks. Best regards. T@PµZ. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now