[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.
 Entire forum ➜ MUSHclient ➜ General ➜ Auto-rescue

Auto-rescue

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


Posted by Pagkh   (6 posts)  Bio
Date Sun 18 Mar 2001 02:01 AM (UTC)
Message
How can I make an auto-rescue trigger that will rescue _____ whenever any mob attacks him/her? (This way, I won't have to alter the trigger depending on the mob. Rather, I will rescue _____ from any mob that attacks him/her.)
Top

Posted by Nick Gammon   Australia  (23,046 posts)  Bio   Forum Administrator
Date Reply #1 on Sun 18 Mar 2001 02:13 AM (UTC)
Message
Can you give an example of the sort of thing you see?

However the general answer is simply to use a wildcard.

eg.


Match on: * attacks you!


The asterisk will match on any mob name.

- Nick Gammon

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

Posted by Pagkh   (6 posts)  Bio
Date Reply #2 on Sun 18 Mar 2001 10:34 AM (UTC)
Message
For the sake of simplicity, I will use the name Nick.

Say Nick and I are standing at Temple Square together. Suddenly, an aggro mob arrives from the west and attacks Nick. Because I have not implemented a trigger that rescues Nick from that mob, Nick dies.

What I want to implement is a trigger that will rescue Nick from any mob that attacks him - one which will react to him being attacked, regardless of the mob's name.

I understand the example that you supplied. But on the mud I play, how hard a mob hits a player varies.

Here is [part of ] a log from the mud I play...

POV: tank

Pickle slashes Shax'in, the brown dragon hard.
Pickle slashes Shax'in, the brown dragon hard.
Shax'in, the brown dragon scrambles to his feet!
Shax'in, the brown dragon claws you very hard.
Shax'in, the brown dragon tries to claw at you but misses by a hair!
Shax'in, the brown dragon claws you very hard.
Shax'in, the brown dragon claws you extremely hard.
Shax'in, the brown dragon massacres Pickle to small fragments with his claw.
You slash Shax'in, the brown dragon hard.
You slash Shax'in, the brown dragon hard.
Farius slashes Shax'in, the brown dragon.
Farius slashes Shax'in, the brown dragon.
Vargus slashes Shax'in, the brown dragon very hard.
Vargus cools Shax'in, the brown dragon with the breeze of his missed slash.

Shax'in, the brown dragon OBLITERATES Pickle with his deadly claw!!
Shax'in, the brown dragon tries to claw at Pickle, missing by a hair!
Shax'in, the brown dragon massacres Pickle to small fragments with his claw.
Shax'in, the brown dragon OBLITERATES Pickle with his deadly claw!!
Shax'in, the brown dragon massacres Pickle to small fragments with his claw.
Pickle slashes Shax'in, the brown dragon hard.
Pickle slashes Shax'in, the brown dragon hard.
You slash Shax'in, the brown dragon hard.
You slash Shax'in, the brown dragon hard.
You slash Shax'in, the brown dragon hard.
Farius cools Shax'in, the brown dragon with the breeze of her missed slash.
Farius slashes Shax'in, the brown dragon.
Farius slashes Shax'in, the brown dragon.
Vargus slashes Shax'in, the brown dragon hard.
Shax'in, the brown dragon nimbly avoids Vargus's slash.

Obviously, Pickle is not the tank. Rather, the mob switched to him. Here, Shax'in obliterates, massacres, and misses a blow at Pickle. The answer which you supplied would not suffice in a battle such as this.

Basically, what I am looking for is a trigger that will react to a mob switching to another player, and that will will rescue that player instantly.
Top

Posted by Nick Gammon   Australia  (23,046 posts)  Bio   Forum Administrator
Date Reply #3 on Sun 18 Mar 2001 02:23 PM (UTC)

Amended on Sun 18 Mar 2001 02:24 PM (UTC) by Nick Gammon

Message
This is an interesting challenge. You can almost do it with a regular expression, here is my first attempt:


Match on: (?U)^(?!You)(.*) (OBLITERATES|tries to claw at|massacres|slashes|cools|claws) (?!you)(.*) (.*)$


What this is doing is:


(?U)    - makes the matching "un-greedy"
^       - start of line
(?!You) - anything except "You"
(.*)    - what is doing the attacking
(OBLITERATES|tries to claw at|massacres|slashes|cools|claws) 
        - all the possible ways of attacking (not complete)
(?!you)(.*) - attacking everyone except you
(.*)    - rest of line (eg. "hard" "to fragments")
$       - end of line



You can then:


Send: rescue %3


However there is a problem with this - if Pickle attacks the dragon, the trigger matches and you try to rescue the dragon!

The only way I can think of around this, is to name all the members of your party, like this:


Match on: (?U)^(.*) (OBLITERATES|tries to claw at|massacres|slashes|cools|claws) (Pickle|Nick|Varius|Vargus) (.*)$


This will then match on any attack on members of your party. Of course, you don't name yourself in the list, and thus you don't try to rescue yourself.



- Nick Gammon

www.gammon.com.au, www.mushclient.com
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,102 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

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]