AI Zone Admin Forum Add your forum

NEWS: Chatbots.org survey on 3000 US and UK consumers shows it is time for chatbot integration in customer service!read more..

HTML in ChatScript
 
 

I’d like to be able to have the output of a rule that fires in chatscript cause an image to be shown, along with some text - basically simple html output.  How are rules formatted in chatscript so that can happen?  I’m running on a local machine and in that case I simply see text in the output that the bot utters (i.e. the text and html code). But then,  I moved the code to an Amazon server and it seems to work, but all the html code disappears…. (is not rendered on the output).  (although I am puzzled by not having gambits appear in the server version….)

ty,

JB

 

 
  [ # 1 ]

How are you accessing the CS server remotely, John? And if through a browser, can you view the page source?

 

 
  [ # 2 ]

Normally CS accessed via server is its own special code. A browser does not communicate directly with ChatScript, they are on different ports running different protocols. You’d have to presumably write JavaScript or PHP script that takes something like POST from a browser page, relays that to CS, and then relays back html to the browser (much as LINUX/index.php does). Of course if you are outputting html directly from CS, then your relay program can just pass it back untouched to the browser that POST’ed or GETted to it. 

Your CS server presumably has LOGS/server1024.txt as a log file, you could send me that to analyze.

 

 
  [ # 3 ]

Hi Dave—you sure have a fast reply!

1.  I SSH into the Amazon server we are using.  Works fine.
2.  On the browser, I had typed in an error.  but it seems to work fine now..  What I did was to embed html code directly in the bot response… worked.

I did have a bit of a problem with the code that Bruce gave me some time ago for capturing the discussants name:

t: You might want to ask me who I am or what my name is. 
a:  ([ <<what name>> <<who you>>]) My name is Florence Nightingale - what is your name?  Tell me your firstname and lastname or just your first name.(for example:  Jane Smith)

b: ( _[*2 *1]>) # won’t work with a general wild card
$fullname= ^pos(capitalize ‘_0’)
_1 = ^burst ($fullname _)
$firstname = _1
Nice to meet you, $firstname

.... the above code works just great perfectly—but when I put on the server and respond with my first and last name:  John Bourne… it responds .. Nice to meet you Join Bounce…  interesting substitutions.

Also, I am a bit mystified by the lack of outputting of gambits in the server version - shouldn’t the code run just the same on both my local machine and on the server?

Sorry to be such a bother…. Maybe others have this problem moving over to Amazon too…..

John

 

 
  [ # 4 ]

Hi, John.

[off_topic]
You just caught me on a break. I’m working on replacing our well pump (a long, arduous task if ever there was one), so I’ve been AFK most of the day.
[/off_topic]

 

 
  [ # 5 ]

So, generally the first thing to try is while on the server machine, log in from a local client…
./LinuxChatScript32 client=localhost:1024
for example, and show that that chat works (eliminates browser and other issues).

You said: the above code works just great perfectly—but when I put on the server and respond with my first and last name
You also said:  I am a bit mystified by the lack of outputting of gambits in the server version
Yet clearly the server started with SOME gambit since you were asked for your name. So what “lack of outputting of gambits” means is not clear.

 

 
  login or register to react