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
cypren
Wanderer


Joined: 03 Nov 2000
Posts: 59

PostPosted: Fri Sep 06, 2002 11:58 pm   

Prioritizing triggers
 
I'm looking for a way to control the order in which otherwise totally disconnected triggers process incoming lines.

Specfically, I'm trying to use triggers and the #cw command to colorize text. Whenever I receive the line:

SomePlayer says, "Some text."

I would like to color the first part green and leave the second part the default color.
Now, this is easily accomplished with a trigger:

#trigger {^(%w) says,} {#cw green}

Now here's the catch: I've set up additional triggers to highlight the names of some players who are of interest to me, like a friends list. Each of them has a trigger assigned to them in a class called "Names" in the vein of:

#trigger {Playername} {#cw white}

or some other color.

Both of these work great individually until one of these players speaks, in which case their name is simply colored green with the rest of the "Somebody says" text. Presumably, the name-trigger is firing first, coloring the name, and then the "says" trigger is firing next and overwriting the color.

The situation then gets even more complicated with the additional factor that some of these lines may need to be redirected to other windows by use of #CAP and #GAG. If they're sent there before either of the other two triggers are fired, the colorization won't go with them.

How can I force zMUD to always fire the line colorizer, then the name colorizer, then the capture trigger in that order? Keep in mind that these triggers cannot in any way be forcibly linked together as they are "types" of triggers, not individual triggers themselves (i.e. the speech trigger may need to work with two dozen name triggers and three capture triggers).

Any ideas anyone has would be much appreciated.
Reply with quote
doomfyre
Apprentice


Joined: 03 Jan 2002
Posts: 152
Location: USA

PostPosted: Sat Sep 07, 2002 12:27 am   
 
Here's something to try. Open the settings editor (where you edit triggers, aliases, etc). Click view, sort by, none. Two arrows should appear near the top of the setting window, whereby you can highlight triggers, and change the order that they will fire. Clicking and dragging the triggers may also work, though i dont use this feature much, so im not sure, i must admit.
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Sat Sep 07, 2002 3:01 am   
 
First, assign all the #CW or #COLOR triggers to a class. They don't all need to be in the same class, but don't leave any of them in the "None" class.

Now change the order of the classes (or the triggers if they're in the same class) until you get the color results you want.

Triggers (including #CW) affect the window they're created in. If you want to change colors in other windows, each of those windows will need its own set of triggers.

LightBulb
Senior Member
Reply with quote
cypren
Wanderer


Joined: 03 Nov 2000
Posts: 59

PostPosted: Sat Sep 07, 2002 7:34 am   
 
Thanks, this was just what I was looking for!
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