Here's a script that utilizes some of the synchro methods (wait) features of MSAgent. Gives one a bit more control with multi-character interaction:
code:
break on
$agent_control = "agent.control.2"
$name1 = "Merlin"
$path1 = "%windir%\msagent\chars\$name1.acs"
$name2 = "Peedy"
$path2 = "%windir%\msagent\chars\$name2.acs"
$agent = olecreateobject ( "$agent_control" )
$= oleputproperty ( $agent, "connected", "s", "1" )
$characters = val ( "&" + olegetproperty ( $agent, "characters" ) )
$= olecallfunc ( $characters, "load", "ss", "$name1", "$path1" )
$= olecallfunc ( $characters, "load", "ss", "$name2", "$path2" )
$actor1 = val ( "&" + olecallfunc ( $characters, "character", "s", "$name1" ) )
$actor2 = val ( "&" + olecallfunc ( $characters, "character", "s", "$name2" ) )
$= olecallfunc ( $actor2, "moveto", "ss", "200", "50" )
$rs = olecallfunc ( $actor1, "show" )
$rs = olecallfunc ( $actor2, "show" )
;$rs = olecallfunc ( $actor1, "wait", "o", "$wait" )
$wait = olecallfunc ( $actor1, "think", "s", "Hey $name2, wanna see me pull a KiX OLE "+
"function out of my hat ???" )
$= olecallfunc ( $actor2, "wait", "o", "$wait" )
$wait = olecallfunc ( $actor2, "think", "s", "Oh $name1, that trick never works !!!" )
$= olecallfunc ( $actor1, "wait", "o", "$wait" )
$= olecallfunc ( $actor1, "think", "s", "Let me roll up my sleaves ..." )
$= olecallfunc ( $actor1, "play", "s", "domagic1" )
$= olecallfunc ( $actor1, "think", "s", "Presto !!!" )
$= olecallfunc ( $actor1, "play", "s", "domagic2" )
$= olecallfunc ( $actor1, "play", "s", "confused" )
$wait = olecallfunc ( $actor1, "think", "s", "Looks like I need a new hat" )
$= olecallfunc ( $actor2, "wait", "o", "$wait" )
$= olecallfunc ( $actor2, "play", "s", "sad" )
$= olecallfunc ( $actor2, "think", "s", "Jeez !!! maybe you need KiXtart 2000" )
?"pause..." gets $c
$= olereleaseobject ( $actor1 )
$= olereleaseobject ( $actor2 )
$= olereleaseobject ( $agent )
exit
Shawn.