|
Bel Newbie
Joined: 20 Dec 2001 Posts: 5
|
Posted: Thu Dec 20, 2001 8:12 pm
trigger from list |
Hey guys, i know very little about this stuff so all help is welcome. What i want is a trigger if possible, so that whenever a name is received from the mud, if it is in some sort of list or DB it is highlighted.
eg, Waterrat is standing here.
would become, Waterrat* is standing here.
Possible? |
|
|
|
iljhar GURU
Joined: 10 Oct 2000 Posts: 1116 Location: USA
|
Posted: Thu Dec 20, 2001 9:56 pm |
You can try something like this:
#var PeopleToHighlight {Waterrat|Blacksmith|Mefathiel|Bob}
#trigger {(@PeopleToHighlist)} {#sub %ansi(red)%1*}
Untested and I can't test it until I get home, but this should be a good start.
Iljhar |
|
|
|
Bel Newbie
Joined: 20 Dec 2001 Posts: 5
|
Posted: Thu Dec 20, 2001 11:08 pm |
Almost, that replaces the name with the asterix, rather than adding it? :)
|
|
|
|
Bel Newbie
Joined: 20 Dec 2001 Posts: 5
|
Posted: Thu Dec 20, 2001 11:44 pm |
Ah, got it. Thanks for the help. :)
|
|
|
|
Bel Newbie
Joined: 20 Dec 2001 Posts: 5
|
Posted: Fri Dec 21, 2001 12:35 am |
Got a little problem.
Say in PeopleToHighlight you have {bel|bertie}
If they are both received on the same line it screws up, like this.
Instead of 'bel and bertie are standing here.'
i get 'bel* and bertie bertie*anding here.'
Any ideas? |
|
|
|
Vijilante SubAdmin
Joined: 18 Nov 2001 Posts: 5182
|
Posted: Fri Dec 21, 2001 2:41 am |
Regrettably the trigger is attempting to act on the same line twice and getting a little confused as such you have to do it the long and hard way.
#TR "Highlite" {{@PeopleList}} {#GAG;#T- Highlite;#LOOP %numwords(%trigger) {#SHOWPROMPT %concat(%if(%i>1," ",""),%word(%trigger,%i), %if(%ismember(%word(%trigger,%i),@PeopleList),"*",""))};#SHOW;#T+ Highlite}
That gives you the nice asterisks, if you prefer having the color now try this.
#TR {{@PeopleList}} {#CW red}
Although it makes no sense for SUB to mess up. In fact I tested it out and it worked fine.
#TR {({@PeopleList})} {#SUB %ansi(red)"%1"*}
Oh well always 20 ways to skin a cat with Zmud. |
|
|
|
|
|