Ask A Question

Questions

2
ANSWERED

We Need Mulitple Expression Conditions

Custom vars and logic operations are, of course, a necessary part of implementing a bot. And the current implementation affords us that. But we need the ability to have multiple expressions in a condition. Otherwise, we have to nest conditional statements, which is ungainly. For instance, in the following example, we want to display the text only if variable KILLBOT_SEEN is 1 AND variable KILLBOT_HAS_LEFT is 0: `[IF([showVar=KILLBOT_SEEN]=1){[IF([showVar=KILLBOT_HAS_LEFT]=0){Killbot 9000 is still standing there. Its various sharp and pointy bits whir and glint in the muted light.}]}]` It would be preferable to write: `[IF([showVar=KILLBOT_SEEN]=1&[showVar=KILLBOT_HAS_LEFT]=0){Killbot 9000 is still standing there. Its various sharp and pointy bits whir and glint in the muted light.}]` That doesn't seem like much difference, but if you have multiple levels of nesting, it gets ugly quick. You can't space them out visually like code, because the returns are included in the chatbot output. ``` [IF([showVar=KILLBOTSEEN]=0){In the hallway outside your door stands a silvery mechanical beast with ten or more arms, each sporting a fairly dangerous looking pincer, blade, saw or other implement of apparent mayhem. Its glowing red eyes regard you with steely indifference.}] [IF([showVar=KILLBOTSEEN]=1){[IF([showVar=KILLBOTLEFT]=0){Killbot 9000 is still standing there. Its various sharp and pointy bits whir and glint in the muted light.}]}] [IF([showVar=FREAKOUT]=2){Two powerful clamps that could easily snap you in half clack open and shut, slowly at first, then more rapidly. A deep thrum begins to emanate from the bowels of the gleaming beast.}][IF([showVar=FREAKOUT]=3){Several intense laser beams flick around your body then come to a stop just over the spot where your heart is beginning to gallop wildly in your chest.}][IF([showVar=KILLBOTSEEN]=1){[IF([showVar=KILLBOTLEFT]=1){The hallway is empty.}]}] [customVar KILLBOTSEEN=1] ```

Posted by Cliff Hall 9 days ago

1
ANSWERED

We Need Conditional Quick Replies

Quick replies are great, but sometimes they need to be conditional, based upon information that we either have extracted from previous responses or have stored in custom vars. Simple example in 'Choose your own adventure' style: --- _You get out of bed and pad barefoot into the chilly bathroom. There is barely enough room to turn around and scratch your arse in here. A small window in the shower stall is open, letting in the cold night air._ **(Go back to bed)** **(Close the window)** **(Climb out window)** Close the window _After much banging and grunting, you manage to get the window closed, but that baby isn't opening again. It's now jammed shut tight in its sash._ **(Go back to bed)** Go back to bed _Rubbing your arms vigorously, you go back and sit on the side of your bed. At least it's warming up a little in here now. The rapping at the door continues, more urgently now._ **(Open the door)** **(Go into the bathroom)** **(Try to sleep)** Go into the bathroom _You get out of bed and pad barefoot into the chilly bathroom. There is barely enough room to turn around and scratch your arse in here._ **(Go back to bed)** **(Close the window)** **(Climb out window)** --- So in this final interaction, we don't want to show the **(Close the window)** **(Climb out window)** quick replies, because the window has been closed. The only way to avoid this is to have a totally different interaction for the bathroom where those quick replies aren't shown. And you need a separate interaction for the bedroom that takes you to that alternate bathroom. But when you leave the original bathroom, you can't have the quick reply take them to the alternate bedroom (with the quick reply that takes them to the alternate bathroom), because they might not close the window, in which case you want them to come back to the same bathroom interaction. The point is, just like we need variables and conditional logic that displays text only if the variables meet a certain condition (like above where _"At least it's warming up a little in here now."_ is displayed only if the bathroom window has been closed), we also need a way for quick replies to only be shown if a variable meets a certain condition.

Posted by Cliff Hall 9 days ago