[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]  Lua
. . -> [Subject]  Selective text hightlighting?
Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?

Selective text hightlighting?

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


Posted by Ashass   (50 posts)  [Biography] bio
Date Wed 10 Dec 2008 03:34 PM (UTC)
Message
I made a very basic target trigger, and am now looking to make a more advanced one. Currently the text is matched by name, and blanket changes everything on the line to orange.

Is there a way to =just= match the name and change it to orange?

Typically the format for the name would be in

* name
* name *
name *

I don't want the surrounding text highlighted, just the name.


Current (annoying) target trigger:
<aliases>
<alias
match="target *"
enabled="y"
variable="target"
send_to="9"
sequence="100"
>
<send>%1</send>
</alias>
</aliases>

<triggers>
<trigger
custom_colour="17"
enabled="y"
expand_variables="y"
match="*@target*"
sequence="100"
other_text_colour="orangered"
>
</trigger>
</triggers>
[Go to top] top

Posted by Worstje   Netherlands  (899 posts)  [Biography] bio
Date Reply #1 on Wed 10 Dec 2008 06:01 PM (UTC)
Message
Try: \b@target\b

with regular expression activated. The \b means it will be processed as a word, meaning it needs a space, comma, dot, quote, etc next to it so you won't match stuff halfway in a word.
[Go to top] top

Posted by Ashass   (50 posts)  [Biography] bio
Date Reply #2 on Wed 10 Dec 2008 07:08 PM (UTC)
Message
That works, except there is a minor issue of matching the entire name now -- when I'm out pking, I would typically only use 2-3 letters from someones name (like m ela for murder elanesse)

I would need ela* to be highlighted, with anything after the space to not be matched.

so m ela

highlights

Elanesse stands here.
[Go to top] top

Posted by WillFa   USA  (525 posts)  [Biography] bio
Date Reply #3 on Wed 10 Dec 2008 09:42 PM (UTC)
Message
\b@target\w*\b

will do that.
[Go to top] top

Posted by Ashass   (50 posts)  [Biography] bio
Date Reply #4 on Wed 10 Dec 2008 11:04 PM (UTC)
Message
100% perfect! Thank you!
[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.


4,383 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]