[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]  Multiple alias match
Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?

Multiple alias match

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


Posted by 1of10   Canada  (54 posts)  [Biography] 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
[Go to top] top

Posted by Nick Gammon   Australia  (21,322 posts)  [Biography] 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
[Go to top] top

Posted by 1of10   Canada  (54 posts)  [Biography] 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
[Go to top] top

Posted by Nick Gammon   Australia  (21,322 posts)  [Biography] 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
[Go to top] top

Posted by 1of10   Canada  (54 posts)  [Biography] 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
[Go to top] top

Posted by 1of10   Canada  (54 posts)  [Biography] 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
[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.


5,111 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]