Multiple alias match

Posted by 1of10 on Mon 03 Mar 2003 10:34 PM — 6 posts, 25,257 views.

Canada #0
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?
Australia Forum Administrator #1
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.
Canada #2
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.
Australia Forum Administrator #3
Well, you don't need to do that.

Just make an alias that matches on "*" (everything) and get it to look for emoticons.
Canada #4
Wow... It's so simple... I probably never would have thought of it. ;)
Canada #5
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?