Taken from a previous thread, lost my username... oh well.
I want to extract individual characters from a line that have different ansi to the rest of the line.
The script below separates and displays the whole line;
function my_trigger (name, line, wildcards, styles)
for k, v in ipairs (styles) do
print ("TEST: ", v.text)
end -- for loop
end -- my_trigger
ie, atm if I triggered of a line, where (x) indicates x is a different colour, such as: This i(s) a tes(t) li(n)e.
It would give me
TEST: This i
TEST: s
TEST: a tes
TEST: t
TEST: li
TEST: n
TEST: e.
Anyway to make it ignore certain colours, or ignore anything that has more than 1 character?
Oh and also to have it print the extracted chars on the same line? So the above example would give me:
TEST: stn
Cheers,
DS
I want to extract individual characters from a line that have different ansi to the rest of the line.
The script below separates and displays the whole line;
function my_trigger (name, line, wildcards, styles)
for k, v in ipairs (styles) do
print ("TEST: ", v.text)
end -- for loop
end -- my_trigger
ie, atm if I triggered of a line, where (x) indicates x is a different colour, such as: This i(s) a tes(t) li(n)e.
It would give me
TEST: This i
TEST: s
TEST: a tes
TEST: t
TEST: li
TEST: n
TEST: e.
Anyway to make it ignore certain colours, or ignore anything that has more than 1 character?
Oh and also to have it print the extracted chars on the same line? So the above example would give me:
TEST: stn
Cheers,
DS