silentrob / superscript-editor

NOT MAINTAINED - A Editor for authoring chatbots with SuperScript
MIT License
27 stars 16 forks source link

Is it possible to collate multiple response values ? #23

Closed hipitihop closed 9 years ago

hipitihop commented 9 years ago

How do I structure a gambit reply chain where each reply asks for a separate piece of information and when the user responds, the value is stored and a further question is asked by the bot. At the end of the chain of question responses I want to call one function with all collected values as parameters.

e.g.

+ book event 
- what's the name ?
% what's the name ?
     + * ; <--- response1
     - what's the location ?
     % what's the location ?
         + * ; <- response2
         - ^myFuction(response1, response2)

Also how is this chain done in the editor, is the ">" button the same as specifying "%" in above notiation ?

@silentrob is there a slack or irc channel where I can ask these questions more interactively ?

silentrob commented 9 years ago

Wow, sorry for not repling sooner. I have a gitter, but Im thinking a slack channel might work better. I will look into setting something up so other active users can help each other out.

So yes the > is the right button in the editor, it does the same thing as the % in the scripting interface. The only gotcha is we the respons1 is gone when you get to the second responce cycle. However in yhe function you can recall the entire message and reply history from the user, so it saved there. this.user.__history__ is an array of past utterances and replies.

mariusursache commented 9 years ago

I'm 100% for having a Slack place to chat and interact on the topic. Maybe you can build a Slack chatbot to answer all the questions. :-)