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

Gammon Software Solutions forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  General
. . -> [Subject]  Multiple line triggers

Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?

Multiple line triggers

[Reply to this subject]  Reply to this subject   [New subject]  Start a new subject   [Refresh] Refresh page


Posted by Demokis   USA  (8 posts)  [Biography] bio
Date Mon 12 Mar 2001 07:51 PM (UTC)  quote  ]
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  (18,772 posts)  [Biography] bio   Forum Administrator
Date Reply #1 on Mon 12 Mar 2001 08:09 PM (UTC)  quote  ]

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)  quote  ]
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  (18,772 posts)  [Biography] bio   Forum Administrator
Date Reply #3 on Mon 12 Mar 2001 09:02 PM (UTC)  quote  ]
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)  quote  ]
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.


1,862 views.

[Reply to this subject]  Reply to this subject   [New subject]  Start a new subject   [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

[Home]

Written by Nick Gammon - 5K

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( http://www.gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Internet Contents Rating Association (ICRA) - 2K]    [Web site powered by FutureQuest.Net]