Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are
spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the
password reset link.
Due to spam on this forum, all posts now need moderator approval.
Entire forum
➜ MUSHclient
➜ VBscript
➜ Microsoft Agent
It is now over 60 days since the last post. This thread is closed.
Refresh page
| Posted by
| Confuse
(3 posts) Bio
|
| Date
| Fri 04 Jan 2002 02:13 AM (UTC) |
| Message
| 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...
Could you guys help me?? | | Top |
|
| Posted by
| Nick Gammon
Australia (23,165 posts) Bio
Forum Administrator |
| Date
| Reply #1 on Fri 04 Jan 2002 04:31 AM (UTC) |
| Message
| | Can you post an example of what you are doing? |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | | Top |
|
| Posted by
| Confuse
(3 posts) Bio
|
| Date
| Reply #2 on Fri 04 Jan 2002 06:55 AM (UTC) Amended on Fri 04 Jan 2002 06:57 AM (UTC) by Confuse
|
| Message
| 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.........
*****************Script Begins********************
Sub ags
Dim Fso
Dim f
Dim str
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)
World.AppendToNotepad "Tells you received", "Time: " & Now() & ">>" & " Name: " & name & " Message: " & message & vbcrlf
Call Tells(name, message)
World.Activate
End Sub
********************Script Ends******************
ok, this is the script i'm working on right now....
| | Top |
|
| Posted by
| Nick Gammon
Australia (23,165 posts) Bio
Forum Administrator |
| Date
| Reply #3 on Fri 04 Jan 2002 10:30 PM (UTC) Amended on Fri 04 Jan 2002 10:31 PM (UTC) by Nick Gammon
|
| Message
| Have you seen this post: Does MUSHclient use DDE?
That shows an example of using CreateObject. |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | | Top |
|
| Posted by
| Confuse
(3 posts) Bio
|
| Date
| Reply #4 on Sat 05 Jan 2002 01:09 AM (UTC) |
| Message
| The link was pretty helpful... i appreciate the help...
Now i probably will be able to get it....
Thanks a lot for the help.. | | Top |
|
The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).
To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.
21,195 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top