Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
Bel
Newbie


Joined: 20 Dec 2001
Posts: 5

PostPosted: 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?
Reply with quote
iljhar
GURU


Joined: 10 Oct 2000
Posts: 1116
Location: USA

PostPosted: 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
Reply with quote
Bel
Newbie


Joined: 20 Dec 2001
Posts: 5

PostPosted: Thu Dec 20, 2001 11:08 pm   
 
Almost, that replaces the name with the asterix, rather than adding it? :)
Reply with quote
Bel
Newbie


Joined: 20 Dec 2001
Posts: 5

PostPosted: Thu Dec 20, 2001 11:44 pm   
 
Ah, got it. Thanks for the help. :)
Reply with quote
Bel
Newbie


Joined: 20 Dec 2001
Posts: 5

PostPosted: 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?
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: 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.
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net