[Home] [Downloads] [Search] [Help/forum]

Gammon Forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  General
. . -> [Subject]  Trigger question
Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?

Trigger question

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


Posted by LucianDK   (18 posts)  [Biography] bio
Date Fri 21 Apr 2017 11:07 AM (UTC)
Message
I am trying to write a trigger that works when an exact name is mentioned and coloring the whole action with the color chosen for the name. Such as 'Foster waves to you' or Have you seen Foster? Which would be wholly in the lightbrown color ive chosen for his name.

But not triggering when words incorporating the name is mentioned. Like Fostered by wolves. Or whom is your Fosterfather?

I cant figure out how to only make the trigger activate on an exact wordmatch and still coloring the whole of the action.
[Go to top] top

Posted by Fiendish   USA  (1,641 posts)  [Biography] bio   Global Moderator
Date Reply #1 on Fri 21 Apr 2017 11:44 AM (UTC)

Amended on Fri 21 Apr 2017 11:45 AM (UTC) by Fiendish

Message
Use the "regular expression" option, and make your pattern:

\bFoster\b


\b in PCRE indicates a word boundary.

Coloring would be done by making it a color trigger. I'm pretty sure those always do the whole line.

https://github.com/fiendish/aardwolfclientpackage
[Go to top] top

Posted by LucianDK   (18 posts)  [Biography] bio
Date Reply #2 on Fri 21 Apr 2017 11:51 AM (UTC)

Amended on Fri 21 Apr 2017 11:56 AM (UTC) by LucianDK

Message
Tried that, Fiendish. Only the name gets colored, nothing else in the rest of the line.

edit:
http://imgur.com/a/wuU2j
[Go to top] top

Posted by Fiendish   USA  (1,641 posts)  [Biography] bio   Global Moderator
Date Reply #3 on Fri 21 Apr 2017 11:54 AM (UTC)

Amended on Fri 21 Apr 2017 11:56 AM (UTC) by Fiendish

Message
I guess I remembered wrong, then. Maybe put .* at the beginning and end of your pattern.

Like:

^.*\bFoster\b.*$

https://github.com/fiendish/aardwolfclientpackage
[Go to top] top

Posted by LucianDK   (18 posts)  [Biography] bio
Date Reply #4 on Fri 21 Apr 2017 11:58 AM (UTC)
Message
That seems to have done the trick, cheers.
[Go to top] 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.


1,379 views.

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

Go to topic:           Search the forum


[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

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

[Home]


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( https://gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Hosted at FutureQuest]