P
pmclinn
The code below is generated by an application that allows you to put a
Microsoft assistant on a webpage. I'm having a heck of a time trying
to get this script to launch on a server side button click though.
I want my user to click on a button to launch this script. I have
tried adding the object code to the html directly and then creating a
client on click event with no luck.
I eventually want to dynamically update the text that will be spoken
but for right now all I need help with is getting a script to work on a
server side button click.
Thanks for any help you can give me....
<HTML>
<HEAD>
<TITLE>My Web Store</TITLE>
<!-- Start of WebSpeak VB Script -->
<!-- This script is created using WebSpeak -->
<!-- Download Free Trial From: -->
<!-- http://www.shadisoft.com/webspeak -->
<OBJECT ID="Agent" width=0 height=0
CLASSID="CLSID45FD31B-5C6E-11D1-9EC1-00C04FD7081F"
CODEBASE="#VERSION=2,0,0,0">
</OBJECT>
<OBJECT width=0 height=0
CLASSID="CLSID:B8F2846E-CE36-11D0-AC83-00C04FD97575"
CODEBASE="#VERSION=6,0,0,0">
</OBJECT>
<SCRIPT LANGUAGE="VBScript">
<!--
Dim C
Dim URLReq
Dim ShowAnimReq
Sub Window_OnLoad()
LoadCharacter
End Sub
Sub LoadCharacter()
Dim Req
On Error Resume Next
Set Req = Agent.Characters.Load ("Char", "ROBBY.acs")
If Req.Status <> 0 Then
Set URLReq = Agent.Characters.Load("Char",
"http://agent.microsoft.com/agent2/chars/robby/robby.acf")
Else
Set C = Agent.Characters("Char")
Start
End If
End Sub
Sub Agent_RequestComplete(ByVal Request)
Dim Req
If Request = URLReq Then
If Request.Status = 1 Then
'Something to do if the URl load failed.. Busy server
Exit Sub
ElseIf Request.Status = 0 Then
Set C = Agent.Characters("Char")
Set ShowAnimReq = C.Get("state", "showing, speaking,
hiding")
C.Get "animation", "Surprised,StopListening,MoveUp", False
End If
ElseIf Request = ShowAnimReq Then
If Request.Status = 1 Then
'Request to load the Show animation failed. The server may
be busy.
Exit Sub
ElseIf Request.Status = 0 Then
Start
End If
End If
End Sub
Sub Start()
C.Moveto 800, 0
C.Show
C.Play "Surprised"
C.Speak "\pit=130\\spd=157\Hi, welcome to My Web Store!"
C.Play "StopListening"
C.Speak "\pit=130\\spd=157\Please feel free to browse our huge
selection of computer hardware and software. We offer the best prices
on the web, always!"
C.Speak "\pau=1000\"
C.Speak "\chr=""whisper""\\pit=130\\spd=157\For a limited time, I
will offer you free shipping on any order valued at $50.00 or more.
Hurry, this won't last for ever!"
C.Play "MoveUp"
C.Speak "\pit=130\\spd=157\Good Bye!"
C.Hide
End Sub
-->
</SCRIPT>
<!-- End of WebSpeak VB Script -->
<BODY>
<!-- Add your HTML code here -->
</BODY>
</HTML>
Microsoft assistant on a webpage. I'm having a heck of a time trying
to get this script to launch on a server side button click though.
I want my user to click on a button to launch this script. I have
tried adding the object code to the html directly and then creating a
client on click event with no luck.
I eventually want to dynamically update the text that will be spoken
but for right now all I need help with is getting a script to work on a
server side button click.
Thanks for any help you can give me....
<HTML>
<HEAD>
<TITLE>My Web Store</TITLE>
<!-- Start of WebSpeak VB Script -->
<!-- This script is created using WebSpeak -->
<!-- Download Free Trial From: -->
<!-- http://www.shadisoft.com/webspeak -->
<OBJECT ID="Agent" width=0 height=0
CLASSID="CLSID45FD31B-5C6E-11D1-9EC1-00C04FD7081F"
CODEBASE="#VERSION=2,0,0,0">
</OBJECT>
<OBJECT width=0 height=0
CLASSID="CLSID:B8F2846E-CE36-11D0-AC83-00C04FD97575"
CODEBASE="#VERSION=6,0,0,0">
</OBJECT>
<SCRIPT LANGUAGE="VBScript">
<!--
Dim C
Dim URLReq
Dim ShowAnimReq
Sub Window_OnLoad()
LoadCharacter
End Sub
Sub LoadCharacter()
Dim Req
On Error Resume Next
Set Req = Agent.Characters.Load ("Char", "ROBBY.acs")
If Req.Status <> 0 Then
Set URLReq = Agent.Characters.Load("Char",
"http://agent.microsoft.com/agent2/chars/robby/robby.acf")
Else
Set C = Agent.Characters("Char")
Start
End If
End Sub
Sub Agent_RequestComplete(ByVal Request)
Dim Req
If Request = URLReq Then
If Request.Status = 1 Then
'Something to do if the URl load failed.. Busy server
Exit Sub
ElseIf Request.Status = 0 Then
Set C = Agent.Characters("Char")
Set ShowAnimReq = C.Get("state", "showing, speaking,
hiding")
C.Get "animation", "Surprised,StopListening,MoveUp", False
End If
ElseIf Request = ShowAnimReq Then
If Request.Status = 1 Then
'Request to load the Show animation failed. The server may
be busy.
Exit Sub
ElseIf Request.Status = 0 Then
Start
End If
End If
End Sub
Sub Start()
C.Moveto 800, 0
C.Show
C.Play "Surprised"
C.Speak "\pit=130\\spd=157\Hi, welcome to My Web Store!"
C.Play "StopListening"
C.Speak "\pit=130\\spd=157\Please feel free to browse our huge
selection of computer hardware and software. We offer the best prices
on the web, always!"
C.Speak "\pau=1000\"
C.Speak "\chr=""whisper""\\pit=130\\spd=157\For a limited time, I
will offer you free shipping on any order valued at $50.00 or more.
Hurry, this won't last for ever!"
C.Play "MoveUp"
C.Speak "\pit=130\\spd=157\Good Bye!"
C.Hide
End Sub
-->
</SCRIPT>
<!-- End of WebSpeak VB Script -->
<BODY>
<!-- Add your HTML code here -->
</BODY>
</HTML>