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 ➜ Multiple alias match

Multiple alias match

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


Posted by 1of10   Canada  (54 posts)  Bio
Date Mon 03 Mar 2003 10:34 PM (UTC)
Message
I hope I haven't missed it somewhere. I tried searchng for the keywords used in the thread subject, but couldn't find anything. I'd like a way to match an alias multiple times on one line.

On a talker I frequent, which uses colour codes, I have an alias to recolour emoticons:

^(.*?)(\s*?)(\:|\;)(\)|\(|p)(\s*?)(.*?)$

Sends:

%1%2~OL~FG%3~RS~FG%4~RS%5%6


I have tried changing it to:

(\:|\;)(\)|\(|p)

Sends:

~OL~FG%1~RS~FG%2~RS

But that doesn't work at all.

What I would like is to be able to colour ALL instances of emoticons on the same line, instead of just the first or last occurance. Is there a way to do this without having to code a huge extensive script, or could it be added to a future version?

One of Ten
Secondary Adjunct of Unimatrix Z03
Top

Posted by Nick Gammon   Australia  (23,133 posts)  Bio   Forum Administrator
Date Reply #1 on Tue 04 Mar 2003 12:29 AM (UTC)
Message
First, do you really mean alias, or trigger? Is it colouring ingoing or outgoing?

Assuming you are talking about an alias, one approach is to have a simple alias that catches the general case of a "say" line and then pass it to a script that uses the world.Replace function to change each sort of emoticon. The Replace function has an option to replace multiple occurences, so you would only need to have one for each different emoticon.

- Nick Gammon

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

Posted by 1of10   Canada  (54 posts)  Bio
Date Reply #2 on Tue 04 Mar 2003 04:31 AM (UTC)
Message
I do mean alias. There is no "say" command used on the outgoing text as the talker system automatically assumes the user is saying something. This can, however, be changed with a preference in the user account so that the user has to type .say Hi! as opposed to just Hi!.

The scripting method you've suggested sounds like a good option that I will have to test. It'll just take me a while to get used to having to .say something when I'm so used to just typing what I want to say. :)

Thank you.

One of Ten
Secondary Adjunct of Unimatrix Z03
Top

Posted by Nick Gammon   Australia  (23,133 posts)  Bio   Forum Administrator
Date Reply #3 on Tue 04 Mar 2003 05:04 AM (UTC)
Message
Well, you don't need to do that.

Just make an alias that matches on "*" (everything) and get it to look for emoticons.

- Nick Gammon

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

Posted by 1of10   Canada  (54 posts)  Bio
Date Reply #4 on Tue 04 Mar 2003 05:09 AM (UTC)
Message
Wow... It's so simple... I probably never would have thought of it. ;)

One of Ten
Secondary Adjunct of Unimatrix Z03
Top

Posted by 1of10   Canada  (54 posts)  Bio
Date Reply #5 on Tue 04 Mar 2003 06:01 AM (UTC)
Message
Is there any way to make the rest of my aliases for that world still match? 'Cause it appears that by having an alias of *, none of my other aliases are matched. Do I have to put tests for all my other aliases into the emoticon processing subroutine?

One of Ten
Secondary Adjunct of Unimatrix Z03
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.


19,092 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.