This is a simple script for appending text to the end of a mud output line while keeping the original colors of original line.
I'm posting this in the hopes that it will help someone else at some point. I spent quite a while looking for a forum topic on appending text to lines in the output window before I stumbled onto some posts about style runs. Once I found out style runs, I was able to find more posts describing what I wanted, but none using the keywords I was looking for.
This snippet can go in the body of any trigger.
Make sure that the trigger is set to send to 14 (Script after Omit), otherwise TriggerStyleRuns won't be available and the script will break.
This code could be as easily modified to prepend by placing the ColourNote before the for loop.
I have to give credit to the following threads for helping me figure out my problem.
I'm posting this in the hopes that it will help someone else at some point. I spent quite a while looking for a forum topic on appending text to lines in the output window before I stumbled onto some posts about style runs. Once I found out style runs, I was able to find more posts describing what I wanted, but none using the keywords I was looking for.
This snippet can go in the body of any trigger.
Make sure that the trigger is set to send to 14 (Script after Omit), otherwise TriggerStyleRuns won't be available and the script will break.
for k, _ in ipairs(TriggerStyleRuns) do
test = TriggerStyleRuns[k]
ColourTell ( RGBColourToName(test.textcolour), RGBColourToName(test.backcolour), test.text)
end --for
ColourNote ("red", "", " Appended!" )
This code could be as easily modified to prepend by placing the ColourNote before the for loop.
I have to give credit to the following threads for helping me figure out my problem.
Please see the forum thread: http://gammon.com.au/forum/?id=7818.
Please see the forum thread: http://gammon.com.au/forum/?id=12464.