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


Joined: 23 May 2001
Posts: 68
Location: Sweden

PostPosted: Fri Jun 06, 2003 3:28 pm   

Implementing a nested color-trigger
 
I'm trying to make a trigger that is partly sensitive to the color of the zmud text.

ZMUD OUTPUT
[94 :241 F Archon Dungn ] Natsuki [=Va|ha||a=][GUIDE]

PATTERN
^~[*~]%s(%w) "IF next bracket is blue, store the content in a second variable" #IF blue ~[(*)~]

VALUE
#ADDKEY record_variable %1 %2

The reason I have to make it color-sensitive is that the output from Zmud could be like this:

[94 :241 F Archon Dungn ] Natsuki [GUIDE]

And a common trigger would then store GUIDE as the second variable in my record_variable list.

I've looked at the MXP triggers but they don't seem to fit this case...

Regards,
Mikael
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Fri Jun 06, 2003 5:34 pm   
 
If you include the [GUIDE] part in the pattern of the trigger, then it will not fire with the second case:
^~[*~]%s(%w) ~[(*)~]~[GUIDE~]

Also, you could have it check that it is not GUIDE before saving it:
#IF (%2 <> "GUIDE") {#ADDKEY record_variable %1 %2}

Kjata
Reply with quote
nostra
Wanderer


Joined: 23 May 2001
Posts: 68
Location: Sweden

PostPosted: Fri Jun 06, 2003 5:51 pm   
 
Well the GUIDE was just an example. It could be any kind of name within the brackets.

So, I have to make sure that IF I'm to store the content within a bracket it has to be conditional that the first bracket is blue (see above); else I should just ignore it.

Is it possible to have a color-sensitive trigger?
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