Trigger Question

Posted by SWLR Deesk on Tue 14 Nov 2006 04:22 AM — 7 posts, 23,196 views.

USA #0
Hi everyone, I'm new to MUSHclient and I'm figuring stuff out slowly but surely.

I'd like to make a trigger that searches for a certain string within a line. Specifically, every time a mob does damage to me, I want MUSHclient to input "punch" to the World.

Any ideas?
USA #1
You can use wildcards for that.
USA #2
Could you be more specific?

The actual line that I want to trigger the event would look like this:

Spartan barely scratches you. Spartan does 7 points of damage.

I basically want it so anyone attacking me, doing any amount of damage will trigger it.
Amended on Tue 14 Nov 2006 06:36 PM by SWLR Deesk
USA #3
There should be a helpfile for wildcards. Here's an example:
*does * points of damage.


There is a better way to do that, of course.
Australia Forum Administrator #4
Here is an example.


<triggers>
  <trigger
   enabled="y"
   match="* does * points of damage."
   sequence="100"
  >
  <send>punch</send>
  </trigger>
</triggers>


USA #5
This is how I would do it. So no matter how hard they hit you, it will fire on any hit.

<triggers>
<trigger
enabled="y"
match="^(.*?) (.*?) you\. (.*?) does (.*?) points of damage\.$"
regexp="y"
sequence="100"
>
<send>punch %1</send>
</trigger>
</triggers>
USA #6
Thanks for your help guys!