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


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, 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.
[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  General
. . -> [Subject]  Multiple line triggers

Multiple line triggers

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


Posted by Demokis   USA  (8 posts)  [Biography] bio
Date Mon 12 Mar 2001 07:51 PM (UTC)
Message
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?
[Go to top] top

Posted by Nick Gammon   Australia  (23,043 posts)  [Biography] bio   Forum Administrator
Date Reply #1 on Mon 12 Mar 2001 08:09 PM (UTC)

Amended on Mon 12 Mar 2001 08:11 PM (UTC) by Nick Gammon

Message
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.


- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Demokis   USA  (8 posts)  [Biography] bio
Date Reply #2 on Mon 12 Mar 2001 08:54 PM (UTC)
Message
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?
[Go to top] top

Posted by Nick Gammon   Australia  (23,043 posts)  [Biography] bio   Forum Administrator
Date Reply #3 on Mon 12 Mar 2001 09:02 PM (UTC)
Message
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.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Demokis   USA  (8 posts)  [Biography] bio
Date Reply #4 on Mon 12 Mar 2001 09:18 PM (UTC)
Message
That works perfect thank you and MUSHclient is the best client I have ever used.
[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.


15,084 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 HostDash]