I've noticed that the Clone3D Forum has vanished, and with it the Haptek for Pandorabots scripts written by Mark Chavez. While the scripts are still available at
AI Nexus Forum, I thought it wouldn't hurt to repost them here, as well.
These two scripts will add a Haptek avatar to a Pandorabot. Both scripts must be uploaded to Pandorabots for this to work. However, as Pandorabots provides no webspace for anything other than AIML or HTML files, the Haptek player.js, your .htr, and any other graphics files you use must be uploaded elsewhere and remote-linked to the Pandorabots page.
The MAINPAGE contains the code for the Haptek avatar, and an i-frame to the bot's chat frame:
<html>
<head>
<title>Haptekmain</title>
</head>
<body>
<script language=JavaScript src="http://www.yourdomain.com/js/HapPlayer411.js"></script> Be sure to incllude this file!
<script language="JavaScript">
function Startup() {
UseFile("http://www.yourdomain.com/data/yourcharacter.haptar","A");
}
VFBox("256","256", "none");
AddToInitQueue("Startup();");
</script>
<iframe width="450" height="310" name="input" src="!TALKREF!&skin=test" frameborder="0"></iframe>
</body>
</html>
The TEXT page is the working Pandorabots interface. This version was written by myself to incorporate the AIML-embedded HTML described by Dr. Wallace in
Pandorabots Embrace and Extend which allows the bot interface to display a portion of the conversation history, as well as the current input and reply:
<html>
<head>
<title>text page</title>
<script>
<!--
function sf() {document.f.message.focus();}
// -->
</script>
</head>
<body onload="sf()" bgcolor="#FFFFFF">
<font face="arial" size="3" color="000000">
<script language="javascript">
var elizaresponse= "<template context="tts"><response index="1"/></template>";
var hapA= "\\q2[s0=[";
var hapB= "]]";
function nadiaTalk(){
parent.SendText(hapA+elizaresponse+hapB);
}
nadiaTalk();
</script>
<center>
<form method="POST" name="f">!CUSTID!
<i><b>Tell <template><bot name="name"/></template>:</b></i>
<input autocomplete="off" type="TEXT" name="message" maxlength="120" size="30"><input type="submit" value="enter">
</form></center>
<P>
<center><font face="arial" size="2" color="#000000">
<template>
<think>
<set name="_history_1"><input index="1"/></set>
<set name="_history_2"><input index="2"/></set>
<set name="_history_3"><input index="3"/></set>
<set name="_history_4"><input index="4"/></set>
</think>
<condition name="_history_1" value="*">
You: <input index="1"/><br/>
<bot name="name"/>: <that index="1"/><br/>
<br/>
</condition>
<condition name="_history_2" value="*">
You: <input index="2"/><br/>
<bot name="name"/>: <that index="2"/><br/>
<br/>
</condition>
<condition name="_history_3" value="*">
You: <input index="3"/><br/>
<bot name="name"/>: <that index="3"/><br/>
<br/>
</condition>
<condition name="_history_4" value="*">
You: <input index="4"/><br/>
<bot name="name"/>: <that index="4"/><br/>
<br/>
</condition>
</template>
</font>
</center>
</font>
</body>
</html>
The MAINPAGE code, of course, can be modified like any regular HTML page to the look you desire, and the TEXT page can be co-ordinated with it, as long as the basics contained here remain intact.
This process can also be adapted to ALICE Program D, and probably, with a bit of tinkering, to any bot which has an absolute URL for the text page.