[MudWalker] ANSI colors in Mudwalker

John McKisson john.mckisson at gmail.com
Wed Mar 12 10:35:24 PDT 2008


Woops I guess I didnt do that properly, here we go again...

>On Sep 19, 2007, at 14:17, Johnny Seale wrote:
 >
 >> Hello there:
 >>
 >> Is it possible to establish a trigger in Mudwalker that will
 >> display the corresponding script in an ANSI color?
 >>
 >> For instance, if I have a trigger that tells me when my character
 >> has a broken limb, I might like my script to be displayed in color.
 >>
 >> Is this something I can do easily with Mudwalker?
 >
 >No, it's not possible at all. There's no way for a script to describe
 >color output. This is a significant lack, and I'd welcome anyone's
 >ideas on implementing a fix for it.

 I have accomplished just this as a consequence of developing a 3rd
party plugin.

 My plugin resides in the filter chain before the ANSI color filter, so
 any text sent inward
 is treated as if it is coming from the MUD.  All I had to do was get a
 reference to the
 singleton instance of my plugin and call [[MWChat instance]
 send:myText toLinkFor:@"outward"]
 for a string to be displayed on the main mud window.

 Now to add ANSI color capability I defined global ansi escape
 variables in mw_init.lua, and a new lua
 function that can send text thru the filter chain.  So now I can have
 a trigger script (not in substitution) that looks like

 ChatAll(KBLD .. KRED .. "I am in room " .. KCYN .. "[" .. KYEL ..
 myRoomName .. KCYN .. "]" .. KRED)

 Where ChatAll() is a function defined in lua that sends that string
 inward along the chain as well as out to all
 of my connected chat buddies, KRED/CYN etc are the ansi escape
 strings, and myRoomName is a global
 defined by another trigger.


More information about the MudWalker mailing list