Hey all, have a problem. I have a nice miniwindow made, just a basic 200x200 window, I can print a minimap to it via an MSDP variable sent by the mud. However I cannot get the ansi colors to show. I can handle the newlines just fine, but not the colors. Right now I break the map into lines using new lines as a delimiter, which gives me a nice table for the map. Anyone know how I can parse this table and display the colors without using a trigger or OnPluginPacketReceived()? not sure how I can use those with MSDP.

Right now I break the map into lines using new lines as a delimiter, which gives me a nice table for the map. Anyone know how I can parse this table and display the colors without using a trigger or OnPluginPacketReceived()? not sure how I can use those with MSDP.

Perhaps if you disclose what this table contains we can help you more.

You should be able to simply trigger in the color codes themselves, though that will probably need some OnPacket functionality to be involved for best results. MSDP doesn't directly supply color according to the specs I'm familiar with so there's not going to be a simple check on the msdp info but the color codes should be easy enough to grab and manipulate the map with.

As for doing it without using a trigger or OnPluginPacket, not so sure that's going to be possible (it certainly isn't with my skills) but maybe Nick can work a miracle for you.

As you can see it's just strings with ansi colors in them. Right now I'm printing them to the mini window line by line, which works pretty well. If I could get the style runs from them, I'd be able to do it, but that seems to be an impossible task so far? (EDIT: also the map is spaced properly, but not in this forum post)

Now of course you don't "print" the stuff, you do a WindowText with the text and the colour code (some sort of lookup table).

To prove we are extracting the map OK, I'll just print the text and ignore the colour:

for _, line in ipairs (t) do
-- ensure line starts with default colour
line = '`0' .. line
for colour, text in string.gmatch (line, "`(%d)([^`]+)") do
Tell (text)
end -- for each style run
print ""
end -- for