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 problems

Trigger problems

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


Posted by Pinnacle   (1 post)  Bio
Date Tue 08 Oct 2002 12:23 PM (UTC)
Message
I tried doing a trigger with the next line as my triggered text:
You receive 23994 experience points out of a maximum of 24000.
And in my trigger configuration, I had the next line for my trigger:
You receive %1 experience points
And the text to send is:
Get all corpse
Can anyone tell me what's wrong with the above trigger?
Top

Posted by Magnum   Canada  (580 posts)  Bio
Date Reply #1 on Tue 08 Oct 2002 05:41 PM (UTC)
Message
It seems like you want to create a trigger line that matches on the line you quoted, but with any values offered, as well as the ones you show. In other words, ya need some wildcards. ...So, your trigger line should probably be something like this:

You receive * experience points out of a maximum of *.

With a line like that, %1 would reflect the first wildcard (How much exp you gained), and %2 would be the second wildcard (The maximum exp).

Get my plugins here: http://www.magnumsworld.com/muds/

Constantly proving I don't know what I am doing...
Magnum.
Top

Posted by Shadowfyr   USA  (1,791 posts)  Bio
Date Reply #2 on Tue 08 Oct 2002 06:02 PM (UTC)
Message
Like Magnum said... lol

Was trying to post my own reply here but got beaten.

In any case your confusing came from the fact that %0 - %10 are only temporary variables, not matching patterns. The reason for this is that you would have to change the rules if you used a triggers as a regular expression.

In normal triggers * means match anything in between, but in regular expressions it means only 'match one or more of what I want' and '.' means 'anything'. Thus your trigger would be described as, "starting at the beginning of the line ^ match on 'You receive ', followed by one or more of anything .*, followed by ' experience points'" or:

^You receive .* experience points

Unlike normal triggers, regular expressions match 'anywhere', unless you specifically tell them where the start or end of the lines should be with ^ and $. It is the difference between asking 'is this line an exact match' with normal triggers and 'does this line -contain- what I want' with regular expressions. You could also tell it \d* instead, which means 'match one or more numbers and only numbers'. Sometimes it is very handy to be specific about what you want and if you used the % variables in your match text, you couldn't do that without creating some confusion. ;)
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.


12,898 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.