Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.
 Entire forum ➜ Programming ➜ General ➜ "Appending" text to a matching trigger

"Appending" text to a matching trigger

Posting of new messages is disabled at present.

Refresh page


Posted by Abedour   (1 post)  Bio
Date Tue 19 May 2009 09:29 AM (UTC)
Message
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.
Top

Posted by WillFa   USA  (525 posts)  Bio
Date Reply #1 on Tue 19 May 2009 07:53 PM (UTC)
Message

<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.
Top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


12,796 views.

Posting of new messages is disabled at present.

Refresh page

Go to topic:           Search the forum


[Go to top] top

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.