[Home] [Downloads] [Search] [Help/forum]

Gammon Forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  General
. . -> [Subject]  Trigger Recursion How-To
Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?

Trigger Recursion How-To

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


Posted by Xvordan   (25 posts)  [Biography] 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?
[Go to top] top

Posted by Nick Gammon   Australia  (21,324 posts)  [Biography] 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
[Go to top] top

Posted by Xvordan   (25 posts)  [Biography] 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.
[Go to top] 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.


1,745 views.

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

Go to topic:           Search the forum


[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

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

[Home]


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( https://gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Hosted at FutureQuest]