Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, 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.
Due to spam on this forum, all posts now need moderator approval.
Entire forum
➜ MUSHclient
➜ General
➜ Two Triggers on the Same Line?
Two Triggers on the Same Line?
|
It is now over 60 days since the last post. This thread is closed.
Refresh page
Posted by
| Noredil
(4 posts) Bio
|
Date
| Thu 14 Feb 2008 06:56 AM (UTC) |
Message
| I've noticed after pulling my hair out a bit, that the reason some of my triggers won't fire, is that there are sometimes multiple triggers trying to fire on the same line. For example, I have the following two:
<trigger
enabled="y"
match="A nearly invisible magical shield forms around (.*)$"
custom_colour="9"
regexp="y"
script="mob_shield"
sequence="102"
>
</trigger>
<trigger
enabled="y"
expand_variables="y"
custom_colour="17"
group="colors"
ignore_case="y"
match="\b(@!target)\b"
regexp="y"
sequence="102"
script="targ_check"
other_text_colour="black"
other_back_colour="gold"
>
</trigger>
These two will not play nice together. I've tried playing around with the sequence number, but it seems like no matter what, the first trigger overrides the second (these are actually in two different XML files called by a main XML file)
For example, I put Note commands in the functions to see which of them were firing on these two examples... as you see, the first example, only the first trigger fires. In the second example, the second trigger does fire, suggesting it should have fired on the first line as well.
You say in Mhaldorian, "A nearly invisible magical shield forms around a mhun guy."
shield
8058h, 7310m, 29110w cexdb-
say A mhun guy
You say in Mhaldorian, "A mhun guy."
targ_check
Like I said, I've tried different combos of sequences, but that doesn't seem to be the issue here. | Top |
|
Posted by
| Onoitsu2
USA (248 posts) Bio
|
Date
| Reply #1 on Thu 14 Feb 2008 09:14 AM (UTC) Amended on Thu 14 Feb 2008 09:16 AM (UTC) by Onoitsu2
|
Message
| One trigger needs to have a lower sequence than the other.
The issue is that you need to have the lower sequence trigger have the 'keep evaluating' option set, so that once that one fires it will check the line against the rest of the triggers you have.
-Onoitsu2 | Top |
|
Posted by
| Shaun Biggs
USA (644 posts) Bio
|
Date
| Reply #2 on Thu 14 Feb 2008 03:34 PM (UTC) |
Message
| Another thing to remember is to make sure that the higher sequence triggers will be evaluated. Use the keep_evaluating tag for that.
<trigger
enabled="y"
expand_variables="y"
custom_colour="17"
group="colors"
ignore_case="y"
match="\b(@!target)\b"
regexp="y"
sequence="99"
keep_evaluating="y"
script="targ_check"
other_text_colour="black"
other_back_colour="gold"
>
</trigger>
|
It is much easier to fight for one's ideals than to live up to them. | 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.
14,076 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top