I was having trouble getting this much to work due to some subtle (to me) issues that I finally figured out.
So, here’s a working program in Perl that connects to my ChatScript server and lets me send and receive volleys from it.
Enjoy!
Comments welcome. It works for me, so far, today, against an Ubuntu 12.04 server, running ChatScript 2.03.
( My earlier efforts, documented and (mis)posted in “New to Chatbot Programming” (or some such) had two issues. One was that I wasn’t stripping trailing line-feeds off input, which I fixed.
The bigger one was that I was soliciting user input WHILE the socket was open, so the server was timing out before I’d even sent it my input. I finally moved everything else out of the small section that opens the socket, sends the message, gets the reply, and shuts the socket, and now I don’t get messages like “Sorry, what were you saying?” )
Wade