Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.

Due to spam on this forum, all posts now need moderator approval.

 Entire forum ➜ MUSHclient ➜ General ➜ Prompt messing up trigger

Prompt messing up trigger

It is now over 60 days since the last post. This thread is closed.     Refresh page


Posted by Nerioth   (2 posts)  Bio
Date Thu 13 Dec 2018 05:13 AM (UTC)
Message
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
Top

Posted by Nick Gammon   Australia  (23,173 posts)  Bio   Forum Administrator
Date Reply #1 on Thu 13 Dec 2018 06:46 AM (UTC)

Amended on Thu 13 Dec 2018 06:48 AM (UTC) by Nick Gammon

Message
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>

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Nerioth   (2 posts)  Bio
Date Reply #2 on Sun 16 Dec 2018 08:14 AM (UTC)
Message
Thanks for the help.
Top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


11,003 views.

It is now over 60 days since the last post. This thread is closed.     Refresh page

Go to topic:           Search the forum


[Go to top] top

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.