Triggering on Output.

Posted by Falgor on Sat 02 May 2020 06:48 PM — 3 posts, 14,386 views.

#0
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.
Australia Forum Administrator #1
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.
#2
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.