You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
use condition with star (if exist, star reply ; otherwise default reply) #123
! version = 2.0
// Wildcard replies normally under normal conditions but
// will reply `no-match` when the uservar `testing=true`
+ *
* <get testing> == true => no-match
- I don't know how to reply to that.
- Try asking a different way.
// set testing=true to test the wildcard for a trigger match.
+ what is a *
* <set testing=true><@> != no-match => <@><set testing=false>
- I don't know what it is.<set testing=false>
+ ball
- A rounded object.
+ box
- A square object.
The condition sets the uservar testing=true before redirecting to <star> (<@>)... the catch-all trigger will test if we're testing and say no-match if no match, which is easy for the condition to match on.
This lets the wildcard trigger continue working as normal for when the user says something completely wrong.
Ideally I'd want to have <set testing=false>inside the wildcard condition but it seemed like it didn't process the <set> tag in there. Probably a bug (in the JS version) and Python may not be affected by it, but you may wanna do some experimenting.
Example:
// clean up the `testing` variable after testing it,
// but for the JS edition of RiveScript this didn't
// take hold until the wildcard trigger itself was
// matched directly in a future reply.
+ *
* <get testing> == true => no-match<set testing=false>
- I don't know how to reply to that.
- Try asking a different way.
Activity
elpimous commentedon Jun 18, 2018
I did another test :
Doesn't work !
elpimous commentedon Jun 18, 2018
found an idea, but perhaps there is simpler !!
I just created a specific catch trigger !
kirsle commentedon Jun 18, 2018
Something like this might work: https://play.rivescript.com/s/ss8WgUpO4p
The condition sets the uservar
testing=truebefore redirecting to<star>(<@>)... the catch-all trigger will test if we're testing and sayno-matchif no match, which is easy for the condition to match on.This lets the wildcard trigger continue working as normal for when the user says something completely wrong.
Ideally I'd want to have
<set testing=false>inside the wildcard condition but it seemed like it didn't process the<set>tag in there. Probably a bug (in the JS version) and Python may not be affected by it, but you may wanna do some experimenting.Example:
elpimous commentedon Jun 19, 2018
Wow ! What a complete answer !!
As usual, thanks Noah, for your soft and your support !