Can I perform a 'reverse' ansi() ?

When I start with an attribute containing text and embedded ansi codes, for example an attribute created by -> @force me=&foo me=This is [ansi(hy,yellow)] text <- is it possible to extract the embedded ansi codes as well as the text?

The objective is to write out the contents of a set of attributes containing text and ansi() codes - actually the attributes for a character sheet which uses color coding - in a fashion that will allow the contexts to be saved in a mush client log file, and then at a later time used as input to a command that will regenerate the character sheet attributes. Extracting and restoring the textual information is trival. I haven't however had any success in maintaining the color information in the process. Can anyone point me in the right direction or suggest an alternative? Note, there's a lot of existing character sheets so changing the way information is stored in the attributes isn't a viable option. Unfortunately it's too late for that to work.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Trinsec's picture

Are you aiming at something

Are you aiming at something like decompose() ?

Thank you. That's exactly

Thank you. That's exactly what I'm looking for. We're still using 1.8.1 in which version decompose() doesn't handle ansi. So now we'll have to decide whether providing this is important enough to be worth the hassle of updating a stable working server and codebase. But thanks your reply we now know it's doable. Downloaded a win binary of 1.8.3 and tried it out. Works perfectly.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.