On 19 Aug 2001, at 19:28, NeoStar wrote:
> I am using a color code system where you type &number anywhere in the code
> or in the MUD to allow for extensive customization both for the players and
> myself. But I know how awful things can look when people decide to go crazy
> with it. I want to make it so that certain channels ignore the &n and just
> print it out regularly. I am totally clueless about where to start!!
> ex. someone types:
> title &1this would be a red title&0
> and instead of having their title actually become red, having it show the
> &1 and &0 or maybe just removing them completely from the result.
>
> I can go into the code and put my desired color in for each and every spot
> where it outputs the title text ("&7%s&0", player_title) but that's just a
> little too tedious.
>
> -Neostar
You can, in this situation do one of two things to solve it quickly,
anyway. You can add a flag to your colour procedure to discard all
the colours or you can make a function named strip_colour or
some such that searches for all the &n colours and simply
removes them from your string. Then, just before you have the line
GET_TITLE(ch) = title; (or what you have in your do_title) you make
a call to strip_colour(title);
Yours truly,
Muerioch
--
+---------------------------------------------------------------+
| FAQ: http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html |
| Archives: http://post.queensu.ca/listserv/wwwarch/circle.html |
+---------------------------------------------------------------+
This archive was generated by hypermail 2b30 : 12/06/01 PST