I'm trying to use Micresoft Agent to work with in my scripts... like reading names or passages.. but i'm not able to call it. I used WScript to call the agent, and i think this may be the problem...
Ok.. This is the file for the agent script........
***************Script begins**************
Dim AgentControl
Dim ScriptComplete
ScriptComplete = False
Set AgentControl = WScript.CreateObject("Agent.Control.2", "AgentControl_")
AgentControl.Characters.Load "Peedy", "C:\WINDOWS\MSAGENT\CHARS\Peedy.acs"
Set Peedy = AgentControl.Characters("Peedy")
Sub AgentControl_RequestComplete(ByVal RequestObject)
' Purpose: Take action on completion or failure of requests
On Error Resume Next
If RequestObject <> EndReq Then
Else
If Not Peedy.Visible Then
' Trigger the Script to Close
ScriptComplete = True
Else
'lets me exit
End If
End If
If RequestObject <> HideReq Then
Else
AgentControl.Characters.Unload "Peedy"
ScriptComplete = True
End If
End Sub
Sub Tells(name, message)
Peedy.Commands.Caption = "My Menu"
Peedy.Commands.Add "Exit", "Exit", "Exit"
Peedy.Show
Peedy.Speak name
Peedy.Speak message
End Sub
Sub AgentControl_Command(ByVal UserInput)
If UserInput.Name = "Exit" Then
AgentControl.Characters.Unload "Peedy"
ScriptComplete = True
End If
End Sub
Do
WScript.Sleep 1000
Loop Until ScriptComplete
*******************Script Ends***************
And this is the script i have the Client access.........
Set Fso = CreateObject("Scripting.FileSystemObject")
Set f = Fso.OpenTextFile("agenttest.vbs", 1)
str = f.ReadAll
f.Close
ExecuteGlobal str
End Sub
Sub OnWorldConnect
Dim FileName
FileName = Replace (World.Worldname, " ", "") ' Remove spaces from file name
' Add other editing here if you have weird characters in your mud names.
FileName = FileName & ".txt"
if World.OpenLog (FileName, True) = eOK then ' true means append to any existing log file
World.WriteLog "--- Log Opened " & Now () & " ---" ' make note in log file
World.Note "Opened log file" & FileName ' make note in world window
end if
World.SendToNotepad "Tells you received", " " & vbcrlf
World.Activate
Call ags
End Sub
Sub OnTell (trname, trline, wildcards)
name = wildcards (1)
message = wildcards (2)