Personally.. I think it would make more sense to limit replacement to *only* those things that are the same color. That way it will work in 90% of the cases anyone wants to use it, by just shifting everything in the final string to fit the replaced text. In cases where more than one color is found in the sequence, it should either ignore all but the first color or fail. Not the best solution, but for most people it would work.
Packet based processing is shaky at best and short of give the user the entire like 'with all codes' and letting the script modify it and return the changed result back to the client, it isn't very practical.
My own choice would be some way to have Mushclient process a line to be output, even if it contained MXP or ANSI code. This line should 'never' be run through triggers, it merely displays, so you could have a trigger option that could be used with 'omit from output' that did something like 'return wildcard(0) with codes'. In other words, you script would get the entire line, complete with any MXP that effects the contents of the line and let the user find and replace whatever they need to, then feed that changed line into a World.NoteInbeded command or something, that would process the line for output, but not to the triggers.
Frankly, I wouldn't mind seeing both. Some way to do quick and dirty replacements when that works, but also the option to tweak things more directly when it can't work. For most users though, the script intensive option would be more complex than they want. If you go the packet path, then by definition you end up with a script only solution, which imho isn't very friendly... |