#50649 - 2000-07-24 03:55 PM
Bored? Add Pizazz with OLE/MSAgent 2.0
|
Shawn
Administrator
   
Registered: 1999-08-13
Posts: 8611
|
Folks:Are your user's tired of eating the same old DOS box for lunch ? Want to add some pizazz to those boring old logon script dinners ? Try Microsoft's new and improved MSAgent 2.0 ActiveX Control (c) ! Yes sir - for the price of one coffee per day ( well - ok, it's free ), you can add cartoon animation, audio, voice synthesis and voice recognition capabilities to those plain, old, dull logon scripts. Only half-kidding here ! To use MS Agent 2.0 (ala Office Assistant without the fancy menus), go here, download, then install this package ... http://activex.microsoft.com/activex/controls/agent2/MSagent.exe You should already have Internet Explorer 4.0+ for this to work !
When done installing, check for this key in the registry ... HKEY_CLASSES_ROOT\Agent.Control.2 Then run this script ... code:
break on $agent_control = "agent.control.2"
$agent_name = "Merlin" $agent_path = "c:\winnt\msagent\chars\$agent_name.acs" $agent = olecreateobject ( "$agent_control" )
$= oleputproperty ( $agent, "connected", "s", "1" )
$characters = val ( "&" + olegetproperty ( $agent, "characters" ) )
$= olecallfunc ( $characters, "load", "ss", "$agent_name", "$agent_path" )
$character = val ( "&" + olecallfunc ( $characters, "character", "s", "$agent_name" ) )
$rs = olecallfunc ( $character, "show" )
$= olecallfunc ( $character, "play", "s", "greet" )
$= olecallfunc ( $character, "play", "s", "gestureleft" )
sleep 5
$= olecallfunc ( $character, "think", "s", "Hi there %username% !" )
sleep 5
$= olecallfunc ( $character, "think", "s", "My name is $agent_name and "+ "this is your logon script ... " )
sleep 5
$= olecallfunc ( $character, "think", "s", "Checking group membership ..." )
sleep 3
$= olecallfunc ( $character, "think", "s", "Mapping network drives ..." )
sleep 3
$= olecallfunc ( $character, "think", "s", "All done ... have a nice day !" )
?"pause..." gets $c
$= olereleaseobject ( $agent )
exit
If you have a sound card and want to try the text-to-speech (TTS) feature, change the "think" methods to "speak" methods. For those courageous souls that actually try this out and get it to work - let me know what you think ! Shawn.
[This message has been edited by Shawn (edited 24 July 2000).]
|
|
Top
|
|
|
|
#50650 - 2000-07-24 08:43 PM
Re: Bored? Add Pizazz with OLE/MSAgent 2.0
|
Shawn
Administrator
   
Registered: 1999-08-13
Posts: 8611
|
Don't know if anybody's tried this or not - forgot an important piece of info ...Download the Merlin character at http://agent.microsoft.com/agent2/chars/merlin.exe Shawn.
[I'm such a doh-head !] Shawn.. [This message has been edited by Shawn (edited 24 July 2000).]
|
|
Top
|
|
|
|
#50653 - 2000-07-25 02:08 PM
Re: Bored? Add Pizazz with OLE/MSAgent 2.0
|
Shawn
Administrator
   
Registered: 1999-08-13
Posts: 8611
|
Rad:I agree. I submitted this item just to get the old OLE juices flowing. This is more of a curiousity than anything else. I tested this on WinNT and Win2K. My Win2K box has a sound card, and I must admit - I was really shocked when Merlin started speaking the script lines. For those that try this on Win2K, change the $agent_path variable to point to c:\windows\msagent... This excerise was mostly to see how KiX would interface with an OLE control. Of course, the trick to all of this is to only use components that ship with the base OS and/or popular software packages like IE and OFFICE. Deploying new software to make this stuff work is expensive and risky. Shawn.
|
|
Top
|
|
|
|
#50654 - 2000-08-03 03:51 PM
Re: Bored? Add Pizazz with OLE/MSAgent 2.0
|
Anonymous
Anonymous
Unregistered
|
wow very impressive ! but why merlin does not talk to me ? I change the think to speak but ...
|
|
Top
|
|
|
|
#50655 - 2000-08-03 07:57 PM
Re: Bored? Add Pizazz with OLE/MSAgent 2.0
|
Shawn
Administrator
   
Registered: 1999-08-13
Posts: 8611
|
Nova:You might try going here and downloading the TTS engine: http://www.airmaldives.com/agent/agent_start.htm Shawn.
p.s. I want your expertise on that Checkpoint Firewall issue we're having. Don't forget though - we're running IE4 SP1, apparently this issue gets fixed with IE5 but for alot of reasons, we can't easily upgrade. Will contact you by email ! ThanX Shawn.
|
|
Top
|
|
|
|
#50657 - 2000-08-03 08:48 PM
Re: Bored? Add Pizazz with OLE/MSAgent 2.0
|
Shawn
Administrator
   
Registered: 1999-08-13
Posts: 8611
|
Rad:[LOL] Wish I could be there to see that ! ;D Which character is the parrot ? Actually, my kids (6&8) get a real kick out of this script - they just love it !!! "Daddy, Daddy - make Merlin talk - make him say my name - heeheehee " Lot's of larfs for the whole family ! I was thinking that maybe one could create a little KiX "play". One that was driven from an INI or text file. Don't forget - you can have more than one character running at a time. And there are methods to synchronize the players - you can change their gestures, expression and move (walk) them around the Desktop ! Shawn.
[This message has been edited by Shawn (edited 03 August 2000).]
|
|
Top
|
|
|
|
#50658 - 2000-08-03 09:02 PM
Re: Bored? Add Pizazz with OLE/MSAgent 2.0
|
Radimus
Moderator
   
Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
|
the character is peedy the parrotto install the files right-click and extract them into their own subfolder this batch file should be at the subfolders root, DOS Batch file
code:
rundll32 syssetup,SetupInfObjectInstallAction DefaultInstall 128 .\msagent\agt20.infrundll32 syssetup,SetupInfObjectInstallAction DefaultInstall 128 .\tv_enua\tv_enua.inf rundll32 syssetup,SetupInfObjectInstallAction DefaultInstall 128 .\merlin\merlin.inf kix32 agent.kix
I'm certain my users will bet just as amazed as your 6 year olds... and will have as many requests as well
|
|
Top
|
|
|
|
#50659 - 2000-08-03 10:30 PM
Re: Bored? Add Pizazz with OLE/MSAgent 2.0
|
Anonymous
Anonymous
Unregistered
|
Shawn,Merlin got another method of departure (did you know that the possible moves/actions are in the .acs file an can easily with quickview) <font size=-1>...Script... $= olecallfunc ( $character, "play", "s", "domagic2" ) $rs = olecallfunc ( $character, "hide" ) sleep 2 $= olereleaseobject ( $agent ) </font> That's about it Gillez
|
|
Top
|
|
|
|
#50660 - 2000-08-04 11:00 AM
Re: Bored? Add Pizazz with OLE/MSAgent 2.0
|
Anonymous
Anonymous
Unregistered
|
Thank you shawn . Now good fellow merlin talks and is great fun listen to reading the firewall logs (!!!!!!!!) with this one :code:
cls break on setconsole(hide) $agent_name = Merlin $mode = speak ; you change it to "think" also $agent_control= "agent.control.2" $agent_path= %windir% + "\msagent\chars\$agent_name.acs" $agent= olecreateobject("$agent_control") $= oleputproperty($agent,"connected","s","1") $characters= val("&"+olegetproperty($agent,"characters")) $= olecallfunc($characters,"load","ss","$agent_name","$agent_path") $character= val("&"+olecallfunc($characters,"character","s","$agent_name")) $= olecallfunc($character,"show") $= olecallfunc($character,"play","s","greet") $= olecallfunc($character,"play","s","gestureleft") sleep 2 if open(1,@curdir\speak.txt,2)=0 else "could not open file speak.txt" goto end endif $talk_data=readline(1) if len($talk_data)=0 or len($talk_data)=1 goto end endif do $=olecallfunc($character,$mode,"s",$talk_data) sleep 3 $talk_data=readline(1) until @error=-1 $=olecallfunc($character,"play","s","domagic2") $=olecallfunc($character,"hide") sleep 3 $=olereleaseobject($agent) $=close(1) :end
|
|
Top
|
|
|
|
#50661 - 2000-08-04 01:11 PM
Re: Bored? Add Pizazz with OLE/MSAgent 2.0
|
Anonymous
Anonymous
Unregistered
|
I finally got around to testing this and I agree: Excellent!But I've got a few questions... (as usual) - I've got the problem that after I run the script - the AgentSvr.exe process stops running and I have to start it again manually before Merlin re-appears... is this normal? I mean, do I need to start the script with a RUN command for AgentSvr.exe? - Is there another way of finding out the commands for out little electronic friends? - Why do we exist? Not all questions have to be answered anytime soon... *grin*
|
|
Top
|
|
|
|
#50662 - 2000-08-04 06:35 PM
Re: Bored? Add Pizazz with OLE/MSAgent 2.0
|
Radimus
Moderator
   
Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
|
Oh, this is just WONDERFUL... You can almost hear the users now...code:
setconsole("minimize") $agent_control = "agent.control.2" $agent_name = "Merlin" $agent_path = "c:\winnt\msagent\chars\$agent_name.acs" $agent_mode = "speak" $agent = olecreateobject ( "$agent_control" ) $= oleputproperty ( $agent, "connected", "s","1" ) $characters = val ( "&" + olegetproperty ( $agent, "characters" ) ) $= olecallfunc ( $characters, "load", "ss","$agent_name","$agent_path" ) $character = val ( "&" + olecallfunc ( $characters, "character", "s", "$agent_name" ) ) $= olecallfunc ( $character, "show" ) $= olecallfunc ( $character, "play", "s", "announce" ) $= olecallfunc ( $character, "play", "s", "greet" ) $= olecallfunc ( $character, "$agent_mode", "s", "Greetings %username% !" ) $= olecallfunc ( $character, "$agent_mode", "s", "My name is $agent_name and "+"this is your logon script ... " ) sleep 3 $= olecallfunc ( $character, "play", "s", "read" ) $= olecallfunc ( $character, "$agent_mode", "s", "Checking group membership ..." ) $= olecallfunc ( $character, "play", "s", "readreturn" ) sleep 3 $= olecallfunc ( $character, "play", "s", "domagic1" ) $= olecallfunc ( $character, "$agent_mode", "s", "I summon the network drives" ) $= olecallfunc ( $character, "play", "s", "domagic2" ) sleep 5 $= olecallfunc ( $character, "play", "s", "wave" ) $= olecallfunc ( $character, "$agent_mode", "s", "All done... have a nice day !" ) $= olecallfunc ( $character, "hide" ) sleep 5 $= olereleaseobject ( $agent ) sleep 15 exit
Thanks Shawn... This is the best thing since VNC
|
|
Top
|
|
|
|
#50663 - 2000-08-04 11:15 PM
Re: Bored? Add Pizazz with OLE/MSAgent 2.0
|
Anonymous
Anonymous
Unregistered
|
I am thinking this post will be very long ! Ok everything is great but I want to learn how to add a second character to the script and how I can move them. I can call an other script with the parot and the damn bird apears but I want both to the same script to discuss its other. Please help me do it !!!!!! ps. if my boss had installed any employer monitor system I would be in big troubles with that out of description scripts !
|
|
Top
|
|
|
|
#50664 - 2000-08-06 12:19 AM
Re: Bored? Add Pizazz with OLE/MSAgent 2.0
|
Anonymous
Anonymous
Unregistered
|
I tried that, Novastar - just take Shawns origional post and doe everything in two's:break on $agent_control = "agent.control.2" $agent_name1 = "Merlin" $agent_name2 = "Max" $agent_path1 = "c:\winnt\msagent\chars\$agent_name1.acs" $agent_path2 = "c:\winnt\msagent\chars\$agent_name2.acs" $agent1 = olecreateobject ( "$agent_control" ) $agent2 = olecreateobject ( "$agent_control" ) $= oleputproperty ( $agent1, "connected", "s", "1" ) $= oleputproperty ( $agent2, "connected", "s", "1" ) $characters1 = val ( "&" + olegetproperty ( $agent1, "characters" ) ) $characters2 = val ( "&" + olegetproperty ( $agent2, "characters" ) ) $= olecallfunc ( $characters1, "load", "ss", "$agent_name1", "$agent_path1" ) $= olecallfunc ( $characters2, "load", "ss", "$agent_name2", "$agent_path2" ) $character1 = val ( "&" + olecallfunc ( $characters1, "character", "s", "$agent_name1" ) ) $character2 = val ( "&" + olecallfunc ( $characters2, "character", "s", "$agent_name2" ) ) $rs = olecallfunc ( $character1, "show" ) $= olecallfunc ( $character1, "play", "s", "greet" ) sleep 5 $rs = olecallfunc ( $character2, "show" ) $= olecallfunc ( $character2, "play", "s", "greet" ) sleep 2 $= olecallfunc ( $character1, "play", "s", "gestureleft" ) $= olecallfunc ( $character2, "play", "s", "gestureright" ) sleep 3 $= olecallfunc ( $character1, "speak", "s", "Hi there $agent_name2 !" ) sleep 3 $= olecallfunc ( $character2, "speak", "s", "Hi $agent_name1, whazzup!" ) sleep 3 $= olecallfunc ( $character1, "speak", "s", "All done ... have a nice day !" ) ?"pause..." gets $c $= olereleaseobject ( $agent1 ) $= olereleaseobject ( $agent2 ) exit ------------------ Or what about this script where they do what you want them to do (have a file with the commands ready, make it from the info on this site http://www.msagentring.org/agentchars.html ), just to see their full potential! (just copy and paste the commands so that it's plaintext - no open lines, and name it [charactername].txt) break on RUN "c:\winnt\msagent\agentsvr.exe" ;this line is needed for mine to work! $agent_control = "agent.control.2" $agent_name = "Max" $agent_path = "c:\winnt\msagent\chars\$agent_name.acs" $agent = olecreateobject ( "$agent_control" ) $= oleputproperty ( $agent, "connected", "s","1" ) $characters = val ( "&" + olegetproperty ( $agent, "characters" ) ) $= olecallfunc ( $characters, "load", "ss","$agent_name","$agent_path" ) $character = val ( "&" + olecallfunc ( $characters, "character", "s","$agent_name" ) ) $rs = olecallfunc ( $character, "show" ) $= olecallfunc ( $character, "play", "s", "greet" ) sleep 1 $= olecallfunc ( $character, "speak", "s","Hello!" ) $= olecallfunc ( $character, "speak", "s","Just type in the box what you want me to do:" ) $= olecallfunc ( $character, "speak", "s","To make me dissapear or reappear, type go or return" ) $= olecallfunc ( $character, "speak", "s","To see what I can do, type command." ) $= olecallfunc ( $character, "speak", "s","To quit, just press enter without typing anything." ) DO "Text:" gets $text SELECT CASE ($text="go") $rs = olecallfunc ( $character, "hide" ) CASE ($text="return") $rs = olecallfunc ( $character, "show" ) CASE ($text="command") SHELL '%comspec% /c notepad.exe c:\kix\msagent\$agent_name.txt' CASE 1 GOSUB command ENDSELECT UNTIL $text="" $= olereleaseobject ( $agent ) EXIT :command $notalk=0 OPEN (7,"c:\kix\msagent\$agent_name.txt") $command=READLINE(7) WHILE $command<>"" IF $text=$command $= olecallfunc ( $character, "play", "s","$text") $notalk=1 ENDIF $command=READLINE(7) LOOP CLOSE (7) IF ($notalk=0) $= olecallfunc ( $character, "speak", "s","$text") ENDIF RETURN [This message has been edited by Fuentez (edited 05 August 2000).]
|
|
Top
|
|
|
|
#50665 - 2000-08-05 10:50 PM
Re: Bored? Add Pizazz with OLE/MSAgent 2.0
|
Anonymous
Anonymous
Unregistered
|
thanx fuentez, I think I have read almost the half documentation for the agents from microsoft until now . Ok we can have as many characters we want on screen but one is over the other. Everytime I try to move them , they start move but they do not complete their movement. I think this an kixtart "olecall" limitation . It would be very beautifull if the damn bird could fly aound the screen. The other starnge thing is that the characters are active as long the string is running with the sleep commands.
|
|
Top
|
|
|
|
#50666 - 2000-08-05 11:37 PM
Re: Bored? Add Pizazz with OLE/MSAgent 2.0
|
Anonymous
Anonymous
Unregistered
|
Yes, I noticed that momvement-limitation as well.. I wasn't familiar with the characters at all so I didn't know that they're supposed to do - I was moving them with the mouse but that's not what we want..And for being active, if you have two characters - make sure you pause the script long wnough for your action to stop before starting the second character's actions because you won't be able to hear your second character... And: I haven't been able to come up with anything REALLY usefull just yet... (other than well-spent workdays playing around! *grin*)
|
|
Top
|
|
|
|
#50667 - 2000-08-06 08:57 PM
Re: Bored? Add Pizazz with OLE/MSAgent 2.0
|
Radimus
Moderator
   
Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
|
this is what I have found on the moveto property... but I can't seem to get it to work. Anyone want to try? (from this web page: http://msdn.microsoft.com/WORKSHOP/imedia/AGENT/PROGAGENTCONTROL.asp#MOVETO )MoveTo Method Description Moves the specified character to the specified location. Syntax agent.Characters ("CharacterID").MoveTo x,y, [Speed] [This message has been edited by Radimus (edited 06 August 2000).]
|
|
Top
|
|
|
|
Moderator: Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart
|
0 registered
and 484 anonymous users online.
|
|
|