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 ➜ MUDs ➜ General ➜ Targeting Trigger

Targeting Trigger

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


Posted by Eldeon   (9 posts)  Bio
Date Sat 12 Jun 2010 02:30 AM (UTC)
Message
Hello I have this trigger here:

A * walks *.

Which sends:

%2
kill %1

and this works fine for a creature that walks out of the room. Because this means I follow it where ever it goes and then kill it. However it doesn't work if the input reads:

A minotaur walks in.

Because then it sends the command (in) to the world and that checks my inventory. My question is thus. Is there a way to make a check where the trigger checks to see if the direction that the creature walks is in or not and then if it is in just kill the creature without sending the command (in) to the the world?

What I am trying to achieve is that I'm sitting in an arena. Creatures come and go. I want to kill anything that comes into the room and then follow anything that moves out of the room so I'm not stuck waiting in the same room and kill it.

Also I have a pet that follows me and activates this trigger which sends to the world to kill the pet which I don't want to do. Is there a way to add an exception to the trigger where I don't kill the pet?

On a slightly related topic. I am trying to create a trigger for when i'm killing something and it flees. Although I want it to activate when two separate lines are met.

A minotaur walks (or runs) west.
A minotaur has fled!

I want to match this up and then follow the minotaur and send a command to kill, kick, ect. to the minotaur. I don't know if you can match a trigger to a multi line but if there is a way to do so please tell me.

Thank you in advance.

Top

Posted by Chicomecoatl   USA  (25 posts)  Bio
Date Reply #1 on Sat 12 Jun 2010 10:18 PM (UTC)

Amended on Sat 12 Jun 2010 10:20 PM (UTC) by Chicomecoatl

Message

<triggers>
<trigger
 name="auto_attack"
 match="A (.*) walks (east|south|north|west|up|down)\."
 regexp="y"
 ignore_case="y"
 send_to="12"
 sequence="100"
 >
<send>
pet=GetVariable("pet")
if ("%2" ~= pet) then
 Send("%2")
 Send("kill %1")
end
</send>
</trigger>
</triggers>


Should work :)
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,941 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.