The result would be a string with formatting codes in it - HTML perhaps, though I'd actually prefer the raw server text, complete with ANSI colour codes, or perhaps with colours embedded in a format that cecho etc. understand.
copy() and paste() work for transferring between buffers, but if it's not so useful if I want to save something for later, for example saving the output of the MAP command in-game.
Two ways I could implement it at the moment:
- Have colour triggers for each of the possible colours, and a match-everything trigger. Then find colour matching parts of the full line and tag them appropriately.
- Loop through the line character-by-character, and for each one, loop through the possible colours with isAnsiFgColor(), tag each character appropriately. Note that isAnsiFgColor is itself slow compared to just grabbing the raw server output.