Skip to content

make permanent an option in trigger, without writing it on triggers #115

Open

Description

@elpimous

Hi Noah, hi all,
I continue Alfred s' brain (a physical Alive robot)
When I communicate with Alfred, I ofter tell "Alfred", at the beginning or end sentence :
How could I tell the program : forget alfred word ??

ex :

+ [alfred] power on the tv [alfred]

I'd like rivescript to ignore this word when i speak it. So I will not have to write it everywere !

Sure I could erase it on python with a replace command, but I'd like to do it under a rive file !

Activity

  1. sucream commented on May 16, 2018

    @sucream

    I think you can use default trigger in begin.rive.
    This trigger is matched before other all triggers.

    check this tutorial
    https://www.rivescript.com/docs/tutorial#the-begin-block

    > begin
    	+ request // This trigger is tested first.
            - {ok}
    < begin
    
  2. elpimous commented on Jun 18, 2018

    @elpimous
    Author

    Hi,
    I tested, and it doesn't work

  3. kirsle commented on Jun 19, 2018

    @kirsle
    Member

    Something like this maybe:

    + alfred *{weight=100}
    - <@>
    
    + * alfred{weight=100}
    - <@>
    

    The high weight value should ensure the trigger gets tested first (unless you have other triggers with weight >100). If it begins or ends with the word "alfred" it just redirects to a trigger without that word.

    It may be possible to combine them into one trigger, but using optionals on either end like your original example might backfire: the first iteration you'd match the [alfred] * [alfred] trigger and it would match whether or not you said the word alfred (because it's optional, you see), and it would redirect to <star> and it would test [alfred] * [alfred] first again, and repeat forever.

  4. elpimous commented on Jun 20, 2018

    @elpimous
    Author

    Perfect, Noah. So simple...
    Thanks

    ps : this test failed

    + [alfred] * [alfred]
    - <@>
    
    + bonjour *
    - salut
    
    question :  bonjour alfred
    [ERR: Deep recursion detected]
    

    This worked :

    + alfred *{weight=100}
    - <@>
    
    + * alfred{weight=100}
    - <@>
    

    Hope it will help each other !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions