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

Putting commands in output text
 
 

Are there recommended characters used to mark output text in Chatscript, as text that can be seen by the client program, but should not be visible to the user?

?:  MEAT (you like meat)  I do.

I was thinking after the text “I do.”, I should be able to add text, that would be interpreted as commands by my client program.

For example:

?:  MEAT (you like meat)  I do. *special commands go here*

 

 
  [ # 1 ]

Looks like I can use ‘Gesture Input and Output’ to achive this.

 

 
  [ # 2 ]

I assume this is the right way to do it. It matches [nod head no] as input and outputs [head tilt ] You should try it some time. Travel broadens the mind.

t: Did you run away from home when you were little?
#! sure
a: (~yes) Was it fun?
#! never
a: (~no) You should try it some time. Travel broadens the mind.
#! no gesture
a: ( \[ nod head no \] ) \[ head tilt \] You should try it some time. Travel broadens the mind.

 

 

 
  [ # 3 ]

That’s the way I do it to send gestures to Unity. We scan for [ ] and use that for gestures.

Never tried the input side though.

 

 
  [ # 4 ]

Thanks Doug.

 

 
  [ # 5 ]

Text is text.  That having been said, the “convention” for all out-of-band communication is that it be first in input and output and be encased in square brackets.  E.g.

user app:  [ gesture=smile ]  —user app sending face recognition that user smiled

cs output:  [ mood=happy]  I’m glad you are happy.

 

 
  [ # 6 ]

That looks good. Thanks Bruce.

 

 
  [ # 7 ]

I tried sending [gesture=smile]  to Chatscript and it does not recognize it, if the equals sign is included.


It works if [gesture smile] is sent and a match is attempted:

a: ( \[ gesture smile \] ) You should try it some time. Travel broadens the mind.


Fails if [gesture=smile] is sent and a match is attempted:

a: ( \[ gesture=smile \] ) You should try it some time. Travel broadens the mind.

 

 
  [ # 8 ]

Have you tried escaping the = by chance?

a: ( \[ gesture\=smile \] ) You should try it some time. Travel broadens the mind.

 

 
  [ # 9 ]

Thanks for replying Dave.

I tried this with [gesture=smile]:

a: ( \[ gesture\=smile \] ) You should try it some time. Travel broadens the mind.

and this with [gesture=smile]:

a: ( \[ gesture \= smile \] ) You should try it some time. Travel broadens the mind.

and no luck for either.

 

 
  [ # 10 ]

Then I guess I’ll sit back and let the expert handle it. At least I tried. smile

 

 
  [ # 11 ]

I mislead you with my example, sorry. 

You have to work with existing ChatScript syntax, including reserve words and structures. The gesture=smile component is, of course, a comparison operator in a pattern.  gesture:smile would have worked fine.  Currently CS has no way to escape the component. I will add such in a few weeks, so you could write:
u: ( \[ \gesture=smile \] ) response..

Of course you also have to decide what effect you are seeking. Making the argument to the component be a part of it, means you have to fully match the thing like “gesture:smile” whereas making it be the next token means you can just match the “gesture” and then pass along the next value as an argument to things bound as a pattern match variable. There isn’t any right choice, unless your code needs to be extensible and you intend to separate into one topic the basic match, and have another updateable topic handle the exact gesture.

 

 
  [ # 12 ]

“The gesture=smile component is, of course, a comparison operator in a pattern.  Currently CS has no way to escape the component.”

I thought it might be something to do with that. Thanks again.

 

 
  [ # 13 ]

” I will add such in a few weeks, so you could write:
u: ( \[ \gesture=smile \] ) response..”

Much appreciated, Bruce.

 

 
  login or register to react