Prompt messing up trigger

Posted by Nerioth on Thu 13 Dec 2018 05:13 AM — 3 posts, 11,630 views.

#0
I am having a problem with my trigger. The prompt is causes there to need two separate triggers. < is the prompt(which can be changed to something else but not removed.
> Hades nudges you.
And
Hades nudges you.

The trigger is fairly simple

^(?P<person>.*) nudges you\.$
inspire %1

and

^> (?P<person>.*) nudges you\.$
inspire %1

So I need to know how to how to make it so it requires only one trigger, or perhaps just gag the prompt but everything afterwards is not...or some other method. Please note that the Keep commands on Prompt line is unchecked
Australia Forum Administrator #1
Just make the prompt part optional, eg.


^(> )?(?P<person>.*) nudges you\.$


This will make the person the second capture, but if you are accessing it by name that won't matter. Or, you can make a non-capturing group like this:


^(?:> )?(?P<person>.*) nudges you\.$


Now the person's name will be "person" and also the first wildcard.

You are using "inspire %1" so my second suggestion is probably better. Alternatively you could have written:


inspire %<person>
Amended on Thu 13 Dec 2018 06:48 AM by Nick Gammon
#2
Thanks for the help.