Workaround for emote parantheses

Discussion of different MUD clients, plugins, etc. as well as technical help.
Post Reply
Barius
Member
Posts: 239
Joined: Tue Mar 26, 2013 9:05 am

Workaround for emote parantheses

Post by Barius »

I've been sitting on this a good while, but after some conversation I've decided other people might like to make use of it. You can use a very easy trigger to cut off the parentheses in custom-written emotes. In Mudlet, this is done like so:

1. You need a trigger. Set the pattern like so: ^\((.*)\)$
1a. Ensure the pattern type is perl regex.
2. Insert these lines into the script field:

Code: Select all

selectString(line,1)
  setBgColor(getBgColor())
  setFgColor(getFgColor())
string = matches[2]
replace(string)
3. Save the trigger, and you're done.

In Mushclient, it's even simpler:
Open a new trigger. Use the same pattern as above, and check regular expression on the right side of the trigger setup window. Check Omit from Output. Under send to, select output. In the send box, simply enter: %1

This will cause the emote to output in a blue color, minus parentheses. You're free to further tweak this output in whatever way you prefer.

A reference image for Mushclient is supplied here: http://imgur.com/2COQlJV

If there are any others using a client that is not Mudlet or Mushclient, feel free to post your own method or request a method for the client that you use.
User avatar
Noctere
Coder
Posts: 1343
Joined: Wed Dec 28, 2011 12:48 am

Re: Workaround for emote parantheses

Post by Noctere »

This is really neat, thanks for sharing. I was actually considering something like this for my next plugin suite version. One thing I hate is missing emotes in the heat of battle because of screen scroll however the parenthesis ARE necessary to avoid exploitation but I see nothing wrong with removing them on your own personal client as long as you remember that these are for player emotes only and that you should not take them seriously if someone emotes something such as, "em now becomes a GOD and controls your mind with his super evil rune powers of death and destruction!".

Here is another code snippet that will work with my mudlet plugins and the previous instructions to add the emote to your chat log. Also, this will paint the emotes a pretty shade of purple, oooooh. Keep in mind that the trigger pattern is not fully tested and 'may' trigger incorrectly from time to time.

Code: Select all

selectString(line,1)
  setBgColor(getBgColor())
  setFgColor(255,0,193)
  copy()
string = matches[2]
replace(string)
demonnic.chat:append("Misc")
deselect()
It's not easy being evil...
User avatar
Kunren
Member
Posts: 509
Joined: Sat Dec 13, 2014 4:40 pm

Re: Workaround for emote parantheses

Post by Kunren »

THANK you. I almost never emote because the parenthesis look ugly to me. Setting this up as soon as I have wifi again.
Life is like a box of chocolates. The caramel filled ones are the best.
User avatar
lin
Member
Posts: 27
Joined: Thu Mar 07, 2013 1:43 pm

Re: Workaround for emote parantheses

Post by lin »

Noctere wrote:you should not take them seriously if someone emotes something such as, "em now becomes a GOD and controls your mind with his super evil rune powers of death and destruction!".
I take it this happens often?
Barius
Member
Posts: 239
Joined: Tue Mar 26, 2013 9:05 am

Re: Workaround for emote parantheses

Post by Barius »

In addendum: I've continued to tinker with this trigger, and in order to exempt certain game lines from highlight in this way, you can change the pattern like so:

Code: Select all

^\((?!The |You |energy )(.*)\)$
You can further add exceptions to this pattern in the same format, by adding the pipe | character, the first word of the line you want to exempt, and a space following.
Post Reply

Return to “Technical Stuff”