Page 1 of 1

Workaround for emote parantheses

Posted: Mon Jan 26, 2015 12:29 am
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.

Re: Workaround for emote parantheses

Posted: Mon Jan 26, 2015 5:14 am
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()

Re: Workaround for emote parantheses

Posted: Mon Jan 26, 2015 6:01 am
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.

Re: Workaround for emote parantheses

Posted: Mon Jan 26, 2015 8:13 am
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?

Re: Workaround for emote parantheses

Posted: Mon Jan 26, 2015 8:34 am
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.