Multiple line triggers

Posted by Demokis on Mon 12 Mar 2001 07:51 PM — 5 posts, 20,797 views.

USA #0
I have a question about the multiple line triger mathing in the 3.04 version of MushClient I've tried everything I can think of and they still don't work is there something I'm missing. All of my other triggers match on the right lines but the multiple I have doesn't work. could it be that the two lines I'm trying to match are different colors?


ex. I have a trigger I have been trying to make work that when I kill something it has the following.
A duergar is dead!!!
You recieve 200 experience points.

now what I am trying to match is the name of the mob and the experience I got from it like this

* is dead!!!
You recieve * experience points.

gtell I killed %1 for %2 experience.

the first line is usually red and the second multicolored would that affect or am I even using it right?
Australia Forum Administrator #1
Ah yes, your problem here is that triggers match one line, and thus there is no such thing as a multi-line trigger. :(

However, you can easily achieve the same end result by using two triggers, and a bit of scripting.

First trigger

Match on: * is dead!!!
Send: (nothing)
Enabled: checked
Label: dead_label
Script: OnDead

Add the following to the script file:



sub OnDead (strTriggerName, trig_line, arrWildCards)
  world.setvariable  "lastdeath", arrWildcards (1)
End Sub



What this will do is "remember" the name of the thing that was just killed in the variable "lastdeath".

Second trigger

Match on: You receive * experience points.
Send: gtell I killed @lastdeath for %1 experience.
Enabled: checked
Expand variables: checked

What this does is send your message, using the variable "lastdeath" and the wildcard %1 being the number of points.

Amended on Mon 12 Mar 2001 08:11 PM by Nick Gammon
USA #2
Ok, this may just be a problem with my scripting but it isn't caling the script on trigger am I doing something wrong again?
Australia Forum Administrator #3
You need to enable scripting.

Go into configuration -> Scripting -> Scripts

Make sure the script language is VBscript, check "Enable script", make sure the "Script file" is your script file, and then it should work.
USA #4
That works perfect thank you and MUSHclient is the best client I have ever used.