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
McNasty
Newbie


Joined: 20 Feb 2006
Posts: 4

PostPosted: Mon Feb 20, 2006 3:45 pm   

#cw with String List
 
I have a giant list of enemies, and I want to create a trigger that highlights those names in yellow everytime they pop up. Shocked

Now I have he variable @enemylist, values are like this= {Mannorath|Wulfen|Drazkar|Omari|Imhotep|Lyn|Lynch|Flow}
And my trigger for coloring is
{@enemylist} {#cw yellow}

This is the best I can get it at, whenever a name in the list pops up, its in yellow. However, my problem is, only the "Lyn" part in "Lynch" is colored, as well as in Lyndee. And the "Flow" in "Flowers" always comes up as yellow. (Scratch this part, just tested it again, when I upgraded from 7.20 this stopped working altogether, I have no idea what's going on, help! Confused )

I've tried many combinations to use in the list, such as putting spaces between the words and |, only space at the end, I just can't figure it out. I find that when I put spaces on both sides of their name, that works, but only works for 1 name in a given list, and I need multiple names to be colored. I'm using the latest 7.21 version, any help would be greatly appreciated.
Thanks!
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Mon Feb 20, 2006 6:27 pm   
 
You need an extra set of {}. The trigger command should look like this:

#TRIGGER {{@enemylist}} {#cw yellow}

The outer set of {} is just for the parser to split the arguments for the #trigger command. The inner {} actually sends the {@enemylist} to the trigger as a "list pattern".

The other problem is that normally zMUD looks for the matching text anywhere in the line. So of course the "Flow" in "Flowers" will be yellow (since Flow is in your list). What you want to do is add the %q punctuation pattern around the list to tell zMUD to only match full words. So, the correct trigger would look like this:

#TRIGGER {%q{@enemylist}%q} {#cw yellow}
Reply with quote
McNasty
Newbie


Joined: 20 Feb 2006
Posts: 4

PostPosted: Mon Feb 20, 2006 7:07 pm   
 
Still doesn't work. When I go to test, it says Pattern does not match.

Could be something wrong with the variable. I made the variable manually, the list of enemies is pretty big (almost 1000), I copy pasted it from Notepad. In the variable box, under text I pasted it all in (eg. "Mannorath|Wulfen|Drazkar|Omari|Imhotep|Lyn|Lynch|Flow" all like that) Any known problems with doing it this way? Should I type it in from the command line?

Thanks.
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Mon Feb 20, 2006 10:32 pm   
 
Zugg showed you the right way to do it. What you are seeing is the wonkiness of Regular Expressions. You can safely ignore whatever the Test Pattern button outputs.
_________________
EDIT: I didn't like my old signature
Reply with quote
McNasty
Newbie


Joined: 20 Feb 2006
Posts: 4

PostPosted: Tue Feb 21, 2006 2:34 am   
 
It still doesn't work properly in the game, MattLofton.
Reply with quote
Strakc
Apprentice


Joined: 31 Jan 2006
Posts: 106
Location: Virginia Beach, Virginia

PostPosted: Tue Feb 21, 2006 3:11 am   
 
\b(?:@friends)\b

this is what I use when the trigger didn't work converted it to a reqex thingy and it worked, basically its the same thing but for some odd reason it didn't work, then i changed something else and this didn't work for a time but it is working for me right now.
Reply with quote
TonDiening
GURU


Joined: 26 Jul 2001
Posts: 1958
Location: Canada

PostPosted: Tue Feb 21, 2006 3:13 am   
 
Are you trying to match a line with multiple names in it? ie

Also in the room: Mannorath, Tom, Wulfen, Dick, Drazkar, Jane, Omari, Flowthre, Imhotep, Amanda, Lyn and Flow.

Then it becomes a reparse issue.
Reply with quote
McNasty
Newbie


Joined: 20 Feb 2006
Posts: 4

PostPosted: Tue Feb 21, 2006 3:18 am   
 
Yes, that too. However it still doesn't work with just 1 name in a line.
Reply with quote
TonDiening
GURU


Joined: 26 Jul 2001
Posts: 1958
Location: Canada

PostPosted: Tue Feb 21, 2006 5:15 am   
 
Paste an example of mud code and color what gets colored and what doesn't.

Are you #SUB or #PSUB any lines?
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