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, 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 ➜ Trigger trouble...?

Trigger trouble...?

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


Posted by JayD   (2 posts)  Bio
Date Thu 05 Dec 2002 02:28 PM (UTC)
Message
I'm sure I'm missing something extraordinarily simple here, but I can't figure out for the life of me what is wrong. I've got a few triggers that should in theory fire off repeatedly until a certain condition is met, then quit, but it seems that the trigger will only fire once, then stop. The trigger I'm trying to use right now is fairly simple, it should react to the text "A stone is filled with power." echoing back "cast recharge stone". This seems simple, except that it does it once, reacting to the initial instance of "A stone is filled with power." but not the subsequent instance. What am I missing?

TIA
Top

Posted by Nick Gammon   Australia  (23,165 posts)  Bio   Forum Administrator
Date Reply #1 on Thu 05 Dec 2002 08:11 PM (UTC)
Message
Can you paste the exact trigger here? Find it in your trigger list and click on the "copy" button, and then paste it into a message.

Also, copy and paste from the output window an example of when it matches, and when it doesn't.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by JayD   (2 posts)  Bio
Date Reply #2 on Thu 05 Dec 2002 08:46 PM (UTC)
Message
Here is the trigger that I'm working with presently:

<triggers>
<trigger
enabled="y"
match="A sparkling mana stone glows as you store mana in it."
sequence="100"
>
<send>cast recharge sparkling</send>
</trigger>
</triggers>

Here is me trying to use it:

c recharge spark
A sparkling mana stone glows as you store mana in it.
cast recharge sparkling

[100%|96%|100%] A sparkling mana stone glows as you store mana in it.

It can be noted that just a moment ago it seemed to be working, but has stopped working just as quickly as it had started.
Top

Posted by Sleeve   (31 posts)  Bio
Date Reply #3 on Fri 06 Dec 2002 12:02 AM (UTC)
Message
Are you sure that you don't have a ^ before "A sparkling mana stone glows as you store mana in it." It seems to me that since in your first example, the trigger fired when "A sparkling mana stone glows as you store mana in it." was on it's own line, but when it showed up on the same line as your prompt, it didn't fire.
Top

Posted by Shadowfyr   USA  (1,791 posts)  Bio
Date Reply #4 on Fri 06 Dec 2002 02:35 AM (UTC)

Amended on Fri 06 Dec 2002 02:37 AM (UTC) by Shadowfyr

Message
Actually Sleeve's suggesting is right on the money, though not entirely accurate. Triggers use two forms, standard and regular expressions. They differ thus:

normal>
A happy smile. - Matches
[10%|20%|10%] A happy smile. - Fails

regexp>
A happy smile. - Matches
[10%|20%|10%] A happy smile. - Matches

This is do to the fact that normal triggers assume that the input 'starts' at the beginning of the line. Your second line fails because the string you are matching is no longer the first thing on the line.

You can fix this the easy way, or a slightly more complex, but more accurate way. The easy way would be to add * to the start of the text you are going to match like:

*A sparkling mana stone glows as you store mana in it.

This will work, but will match on 'any' case where is appears, including if someone gets smart and dumps it on channel traffic. A better solution would be to make the trigger a regular expression and make it:

^(\[.*|.*|.*\] )?A sparkling mana stone glows as you store mana in it\.

This will then match 'only' on lines like:

A sparkling mana stone glows as you store mana in it.
[100%|96%|100%] A sparkling mana stone glows as you store mana in it.

but not in lines which you don't want like:

Fred tells you: A sparkling mana stone glows as you store mana in it.

Thus the proper replacement would be:
<triggers>
  <trigger
  enabled="y"
  match="^(\[.*|.*|.*\] )?A sparkling mana stone glows as you store mana in it\."
  sequence="100"
  regexp="y"
  >
  <send>cast recharge sparkling</send>
</trigger>
</triggers>
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.


17,334 views.

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

Go to topic:           Search the forum


[Go to top] top

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.