Register forum user name 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.

Due to spam on this forum, all posts now need moderator approval.

 Entire forum ➜ MUSHclient ➜ General ➜ Trigger Recursion How-To

Trigger Recursion How-To

It is now over 60 days since the last post. This thread is closed.     Refresh page


Posted by Xvordan   (29 posts)  Bio
Date Wed 19 Oct 2016 07:37 PM (UTC)
Message
I'm playing a mud that prefaces a lot of line with the same boilerplate, so I have a trigger to shorten it for sanity's sake.
For example: Notice: "This is what's happening.", becomes "This is what's happening.".

My problem is that I sometimes want to trigger based on the text following the boilerplate. If I set up further triggers to react on Notice: "...", the trigger doesn't work. If I set it up to react on the modified output, it doesn't work either.
I've tried changing the sequence of the master substitution trigger that strips the "Notice:" bit off to both higher and lower values without any success. Trying to do so with the keep evaluating checkbox didn't seem to work either.

I have seen this work in a plugin form before: The plugin had a trigger that removed the boilerplate, and I was able to create a world trigger containing the original (unmodified) text, and have both of them work -- the text was shortened, and any automatic reactions I wanted based on the changing text also worked.

I'm using the master substitution trigger right in the world in this case, however. Is there any way I can get this to work, or should I just export the substitution out to a plugin?
Top

Posted by Nick Gammon   Australia  (23,133 posts)  Bio   Forum Administrator
Date Reply #1 on Wed 19 Oct 2016 07:53 PM (UTC)
Message
Both triggers should be "keep evaluating" or at least the one with the lower sequence number. Thus the low-sequence trigger can match on the original line (and let it keep evaluating) and the higher-sequence trigger can omit the line and replace it with the word "Notice" removed.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Xvordan   (29 posts)  Bio
Date Reply #2 on Wed 19 Oct 2016 08:55 PM (UTC)
Message
Strange. I swear I tried this arrangement before, but obviously I must not have. Just tried it and it did work, so thank you for indulging my newbie moment.
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.


10,985 views.

It is now over 60 days since the last post. This thread is closed.     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.