#85079 - 2002-02-03 11:46 PM
MS Agent in KIX (again)
|
mmantei
Fresh Scripter
Registered: 2002-01-28
Posts: 25
|
I tried thhis question over in the SCRIPTS forum and never got it resolved. This might be a more appropriate location for it. I am attempting to use the Microsoft Agent in a logon script. This is how it looks in VBScript: Set Figure1 = Activate("Genie") Figure1.Show figure1.MoveTo(400,300) set Request=figure1.speak("Welcome to the new network") Do Until request.Status = Complete Wscript.Sleep 100 Loop The VBScript code work just fine. I've converted it into KIX 4.01 and it looks like this: $AgentName="Genie" $AgentPath = "%WinDir%\MSAgent\Chars\Genie.ACS" $Agent = CreateObject ("Agent.Control.2") $Agent.Connected = "1" $=$Agent.Characters.Load($AgentName,$AgentPath) $Char = $Agent.Characters.Character($AgentName) $=$Char.Show() $=$Char.MoveTo(400, 300) $request=$Char.Speak("Hello. Thank you for logging on to the network") while $request.status and not @error sleep(1) loop This code does not work. In VBScript the value for "request.status" changes when the agent stops speaking. In the KIX code, the value for "$request.status" is 2 and never changes. Any idea how to get his to work properly in KIX?
_________________________
Mike
|
|
Top
|
|
|
|
#85081 - 2002-02-04 01:40 PM
Re: MS Agent in KIX (again)
|
Alex.H
Seasoned Scripter
Registered: 2001-04-10
Posts: 406
Loc: France
|
Les, Do you have the original script ? Maybe something is missingAlso, what do you want to do with $Agent.AudioOutput.Status ? ???? i don't get a look to how this thing is working, but it seems to me that there is a mistake in the line
_________________________
? getobject(Kixtart.org.Signature)
|
|
Top
|
|
|
|
#85082 - 2002-02-04 02:20 PM
Re: MS Agent in KIX (again)
|
mmantei
Fresh Scripter
Registered: 2002-01-28
Posts: 25
|
I will be using the script as part of the logon script. When working with the agent, the commands are run from a queue. Therefore, if you submit 5 or 6 commands, the script will continue processing, as the agent performs the commands that are in it's queue. I am trying to determine when those actions are done, so I can close the agent, without having to use sleep statements (which would potentially be different for speed of computer and connection type). The VB Script does what it is supposed to, the KIX script doesn't. I don't know if it's the code or KIX.
_________________________
Mike
|
|
Top
|
|
|
|
#85083 - 2002-02-04 02:42 PM
Re: MS Agent in KIX (again)
|
mmantei
Fresh Scripter
Registered: 2002-01-28
Posts: 25
|
By using this statement "While ($Agent.AudioOutput.Status) <> 0" you are querying the agent itself for the status of something. How would i determine what other properties I could query from the agent? The code I posted was supposed have a "request" which would have a return value that I could query. That way I could just batch up the commands in the queue and only check the last item.As an example of the problems I'm seeing, your code didn't work for me until I threw in a few more sleep statements because it just ran too fast for the animation to keep up.
_________________________
Mike
|
|
Top
|
|
|
|
#85084 - 2002-02-04 04:23 PM
Re: MS Agent in KIX (again)
|
Shawn
Administrator
   
Registered: 1999-08-13
Posts: 8611
|
Ahhh, now your in the right forum. Try this variation on a theme:
break on $merlin_path = "%windir%\msagent\chars\merlin.acs"
$agent = createobject ("agent.control.2")
$agent.connected = "1"
$= $agent.characters.load("merlin","$merlin_path")
$merlin = $agent.characters.character("merlin")
$= $merlin.moveto(400,200)
$= $merlin.show()
$wait = $merlin.play("announce" )
do sleep 1 until $merlin.wait($wait) <> 0
$wait = $merlin.speak("I'm done blowing my own horn" )
do sleep 1 until $merlin.wait($wait) <> 0
?"script done..."
exit 1
-Shawn
[ 04 February 2002: Message edited by: Shawn ]
|
|
Top
|
|
|
|
#85087 - 2002-02-05 01:31 AM
Re: MS Agent in KIX (again)
|
mmantei
Fresh Scripter
Registered: 2002-01-28
Posts: 25
|
You know, you guys are amazing. I've only been following the stuff on the board here for a couple weeks and have picked up so much. I would have never even thought of some of the stuff I'm working on right now. The script from Shawn does exactly what I was looking for. I appreciate all of the help you guys have provided.
_________________________
Mike
|
|
Top
|
|
|
|
Moderator: Shawn, ShaneEP, Ruud van Velsen, Arend_, Jochen, Radimus, Glenn Barnas, Allen, Mart
|
0 registered
and 987 anonymous users online.
|
|
|