@ hixxy
Sorry but that fails at the basic concept of what I want

original line:
hello pballz how?

your snippet:
hello pballz how?

anything after the nick returns to the default color, which is exactly what I don't want

@ Riamus2
You also miss the problem that turns this from a simple replace into a painful script. If you replace the nick with the nick and color codes around it you mess up the colors after the nick, like in the example of what hixxy's script does.

My current script loops through the whole sentence and grabs the last codes before the nick then places that after the nick to preserve the color after the nick has been colored. It also counts bold, underline, and reverse characters. It also picks up the control code strip character.

I don't need help making a script really, I'm just trying to suggest what I feel is a good idea, but it seems no one else understands the problem since they can't see the difficultly in a solution script wise.

P.S.
I actually though adding a new option to the $replace identifier would be nice. Make it so that any control codes before the item being replaced would be automatically continued after the replaced item.

Example
(lets say k is ctrl+k the color character and the .cc on $replace is the proposed addition to that command)
set -l %phrase k4Hello pball how are you?
echo -a $replace(%phrase,pball,k9pball).cc

result: k4Hello k9pballk4 how are you?

it'd take the k4 that's active before the replaced text and apply it after replaced text, this would make everyone's simple idea of just replacing work, while keeping all other control codes intact.

Last edited by pball; 16/03/10 01:41 AM.