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


Joined: 27 Apr 2004
Posts: 5
Location: USA

PostPosted: Mon Mar 28, 2005 5:52 am   

Triggering off a colored line of text with a variable
 
OK here is the problem...
I need to be able to trigger off of a line of text in only one specific color..
I have tried using ANSI triggering which does work...but if you send the ansi code in a tell or a say it triggers the action...even though the text isn't in the correct color. I tried using the text color and have had no luck getting that to work at all....

My basic trigger looks like this
%1 gives you 200 gold. <without the ansi code....
I am kinda new at programming triggers...so my applogies...
here is what the mud looks like
John gives you 200 gold.
i have tried using ansi triggering with the ansi code at the begginging...and unless someone puts in the ansi code it works..fine...but i don't want to leave any doubts that it will screw up
Anyy help is appreciated...thanks
Theputter
Reply with quote
Maelstrom
Apprentice


Joined: 10 Feb 2005
Posts: 158

PostPosted: Mon Mar 28, 2005 8:27 pm   
 
You need to also anchor the text. ANSI is just the first step...
^ matches beginning of line
$ at the end.

The full trigger should look like:
^<ANSI code>%1 gives you 200 gold.$

Doing this (in 99% of all cases) remove the tells and says... the only time this will ever falsely fire is if its in this color and the line wraps just perfectly so that text is on a line by itself. Very rare IMO...

Using the $ at the end you *may* have to also have the ANSI reset code also... havnt tested
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