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
Rose
Beginner


Joined: 23 Oct 2003
Posts: 15

PostPosted: Wed Dec 17, 2003 4:32 pm   

Need help with Ansi Trigger
 
I am using zmud 6.66 beta

I need a trigger that detects an ENTIRE line of yellow color. I am using this trigger at the moment

#TRIGGER {^%e[1;33m(*)$} {do something} "" {color}

However, this trigger detect all lines that START with yellow, including other color text on the same line. How can I modify it to detect on the ENTIRE line of that color?

Thanks.
Reply with quote
Toetag
Magician


Joined: 10 Oct 2000
Posts: 356
Location: USA

PostPosted: Thu Dec 18, 2003 3:08 am   
 
Try this posting that lightbulb answered.

http://www.zuggsoft.com/forum/topic.asp?TOPIC_ID=14020&SearchTerms=color%2Ctrigger
Reply with quote
Rose
Beginner


Joined: 23 Oct 2003
Posts: 15

PostPosted: Fri Dec 19, 2003 1:49 am   
 
That was exactly how I created it. But I needed to show what my trigger is to ask my question, and therefore I have exported it out to text and copy and paste as above.

That does not answer my question. My question is how to modify the trigger to detect ENTIRE line of the same color, currently, the trigger fires on any line that STARTS with that color. Without the ^, it fires on any line that contains that color in anywhere of the line.

I need to use (*) here, as I will use it as %1 to do something.
Reply with quote
TonDiening
GURU


Joined: 26 Jul 2001
Posts: 1958
Location: Canada

PostPosted: Fri Dec 19, 2003 2:05 am   
 
Pure conjecture, if your testing is right, that the (*) is capturing color changes. How about try the line color option in the triggers?

#TRIGGER {^(*)$} {#SHOW %ansi(blue)That was yellow.} "" {line=14}
Reply with quote
Rose
Beginner


Joined: 23 Oct 2003
Posts: 15

PostPosted: Sat Dec 20, 2003 6:47 pm   
 
I tried out the Line Color option, and it seems to be working the same way as the #TRIGGER {^%e[1;33m(*)$} {do something} "" {color}, detecting all lines that STARTS with that color. TonDiening, would it be possible for you to test it out to see if you get the same thing?

I begin to wonder if this is a beta bug or just no way to do it.

Thanks.
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Sun Dec 21, 2003 1:47 am   
 
The Line Color option is supposed to match any line which STARTS with the specified color. This is correct behavior.

Clearly, the * matches more than you want. You'll have to find (or make) a more restrictive wildcard. You should probably consider using the [range] wildcard.
Reply with quote
SolReapr
Beginner


Joined: 03 Sep 2003
Posts: 13
Location: USA

PostPosted: Tue Dec 23, 2003 9:10 am   
 
If your mud ends every line with the code to return the line color to default then this might work.

#TRIGGER {^%e[1;33m(*)%e[0m$} {#IF (%pos( %e[, "%1")) {#NOOP} {do_something}} "" {color}
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