Total newbie, trigger question

Share your scripts and packages with other Mudlet users.
Post Reply
professororange
Posts: 2
Joined: Tue Jul 28, 2015 8:59 pm

Total newbie, trigger question

Post by professororange »

Probably the most common trigger that I used in zmud is for groups, and I have no idea how to make it here. I want a basic trigger that makes it so that when another player tells the group to attack a target, my character does so.

EXAMPLE:

Annie tells the group 'whack wolfman'

kill wolfman

How do I translate that into the proper syntax for mudlet, with the name of the player and the name of the mob as wildcards?

User avatar
demonnic
Posts: 884
Joined: Sat Dec 05, 2009 3:19 pm

Re: Total newbie, trigger question

Post by demonnic »

trigger type would be regex, pattern would be:

^\w+ tells the group 'whack (\w+)'$

and the code would be

send("kill " .. matches[2])

Silvine
Posts: 142
Joined: Sat Oct 23, 2010 2:36 pm

Re: Total newbie, trigger question

Post by Silvine »

matches[3] I think.
Mapper of Bedlam

tarkenton
Posts: 30
Joined: Thu Feb 07, 2013 7:33 am

Re: Total newbie, trigger question

Post by tarkenton »

Nah, matches[2]. The first w is non capturing due to a lack of parentheses.

User avatar
demonnic
Posts: 884
Joined: Sat Dec 05, 2009 3:19 pm

Re: Total newbie, trigger question

Post by demonnic »

What tarkenton said. They didn't specify they wanted to hold on to the person sending the message, just that it should be a wildcard.

Silvine
Posts: 142
Joined: Sat Oct 23, 2010 2:36 pm

Re: Total newbie, trigger question

Post by Silvine »

Well I never knew that about the brackets! Every day a school day :)
Mapper of Bedlam

Post Reply