Web site add on - more MS Agents
"This web site
uses Microsoft Agent technology" Merlin, Genie, Peedy & Robby MS Agent Characters - Copyright © 1996 - 2004 Microsoft
This Javascript will add a Microsoft Agent to your web page. The default Agent is Merlin. ( The Ms Agent Core Components are already installed on Windows XP, 2000, and Me. ) Make Agents Speak! Microsoft Agent uses SAPI 4.0 to have it's agents speak. However, now, Windows XP is shipped with SAPI 5.0 which is not compatible with this, so your agents cannot speak. Thankfully, both SAPI 4.0 and 5.0 can be on your computer at the same time with no problems, so you need to install SAPI 4.0 before Agents can speak. Please download and install it from http://activex.microsoft.com/activex/controls/sapi/spchapi.exe and then follow the next instructions. If the chosen character file is not found on viewing computer, the script will then work using a file over the internet, and will be slower than normal. Please be patient . Note: To download the character file, select Download Agents on the main menu or click on link to the right of Agents code. There are many Agents available and those used at Rainbow Arch can be found here . Javascripts to add Ms Agents to your site can be found below. Merlin | Genie | Robby | Peedy
Ms Agent Add On Instructions Copy the code next to the Agent and paste into your HTML editor, then follow the editing instructions after the // and within the <!--comment tags--> to customize the script.
For instructions on how to control the Agents can be found here .
Download Merlin Character The Wizard (1.8 MB)
WINDOWS 2000/XP/ME Users: Merlin is already installed on Windows 2000/XP and Windows ME, so you should not need to install him.
Download Genie Character The Genie (1.6 MB)
<!-- Copy and Paste into the BODY of your HTML -->
<object id="Rainbow" width="0" height="0"
classid="CLSID:D45FD31B-5C6E-11D1-9EC1-00C04FD7081F"
codebase="#VERSION=2,0,0,0">
</object>
<object id="L&HTruVoice" width="0" height="0"
classid="CLSID:B8F2846E-CE36-11D0-AC83-00C04FD97575"
codebase="#VERSION=6,0,0,0">
</object>
<SCRIPT language="JavaScript" type="text/javascript">
<!--//
// * http://rainbow.arch.scriptmania.com/merlin/
var Robby;
var UsedChars;
var RobbyID;
var RobbyACS;
var RobbyURL;
var RobbyStates;
var RobbyAnimations;
var RobbyReq;
var RobbyStatesReq;
var RobbyAnimationsReq;
var RobbyLoaded;
var LoadReq;
var HideReq;
var RobbyLeftX, RobbyCenterX, RobbyRightX;
var RobbyTopY, RobbyCenterY, RobbyBottomY;
UsedChars = "Robby";
RobbyID = "Robby";
RobbyACS = "Robby.acs";
RobbyURL = "http://agent.microsoft.com/agent2/chars/Robby/Robby.acf";
RobbyStates = "Showing, Hiding, Speaking, Moving, Gesturing";
RobbyAnimations = "Greet, Acknowledge, Alert, Blink, Announce, DoMagic1, DoMagic2, Explain, Wave";
RobbyLoaded = false;
Window_OnLoad();
function Window_OnLoad() {
Rainbow.Connected = true;
RobbyLoaded = LoadLocalAgent(RobbyID, RobbyACS);
if (!RobbyLoaded) {
RobbyLoaded = LoadLocalAgent(RobbyID, ""); }
if (RobbyLoaded) {
SetCharObj(); }
CheckLoadStatus();}
function LoadLocalAgent(CharID, CharACS) {
Rainbow.RaiseRequestErrors = false;
if (CharACS == "") {
LoadReq = Rainbow.Characters.Load(CharID); }
else {
LoadReq = Rainbow.Characters.Load(CharID, CharACS); }
Rainbow.RaiseRequestErrors = true;
if (LoadReq.Status != 1) {
return(true); }
return(false);}
function SetCharObj() {
Robby = Rainbow.Characters.Character(RobbyID);
Robby.LanguageID = 0x409;}
function CheckLoadStatus() {
if (!RobbyLoaded) {
window.status = "Loading " + RobbyID + " Character. Please Wait...";
RobbyReq = Rainbow.Characters.Load(RobbyID, RobbyURL);
return(false); }
window.status = "";
AgentIntro();
return(true);}
function LoadError() {
var strMsg;
window.status = "";
strMsg = "Error Loading Character: " + RobbyID + "\n";
strMsg = strMsg + "This Microsoft Agent Script requires the character(s):\n";
strMsg = strMsg + UsedChars;
alert(strMsg);}
function GetScreenPositions() {
var ScreenWidth = window.screen.width;
var ScreenHeight = window.screen.height;
if ((ScreenWidth == 0) || (ScreenHeight == 0)) {
ScreenWidth = 800;
ScreenHeight = 600; }
RobbyCenterX = (parseInt(ScreenWidth / 2) - parseInt(Robby.Width / 2));
RobbyRightX = (ScreenWidth - Robby.Width);
RobbyCenterY = (parseInt(ScreenHeight / 2) - parseInt(Robby.Height / 2));
RobbyBottomY = (ScreenHeight - Robby.Height);}
function AgentIntro() {
GetScreenPositions();
// *** BEGIN CHARACTER SCRIPT ***
Robby.MoveTo(0, 0);
Robby.Show();
Robby.MoveTo(800, 500);
Robby.Play("Announce");
Robby.Speak("Hello, welcome to this website!");
Robby.Play("Greet");
Robby.Play("Blink");
Robby.Speak("I can greet your visitor");
Robby.Speak("I can get their attention");
Robby.Play("GetAttention");
Robby.Play("GetAttentionContinued");
Robby.Play("GetAttentionReturn");
Robby.Speak("I can tell them about your site");
Robby.Play("GestureRight");
Robby.Speak("PUT TEXT 1 HERE");
Robby.MoveTo (10, 500);
Robby.Play("GestureLeft");
Robby.Speak("PUT TEXT 2 HERE");
Robby.MoveTo (10, 200);
Robby.Speak("PUT TEXT 3 HERE");
Robby.MoveTo (600, 200);
Robby.Play("DoMagic1");
Robby.Play("DoMagic2");
Robby.Play("GestureUp");
Robby.Speak("PUT TEXT 4 HERE");
Robby.Play("Pleased");
Robby.MoveTo (0, 500);
Robby.Play("Read");
Robby.Play("WriteContinued");
Robby.Speak("PUT TEXT 5 HERE");
Robby.Play("WriteReturn");
Robby.MoveTo (500, 500);
Robby.Play("Think");
Robby.Think("PUT TEXT 6 HERE");
Robby.Think("I think I will tell them I have to go.");
Robby.Play("Uncertain");
Robby.Speak("See you again soon.");
Robby.Play("Wave");
Robby.Speak("Enjoy this site. Happy surfin'!");
Robby.Play("Wave");
Robby.Speak("Goodbye!");
Robby.Hide();
// *** END CHARACTER SCRIPT ***
}
//-->
</SCRIPT>
<SCRIPT language="JavaScript" type="text/javascript" for="Rainbow" event="RequestComplete(RequestObject)">
<!--//
{
switch (RequestObject) {
case RobbyReq :
if (RequestObject.Status == 0) {
SetCharObj();
if (RobbyStates != "") {
window.status = "Loading " + RobbyID + " States. Please Wait...";
RobbyStatesReq = Rainbow.Characters(RobbyID).Get("State", RobbyStates, true);
}
else if (RobbyAnimations != "") {
window.status = "Loading " + RobbyID + " Animations. Please Wait...";
RobbyAnimationsReq = Rainbow.Characters(RobbyID).Get("Animation", RobbyAnimations, true);
}
else {
RobbyLoaded = true;
CheckLoadStatus();
}
}
else {
LoadError();
}
break;
case RobbyStatesReq :
if (RequestObject.Status == 0) {
if (RobbyAnimations != "") {
window.status = "Loading " + RobbyID + " Animations. Please Wait...";
RobbyAnimationsReq = Rainbow.Characters(RobbyID).Get("Animation", RobbyAnimations, true);
}
else {
RobbyLoaded = true;
CheckLoadStatus();
}
}
else
{
LoadError();
}
break;
case RobbyAnimationsReq :
if (RequestObject.Status == 0)
{
RobbyLoaded = true;
CheckLoadStatus();
}
else
{
LoadError();
}
break;
case HideReq :
Rainbow.Characters.Unload(RobbyID);
break;
} // end switch
}
//-->
</SCRIPT>
Download Robby Character The Robot (2.2 MB)
<!-- Copy and Paste into the BODY of your HTML -->
<object id="Rainbow" width="0" height="0"
classid="CLSID:D45FD31B-5C6E-11D1-9EC1-00C04FD7081F"
codebase="#VERSION=2,0,0,0">
</object>
<object id="L&HTruVoice" width="0" height="0"
classid="CLSID:B8F2846E-CE36-11D0-AC83-00C04FD97575"
codebase="#VERSION=6,0,0,0">
</object>
<SCRIPT language="JavaScript" type="text/javascript">
<!--//
// * http://rainbow.arch.scriptmania.com/merlin/
var Peedy;
var UsedChars;
var PeedyID;
var PeedyACS;
var PeedyURL;
var PeedyStates;
var PeedyAnimations;
var PeedyReq;
var PeedyStatesReq;
var PeedyAnimationsReq;
var PeedyLoaded;
var LoadReq;
var HideReq;
var PeedyLeftX, PeedyCenterX, PeedyRightX;
var PeedyTopY, PeedyCenterY, PeedyBottomY;
UsedChars = "Peedy";
PeedyID = "Peedy";
PeedyACS = "Peedy.acs";
PeedyURL = "http://agent.microsoft.com/agent2/chars/Peedy/Peedy.acf";
PeedyStates = "Showing, Hiding, Speaking, Moving, Gesturing";
PeedyAnimations = "Greet, Acknowledge, Alert, Blink, Announce, DoMagic1, DoMagic2, Explain, Wave";
PeedyLoaded = false;
Window_OnLoad();
function Window_OnLoad() {
Rainbow.Connected = true;
PeedyLoaded = LoadLocalAgent(PeedyID, PeedyACS);
if (!PeedyLoaded) {
PeedyLoaded = LoadLocalAgent(PeedyID, ""); }
if (PeedyLoaded) {
SetCharObj(); }
CheckLoadStatus();}
function LoadLocalAgent(CharID, CharACS) {
Rainbow.RaiseRequestErrors = false;
if (CharACS == "") {
LoadReq = Rainbow.Characters.Load(CharID); }
else {
LoadReq = Rainbow.Characters.Load(CharID, CharACS); }
Rainbow.RaiseRequestErrors = true;
if (LoadReq.Status != 1) {
return(true); }
return(false);}
function SetCharObj() {
Peedy = Rainbow.Characters.Character(PeedyID);
Peedy.LanguageID = 0x409;}
function CheckLoadStatus() {
if (!PeedyLoaded) {
window.status = "Loading " + PeedyID + " Character. Please Wait...";
PeedyReq = Rainbow.Characters.Load(PeedyID, PeedyURL);
return(false); }
window.status = "";
AgentIntro();
return(true);}
function LoadError() {
var strMsg;
window.status = "";
strMsg = "Error Loading Character: " + PeedyID + "\n";
strMsg = strMsg + "This Microsoft Agent Script requires the character(s):\n";
strMsg = strMsg + UsedChars;
alert(strMsg);}
function GetScreenPositions() {
var ScreenWidth = window.screen.width;
var ScreenHeight = window.screen.height;
if ((ScreenWidth == 0) || (ScreenHeight == 0)) {
ScreenWidth = 800;
ScreenHeight = 600; }
PeedyCenterX = (parseInt(ScreenWidth / 2) - parseInt(Peedy.Width / 2));
PeedyRightX = (ScreenWidth - Peedy.Width);
PeedyCenterY = (parseInt(ScreenHeight / 2) - parseInt(Peedy.Height / 2));
PeedyBottomY = (ScreenHeight - Peedy.Height);}
function AgentIntro() {
GetScreenPositions();
// *** BEGIN CHARACTER SCRIPT ***
Peedy.MoveTo(0, 0);
Peedy.Show();
Peedy.MoveTo(800, 500);
Peedy.Play("Announce");
Peedy.Speak("Hello, welcome to this website!");
Peedy.Play("Greet");
Peedy.Play("Blink");
Peedy.Speak("I can greet your visitor");
Peedy.Speak("I can get their attention");
Peedy.Play("GetAttention");
Peedy.Play("GetAttentionContinued");
Peedy.Play("GetAttentionReturn");
Peedy.Speak("I can tell them about your site");
Peedy.Play("GestureRight");
Peedy.Speak("PUT TEXT 1 HERE");
Peedy.MoveTo (10, 500);
Peedy.Play("GestureLeft");
Peedy.Speak("PUT TEXT 2 HERE");
Peedy.MoveTo (10, 200);
Peedy.Speak("PUT TEXT 3 HERE");
Peedy.MoveTo (600, 200);
Peedy.Play("DoMagic1");
Peedy.Play("DoMagic2");
Peedy.Play("GestureUp");
Peedy.Speak("PUT TEXT 4 HERE");
Peedy.Play("Pleased");
Peedy.MoveTo (0, 500);
Peedy.Play("Read");
Peedy.Play("WriteContinued");
Peedy.Speak("PUT TEXT 5 HERE");
Peedy.Play("WriteReturn");
Peedy.MoveTo (500, 500);
Peedy.Play("Think");
Peedy.Think("PUT TEXT 6 HERE");
Peedy.Think("I think I will tell them I have to go.");
Peedy.Play("Uncertain");
Peedy.Speak("See you again soon.");
Peedy.Play("Wave");
Peedy.Speak("Enjoy this site. Happy surfin'!");
Peedy.Play("Wave");
Peedy.Speak("Goodbye!");
Peedy.Hide();
// *** END CHARACTER SCRIPT ***
}
//-->
</SCRIPT>
<SCRIPT language="JavaScript" type="text/javascript" for="Rainbow" event="RequestComplete(RequestObject)">
<!--//
{
switch (RequestObject) {
case PeedyReq :
if (RequestObject.Status == 0) {
SetCharObj();
if (PeedyStates != "") {
window.status = "Loading " + PeedyID + " States. Please Wait...";
PeedyStatesReq = Rainbow.Characters(PeedyID).Get("State", PeedyStates, true);
}
else if (PeedyAnimations != "") {
window.status = "Loading " + PeedyID + " Animations. Please Wait...";
PeedyAnimationsReq = Rainbow.Characters(PeedyID).Get("Animation", PeedyAnimations, true);
}
else {
PeedyLoaded = true;
CheckLoadStatus();
}
}
else {
LoadError();
}
break;
case PeedyStatesReq :
if (RequestObject.Status == 0) {
if (PeedyAnimations != "") {
window.status = "Loading " + PeedyID + " Animations. Please Wait...";
PeedyAnimationsReq = Rainbow.Characters(PeedyID).Get("Animation", PeedyAnimations, true);
}
else {
PeedyLoaded = true;
CheckLoadStatus();
}
}
else
{
LoadError();
}
break;
case PeedyAnimationsReq :
if (RequestObject.Status == 0)
{
PeedyLoaded = true;
CheckLoadStatus();
}
else
{
LoadError();
}
break;
case HideReq :
Rainbow.Characters.Unload(PeedyID);
break;
} // end switch
}
//-->
</SCRIPT>
Download Peedy Character The Parrot (3.3 MB)
If you use an Agent other than the default Agent your visitors may not have that Agent on their computer, so offer them a download link to the Agent you use.
There are many Agent characters available and many more are being created. Now that you have Microsoft Agent installed on your computer, you only have to download additional Characters as they become available and save them to your C:\WINDOWS\MSAGENT\CHARS or C:\WINNT\MSAGENT\CHARS folder, depending on your operating system. To see which characters you may have click on link above.