"Appending" text to a matching trigger

Posted by Abedour on Tue 19 May 2009 09:29 AM — 2 posts, 15,972 views.

#0
Is there perhaps a way to append certain text to the end of a line of a certain trigger that's been called in a line of text?

I know something similar like:

<trigger
custom_colour="1"
enabled="y"
match="*DISMEMBERS*"
omit_from_output="y"
send_to="2"
sequence="100"
>
<send>%1DISMEMBERS%2 [65]</send>
</trigger>

Would replace and then append [65] at the end of the line, but of course, it would change the color and all that jazz. Is there any other way to do it to simply append something at the end of the line in a different color, while leaving everything on the line exactly the same?

Thanks in advance.
USA #1

<trigger
custom_colour="1"
enabled="y"
match="*DISMEMBERS*"
omit_from_output="y"
send_to="14"
sequence="100"
>
<send>
for k,v in ipairs(TriggerStyleRuns) do
 ColourTell(RGBtoColourName(v.textcolour), RGBtoColourName(v.backcolour), v.text)
end
ColourNote("limegreen", "black", " [65]")

</send>
</trigger>


This depends on your scripting language being set to Lua.

send_to 14 is "Script (after omit)". MushClient creates a table that Lua can use with all the styles (color codings) named TriggerStyleRuns.

If you're not using Lua... Change! oh, wait...
It's still possible, although the TriggerStyleRuns table isn't available to loop through. You'd have to script a combination of GetLineInfo and GetStyleInfo to loop thru the line. In which case, it'd probably just be easier to make these a plugin that uses Lua.