Hello. I want to start off by saying have almost no knowledge in Lua, or other languages really, and decided today to modify the ansi color copier to work for our forums and copy them as BBCode.
I have modified the copycolourcodes.xml and lotj_colours.lua to instead of copying &R &G etc to instead copy the codes with "[/color][color=#800000]" for the different colors. This works perfectly it seems. Edited out the line about added &w to the end since we don't need it for posting.
The problem I am running into, I think because of my limited knowledge on how to make this script, is that we will always have the [/color] at the very beginning of a line. This works great to end the color before a new color begins, but is there a simple way to have it remove the first [/color]?
For example:
becomes:
I have modified the copycolourcodes.xml and lotj_colours.lua to instead of copying &R &G etc to instead copy the codes with "[/color][color=#800000]" for the different colors. This works perfectly it seems. Edited out the line about added &w to the end since we don't need it for posting.
The problem I am running into, I think because of my limited knowledge on how to make this script, is that we will always have the [/color] at the very beginning of a line. This works great to end the color before a new color begins, but is there a simple way to have it remove the first [/color]?
For example:
&YYou sense a change in the &Glife &Yforces surrounding you.&w'&w
becomes:
[/color][color=#FFFF00]You sense a change in the [/color][color=#00FF00]life [/color][color=#FFFF00]forces surrounding you.[/color][color=#C0C0C0]'