#123417 - 2004-07-21 02:55 AM
agent.kix won't go away, needs to hit ENTER to go
|
pentrix2
Fresh Scripter
Registered: 2004-07-21
Posts: 6
|
I'm using the agent.kix file. But everytime when the wizard character comes up and finish welcoming the user, it won't go away until the user has to hit the ENTER key. Below is the script, how and where would I make my modification to make him go away by himself after he welcomes my user when they login to the domain/network??
; agent.kix ; ; Demonstrates the use of COM automation to program a Microsoft Agent. ; ; Note : This code sample is provided for demonstration purposes only. ; Microsoft makes no warranty, either express or implied, ; as to its usability in any given situation. ; ; Copyright (C) 2001 Ruud van Velsen. ; All rights reserved. ; 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.moveto(400, 300) while $char.status = 4 sleep 1 ; give him time to catch up... loop
$=$char.play("read") while $char.status = 4 sleep 1 ; give him time to catch up... loop
$req=$char.speak("Hello, " + @fullname + ". Thank you for logging on to the " + @LDOMAIN + " domain.")
while $char.status = 4 sleep 1 ; give him time to catch up... loop
$=$char.play("readreturn") gets $x else ? "Microsoft Agent not installed, or failed to start. " + @error + " / " + @serror endif else ? "Microsoft Agent not installed." endif
|
|
Top
|
|
|
|
#123419 - 2004-07-21 04:12 AM
Re: agent.kix won't go away, needs to hit ENTER to go
|
pentrix2
Fresh Scripter
Registered: 2004-07-21
Posts: 6
|
you say the line "gets $x"
What do I put in place, or modify to make this script work without having the user to hit the ENTER to proceede furhter?
|
|
Top
|
|
|
|
#123421 - 2004-07-21 04:37 AM
Re: agent.kix won't go away, needs to hit ENTER to go
|
pentrix2
Fresh Scripter
Registered: 2004-07-21
Posts: 6
|
My bad. That was a dummy question. Yupe, it works now. Thanks. Where do I download the manual? The agent.kix, I found it as a sample on the web and looks pretty cool to run it on my work network. They are going to get a big kick out of this one.
|
|
Top
|
|
|
|
#123423 - 2004-07-21 07:36 AM
Re: agent.kix won't go away, needs to hit ENTER to go
|
Kdyer
KiX Supporter
   
Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
|
Additionally to Les' response.. A manual (Word Document) is included with each KiXtart download.
Kent
|
|
Top
|
|
|
|
#123424 - 2004-07-21 01:11 PM
Re: agent.kix won't go away, needs to hit ENTER to go
|
pentrix2
Fresh Scripter
Registered: 2004-07-21
Posts: 6
|
Got it working the way I wanted, but how do I make him stay a little bit longer? He goes away too fast????
|
|
Top
|
|
|
|
#123426 - 2004-07-21 02:00 PM
Re: agent.kix won't go away, needs to hit ENTER to go
|
pentrix2
Fresh Scripter
Registered: 2004-07-21
Posts: 6
|
I tried sleep 3 for all three of them, even put as sleep 5, but no difference.
|
|
Top
|
|
|
|
#123429 - 2004-07-21 02:28 PM
Re: agent.kix won't go away, needs to hit ENTER to go
|
pentrix2
Fresh Scripter
Registered: 2004-07-21
Posts: 6
|
Hey Les, thanks!! It worked like a charm!! This script is going to be tons of fun with Kixtart, I never knew logon scripting can be so much fun compared to your plain old dumb fashion way of just mapping drives. This Kixtart goes beyond just mapping drives, by the examples, samples and codes from other user's here, i see this kixtart will live for a very long time. Again, thanks Les!!!!
|
|
Top
|
|
|
|
#123430 - 2004-11-17 10:30 PM
Re: agent.kix won't go away, needs to hit ENTER to go
|
Anonymous
Anonymous
Unregistered
|
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.
|
|
Top
|
|
|
|
#123434 - 2004-11-18 01:49 AM
Re: agent.kix won't go away, needs to hit ENTER to
|
NTDOC
Administrator
   
Registered: 2000-07-28
Posts: 11634
Loc: Space
|
Well, not fully MERLIN compliant, but another way of playing sound/video perhaps along with Merlin.
Code:
; Minimum DLL version shell32.dll version 4.71 or later
; Minimum operating systems Windows 2000, Windows NT 4.0 with Internet Explorer 4.0,
; Windows 98, Windows 95 with Internet Explorer 4.0
; $FILE=Path and name of file to use
; $Show sets whether or not to show the player 0=no 1=yes
; $Wait says for the script to wait for the file to finish before closing 0=no 1=yes
; If files listed in the $MediaList are videos it will display the player even if you set it to no
Break On
Dim $SO
$SO=SetOption('Explicit','On')
$SO=SetOption('NoVarsInStrings','On')
Dim $Play,$UserList
$UserList = Split("user1|user2|user3","|")
If AScan ($UserList, @USERID)>=0
$Play=PlayMediaFile(@LDrive+'weaklink.wav',0,0)
EndIf
Function PlayMediaFile($File,$Show,$Wait)
Dim $objShell,$MediaList,$RC
If Exist($File)
If $Show<>1 $Show=0 EndIf
If $Wait<>1 $Wait=0 EndIf
$MediaList = "wmv","asf","mpg","avi"
If AScan ($MediaList, Right(($File),3))>=0
$Show=1
EndIf
$objShell=CreateObject('WScript.Shell')
$RC=$objShell.Run('mplay32.exe /play /close ' + '"' + $File + '"',$Show,$Wait)
Else
$PlayMediaFile=@ERROR
Quit $PlayMediaFile
EndIf
EndFunction
|
|
Top
|
|
|
|
#123435 - 2004-11-23 04:59 PM
Re: agent.kix won't go away, needs to hit ENTER to
|
Anonymous
Anonymous
Unregistered
|
Quote:
Here is another way to exit. :grin
Thanks, I just did a quick test and it works perfectly. Just in time for a quick deployment for the thanksgiving day holiday =)
|
|
Top
|
|
|
|
#123436 - 2005-03-31 02:02 AM
Re: agent.kix won't go away, needs to hit ENTER to
|
Spitzu
Lurker
Registered: 2005-03-23
Posts: 1
|
You don't have to answer if you don't want to, because I'm just bored and screwing around...
But, do any of you know how I might make Merlin move in an uninterrupted circle around the screen? As it is now, he just makes a hop, stops, and then flys off to the next coordinate.
Code:
break on
$agentname = "merlin"
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.moveto(0, 0) while $char.status = 4 sleep 1 ; give him time to catch up... loop
$=$char.play("read") while $char.status = 4 sleep 1 ; give him time to catch up... loop
:loop $=$char.moveto(1000, 0) $=$char.moveto(1000, 800) $=$char.moveto(0, 800) $=$char.moveto(0, 0) $=$char.moveto(1000, 400) $=$char.moveto(500, 800) $=$char.moveto(0, 400) $=$char.moveto(500, 0) gosub "loop"
while $char.status = 4 sleep 1 ; give him time to catch up... loop
$=$char.play("readreturn") gets $x else ? "Microsoft Agent not installed, or failed to start. " + @error + " / " + @serror endif
|
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
0 registered
and 871 anonymous users online.
|
|
|