Could you share this trick to syncronize the MS Agent? I'm using the following code and would like to have it exit when the character is hidden. I would prefer not to use a sleep function as the MS agent could be on screen for 3 seconds to 15 seconds.
Code:
break on
; first, try for the default agent (the wizard 'Merlin')
if exist( "%WinDir%\msagent\chars\merlin.acs" )
$agentname = "merlin"
else
;
; merlin doesn't live on this PC, try for any other MS Agent
;
$agentname = dir( "%WinDir%\msagent\chars\*.acs" )
if len( $agentname )
$agentname = substr($agentname,1, len($agentname)-4) ; remove .acs extension from name
endif
endif
if len( $agentname )
$agentpath = "%WinDir%\msagent\chars\" + $agentname + ".acs"
$agent = CreateObject ("agent.control.2")
if @error = 0
$agent.connected = "1"
$=$agent.characters.load($agentname,$agentpath)
$char = $agent.characters.character($agentname)
$=$char.show()
$=$char.wait()
$=$char.moveto(400, 300)
$req=$char.speak("Ola, " + @fullname + ". Obrigado por se logar ao domínio " + @LDOMAIN + ". Tenha um bom dia, um ótimo trabalho e até mais...")
endif
Thanks,
Jeff
Note: The greeting is in spanish, this was taken from a sample I obtained...I will be converting it at a later date and time.