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

C++ Help
 
 

I am looking to integrate my chat bot with other applications like one that uses a C++ emotion system . Is there a way that Chat Script can interact with these systems?

an example of what im trying to do:
if the programs avatar is happy, then it would use my chatscript bot to respond with happy responses in the interface or emote in te game

if the user insults the avatar in chatting, or attacks the user in a game then the avatar will be angry at the user and speak accordingly to them

if the user is idle on the avatar interface for a while the avatar will get bored and toss idle gambits to the user trying to invoke small talk or a conversation.

Ive been looking at the manuals and the code butr I havent figured out if its doable yet.

 

 
  [ # 1 ]

Normally, this would be done by making chatscript a subsystem of some larger program.
Chatscript would return out-of-band information with or without chat and be sent in out-of-band information.
The convention for out-of-band information is to put it within [ ] as the first data of input or output.
See the thread: Putting commands in output text

 

 
  [ # 2 ]

Speaking for myself, I am running ChatScript as a server and my program is communicating with it, using a library called SimpleSockets.

http://sockets.carrierlabs.com/

You can run ChatScript as a local server for testing purposes, if you start it with the LocalServer.bat file.

 

 
  [ # 3 ]

Ok, this is very helpful, I was planning to use ChatScript locally with my game but I will look into simple sockets as it would work well with my Avatar interface. I will look into both of these further and hopefully all goes well

 

 
  [ # 4 ]

oK Ive ran into another problem, I am trying to call the server from my main program using system();
Its not working and keeps giving me an error that the file name is unreconized.

 

 
  [ # 5 ]

I don’t understand.  A “server” version of chatscript should be running w/o your program to start with.
You wouldn’t call system to launch it and access it.

 

 
  [ # 6 ]

It seems to me that if CS is running as a server on your local computer, your program would need to make either a connection through sockets or maybe as an HTTP request. When I wrote a “talking” GUI for ChatScript, I used sockets to connect to localhost on the default port. However, that was quite a while back, and written in VB, rather than C++, so specific info probably wouldn’t help much. That said, though, it should at least point you in a usable direction. smile

 

 
  [ # 7 ]
Bruce Wilcox - Jan 22, 2013:

I don’t understand.  A “server” version of chatscript should be running w/o your program to start with.
You wouldn’t call system to launch it and access it.

Sorry for being confusing, maybe im over complicating things…
What I was trying to do was whenever my main program is initalized, it would start a CS server then connect to it. Once the program closes it is suppose to close the server also. Is this doable or am I approaching the entire situation incorrectly?

Would it be better to do it Daves way and just start a CS server then connect?

 

 
  [ # 8 ]

well, to get to a point of testing the rest of your code, I’d just start the server before running your program and then connecting to it. Calling system to launch the server has a problem because why does SYSTEM return? The server doesn’t end.

 

 
  [ # 9 ]

I cleared out your post for you, Davaris.

Depending on the framework, you can do a “pass-through” system call that doesn’t require a returned status code, so that shouldn’t be a real problem. I just don’t know if it’s possible in C++ (I know that it is in VB, though, so I expect it is in most/all .NET frameworks). For that matter, on Windows systems, you can do the old Batch file “trick” of using “CALL path\to\executable”, which is functionally equivalent. smile

 

 
  [ # 10 ]

I see that using CreateProcess is a much better method than system. But Ill figure that out later, back to the server, Ill just keep it open like you said Bruce since its just for testing purposes. I tried to get system to work all day but it never worked out and I got wierd runtime errors. Ill have to study the CreateProcess() command and open through the file later.
Thankyou for the help

 

 
  login or register to react