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