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 ➜ Triggering on Output.

Triggering on Output.

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


Posted by Falgor   (36 posts)  Bio
Date Sat 02 May 2020 06:48 PM (UTC)
Message
I must be missing something simple here.

Is it possible to trigger on an Output. Lets say for example.



<triggers>
  <trigger
   enabled="y"
   match="The tower of London"
   send_to="2"
   sequence="100"
  >
  <send>Location: London</send>
  </trigger>
</triggers>

<triggers>
  <trigger
   enabled="y"
   match="Location: (.+)$"
   regexp="y"
   send_to="9"
   sequence="100"
   variable="Location"
  >
  <send>%1</send>
  </trigger>
</triggers>



I know the example doesn't make logical sense, it's just a medium to explain my question a little.

Thanks,

Falg.
Top

Posted by Nick Gammon   Australia  (23,133 posts)  Bio   Forum Administrator
Date Reply #1 on Sat 02 May 2020 08:56 PM (UTC)
Message
See: http://gammon.com.au/scripts/doc.php?general=plugin_callbacks

You can make a plugin have a OnPluginSent function. That detects what is being sent. You could then use an "if" test or regular expression to see if it is what you want.

However triggers do not, per se, fire on what is being sent.

- Nick Gammon

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

Posted by Falgor   (36 posts)  Bio
Date Reply #2 on Sat 02 May 2020 09:23 PM (UTC)
Message
PlugIn Callback is exactly what I need.

I'm trying, where possible, to not have my Plugins sending variables to each other all over the place - gets hard to track.

This does the job.

You code works perfectly by the way, there was really no need - the first solution was fine!

I do appreciate the attention to detail you put into this place.
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,284 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.