|
albo Apprentice
Joined: 27 Mar 2008 Posts: 106
|
Posted: Sat Jul 31, 2010 12:52 am
triggering off a new line based solely on what color the text will be |
pretty much just that.
the immortals on my MUD will sometimes send us messages without using any of the channels and it will simply come in as a new line, but its usually colored so it doesn't just get lost in the spam.
sadly it does sometimes get lost in spam and i miss out, so i'd like to be able to capture what they say. each one uses a certain color all the time so all i need to be able to do is create an ANSI trigger off a new line because it was a certain color.
does this make any sense? |
|
|
|
charneus Wizard
Joined: 19 Jun 2005 Posts: 1876 Location: California
|
Posted: Sat Jul 31, 2010 1:11 am |
Easiest way is to have the Imms send you a message, highlight that message, then go to Package Editor, New-> Trigger, select 'Ansi trigger' option (lower pane), then paste the highlighted text. Then backspace everything up to m, and put * there.
It will look something like:
%e[1;35m
or
%e[35m
where the number represents the color. Keep in mind that it will always fire on anything that crosses the line that has that color, so put ^ at the beginning to anchor it. Keep in mind that THIS, however, will still allow anything that starts with the color to be noticed. Hope this helps!
Charneus |
|
|
|
albo Apprentice
Joined: 27 Mar 2008 Posts: 106
|
Posted: Sat Jul 31, 2010 1:29 am |
Ok, now check this out.
Why did you put in the number 35? |
|
|
|
charneus Wizard
Joined: 19 Jun 2005 Posts: 1876 Location: California
|
Posted: Sat Jul 31, 2010 2:30 am |
It was the first thing that popped into my head. ;) The number stands for the corresponding color code (if you do #SAY {%ansi(35)test}, you'll see what it outputs). The numbers will be different based on the color itself.
Charneus |
|
|
|
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: Sat Jul 31, 2010 2:56 am |
There is a slight twist with ansi color codes and how cmud abbreviates them, which can interfere with the accurate pasting of ansi color codes (it drives me batty on Aardwolf ALL the time because I frequently forget about this quirk). I don't know what's supposed to be the correct/intended behavior, but CMud will strip out superfluous 0; from ansi codes:
GAME TEXT
%e[0;35mSome colored text %e[0;33mgoes %e[0;35mhere.%e[0m
CMUD PASTE TEXT (going from memory here, so it might strip out the beginning 0; too)
%e[0;35mSome colored text %e[33mgoes %e[35mhere.%e[0m
This can cause your newly-created ansi trigger to not match the game-sent text even though Cmud will interpret either form as the same color when printing them to the screen. |
|
_________________ EDIT: I didn't like my old signature |
|
|
|
|
|