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..

Here’s a working PHP client for your ChatScript server
 
 
  [ # 16 ]

So, Wade, should I be including this software with the ChatScript distribution?

 

 
  [ # 17 ]
Bruce Wilcox - Jul 18, 2013:

So, Wade, should I be including this software with the ChatScript distribution?

I didn’t check in the latest release, but I support the notion.

 

 
  [ # 18 ]

Compiled OK in x86_64 GNU/Linux:

ChatScript Version 3.62 64 bit LINUX ENGLISH
  Dictionary building disabled. 
Build0: words=66808 facts=126413 dtext=1141544 stext=0 Tue Sep 17 10:50:18 2013
Build1: words=18 facts=601 dtext=2476 stext=200252 Wed Sep 18 19:33:00 2013
Params hash:65536 dict:349525 fact:800000 text:30000kb buffer:15x80kb cache:1x50kb userfacts:100
Used 52MB: dict 268,652 (30089kb) fact 227,075 (9083kb) text 12280kb buffer (1200kb) cache (50kb) POS: 532 (17kb)
Free 40MB: dict 80,873 fact 572,925 text 17,719KB
Server ready: LOGS/serverlog1024.txt

But yet to get response from ChatScript server with working PHP client.

Youtest message
Rose

 

File: serverlog1024.txt


Server ready
Server ready
Server ready
  192.168.1.47 127.0.0.1/ Nov 11 09:54:45 time:1/1 msg: Hello =>    <=
  192.168.1.47 127.0.0.1/ Nov 11 09:57:14 time:0/0 msg: test =>    <=
  192.168.1.47 127.0.0.1/ Nov 11 09:57:19 time:1/1 msg: Hello =>    <=
Server ready
  127.0.0.1 127.0.0.1/ Nov 11 10:13:22 time:1/1 msg: test =>    <=
  127.0.0.1 127.0.0.1/ Nov 11 10:14:19 time:1/1 msg: hello =>    <=
  127.0.0.1 127.0.0.1/ Nov 11 10:16:10 time:0/0 msg: Hello =>    <=
  127.0.0.1 127.0.0.1/ Nov 11 10:21:48 time:1/1 msg: hello =>    <=
  127.0.0.1 1/ Nov 11 10:29:40 time:1/1 msg: This is a test =>    <=
Server ready
  127.0.0.1 1/ Nov 11 10:32:34 time:262/262 msg: This is a test =>    <=
  192.168.1.47 1/ Nov 11 10:33:27 time:1/1 msg: This is a test =>    <=
  127.0.0.1 1/ Nov 11 10:39:42 time:1/1 msg: This is a test =>    <=
  192.168.1.47 1/ Nov 11 10:40:34 time:1/1 msg: This is a test =>    <=
  192.168.1.47 1/ Nov 11 10:56:31 time:1/1 msg: This is a test from =>    <=
  127.0.0.1 1/ Nov 11 11:00:05 time:1/1 msg: This is a test from =>    <=
  127.0.0.1 10.10.10.10/ Nov 11 11:00:50 time:1/1 msg: This is a test from =>    <=
  127.0.0.1 10.10.10.10/ Nov 11 11:00:52 time:1/1 msg: This is a test from =>    <=
  127.0.0.1 10.10.10.10/ Nov 11 11:01:00 time:1/1 msg: This is a test from =>    <=
  127.0.0.1 10.10.10.10/test Nov 11 11:02:01 time:1/1 msg: This is a test from =>    <=
  127.0.0.1 10.10.10.10/test Nov 11 11:02:36 time:1/1 msg: test message =>    <=
  127.0.0.1 10.10.10.10/testbot Nov 11 11:08:25 time:1/1 msg: test message =>    <=

Not a lot of testing done, so far, after resolving a few minor compile errors ... 

netstat -l -p

tcp     0     0 *:1024             *:*              LISTEN     4774/LinuxChatScrip

Still trying different configurations, etc…

nmap -sP 192.168.1.0/24

Starting Nmap 6.00 ( http://nmap.org ) at 2013-11-11 11:27 EST
Nmap scan report for dslrouter (192.168.1.1)
Host is up (0.00093s latency).
MAC Address: 00:0F:DB:C4:08:43 (Cisco)
Nmap scan report for linuxbox (192.168.1.47)
Host is up.
Nmap done: 256 IP addresses (2 hosts up) scanned in 9.46 seconds

Any ideas ? 

Thanks!

 

 

 

 
  [ # 19 ]

Before I worry about PHP, which is not my native tongue, lets do the basics. 
Run your chatscript server (assuming default 1024 port)
Run a local client for chatscript:  ChatScript client=localhost:1024 or whatever your program compiled name is.
See if they talk together.

 

 
  [ # 20 ]

If they do talk together, then I’ll look into the PHP aspect (which is ~MY~ native tongue raspberry ).

 

 
  [ # 21 ]

WHAT! are you back from siesta? I thought we had to wait to Christmas before you returned to fry your eyeballs on a computer screen!  smile

 

 
  [ # 22 ]

No, I’m back (and have been for a week). Nice to know I’ve been missed. cheese

 

 
  [ # 23 ]

It goes without saying (which is why I have to say it), that you can presumably run your chatbot in purely local mode:
ChatScript local
OTHERWISE the problem is in the bot definition

 

 
  [ # 24 ]

By the way, I’ve revisited the client script recently, and have refined and revised the code a bit. The file can be found at http://www.geekcavecreations.com/?downloads

The file name is ChatScript_client.php.zip

 

 
  [ # 25 ]
Here is some feedback 

LinuxChatScript

:~/ChatScript$ ./LinuxChatScript
ChatScript Version 3.62 64 bit LINUX ENGLISH
  Dictionary building disabled. 
Build0: words=66808 facts=126413 dtext=1141544 stext=0 Tue Sep 17 10:50:18 2013
Build1: words=18 facts=601 dtext=2476 stext=200252 Wed Sep 18 19:33:00 2013
Params hash:65536 dict:349525 fact:800000 text:30000kb buffer:15x80kb cache:1x50kb userfacts:100
Used 52MB: dict 268,652 (30089kb) fact 227,075 (9083kb) text 12280kb buffer (1200kb) cache (50kb) POS: 532 (17kb)
Free 40MB: dict 80,873 fact 572,925 text 17,719KB
Server ready: LOGS/serverlog1024.txt

LinuxChatScript client=localhost:1024

:~/ChatScript$ ./LinuxChatScript client=localhost:1024

Enter client user name: Linus

** Client launched
Sent data to port 1024
Received 0 bytes
Received response:

 

LOGS/serverlog1024.txt

Server ready
  127.0.0.1 8pla/ Nov 11 15:24:04 start =>    <=
  127.0.0.1 8pla/ Nov 11 15:24:15 time:1/1 msg: hello =>    <=
  127.0.0.1 127.0.0.1/ Nov 11 15:24:56 time:0/0 msg: hello =>    <=
  127.0.0.1 127.0.0.1/ Nov 11 15:25:51 time:0/0 msg: test =>    <=
  127.0.0.1 8pla/ Nov 11 15:26:03 time:1/1 msg: hello =>    <=
  127.0.0.1 Dave/Harry Nov 11 15:31:14 time:1/1 msg: hello =>    <=
Server ready
  127.0.0.1 Dave/Harry Nov 11 15:32:17 time:1/1 msg: Hey =>    <=
  127.0.0.1 Dave/Harry Nov 11 15:32:25 time:0/0 msg: hello =>    <=
  127.0.0.1 LinuxTester/ Nov 11 15:39:41 start =>    <=
Server ready
  127.0.0.1 Linus/ Nov 11 15:40:43 start =>    <=

LinuxChatScript local

:~/ChatScript$ ./LinuxChatScript local
ChatScript Version 3.62 64 bit LINUX ENGLISH
  Dictionary building disabled. 
Build0: words=66808 facts=126413 dtext=1141544 stext=0 Tue Sep 17 10:50:18 2013
Build1: words=18 facts=601 dtext=2476 stext=200252 Wed Sep 18 19:33:00 2013
Params hash:65536 dict:349525 fact:800000 text:30000kb buffer:15x80kb cache:1x50kb userfacts:100
Used 52MB: dict 268,652 (30089kb) fact 227,075 (9083kb) text 12280kb buffer (1200kb) cache (50kb) POS: 532 (17kb)
Free 40MB: dict 80,873 fact 572,925 text 17,719KB

Enter user name: Linus


  >Hello from local

  >

No worries Bruce!  This probably just means I did not spend enough time testing this new version of Chatscript yet.  So I may be missing something, like correctly loading the bot brain or something. At least today, I got the code to compile to an executable in Linux.

There were two very minor linker errors which I worked out.  I’ll discuss them when everything is running, or before then at your request.  So all in all, this has been a good day. 

Recently, I wrote a small chatbot GUI for Linux.  So, today I decided to compile the new version of Chatscript in Linux, so I could check to see if was compatible with my GUI…  I am almost certain it will be.  More on that later.  Thank you again.

Hey look Dave… “Dave/Harry” in the server log file.  Thanks for the nice job on the PHP code update!  I tried to unofficially help Steve a little while you were on sabbatical.  That was hard work.  It made me appreciate more, your great contributions to our chatbot community.

 

 
  [ # 26 ]

So, if your test starts with the default brain from HARRY as shipped in TOPIC, then when you entered the user name you should have seen a welcome message and a harry prompt.  Are you running HARRY or your own bot compilation?

 

 
  [ # 27 ]

and if you want to email me the linker errrors you fixed, I’ll attend to them now as well. I get no linker errors when I compile on both a 32 and a 64bit Linux on amazon.

 

 
  [ # 28 ]
Bruce Wilcox - Nov 11, 2013:

So, if your test starts with the default brain from HARRY as shipped in TOPIC, then when you entered the user name you should have seen a welcome message and a harry prompt.  Are you running HARRY or your own bot compilation?

Yes.  I am running HARRY the default.  Everything compiled is carefully kept the default so we know we are looking at the same code.


Any bot compilation of my own is being kept separate from Chatscript.  For example, for debugging purposes, I separately was able to get a response through the PHP TESTING Client by compiling this socket server on port 8888… 

http://www.binarytides.com/socket-programming-c-linux-tutorial/

This site has some useful telnet commands too:

$ telnet localhost 8888
Trying 127.0.0.1…
Connected to localhost.
Escape character is ‘^]’.
Hello Client , I have received your connection. And now I will assign a handler for you
Greetings! I am your connection handler
Now type something and i shall repeat what you type
Hello
Hello
How are you
How are you
I am fine
I am fine

Email on the way, but they are minor errors, perhaps related to a new compiler version.

 

 

 
  [ # 29 ]

I made a little chatbot server out of Linux socket programming.

:~/ chatbotsocket
bind done
Waiting for incoming connections…
Connection accepted
Handler assigned

Ha, ha… Ha! LOL It’s pretty amusing, if you dig using network protocols…

:~/ telnet localhost 8888
Trying 127.0.0.1…
Connected to localhost.
Escape character is ‘^]’.
Connection received: Assigning a handler.
Hello! I’m your chatbot connection handler!
hello
Carry on.
how are you?
Move ahead.
OK
Once more.
OK
Reply more.
What?
Reply more.
How are you?   
Travel onward.

 

 

 
  [ # 30 ]

Hi,

Was working with slim framework for a chat client.
Created this class which makes connecting to a ChatScript server easier and re-usable.
very early stage build but will be adding more to it soon.

Suggestions welcome!!!

https://www.dropbox.com/s/fol8rcvn73vyhdt/bridge.php?dl=0

 

 < 1 2
2 of 2
 
  login or register to react