|
theputter Newbie
Joined: 27 Apr 2004 Posts: 5 Location: USA
|
Posted: 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 |
|
|
|
Maelstrom Apprentice
Joined: 10 Feb 2005 Posts: 158
|
Posted: 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 |
|
|
|
|
|