Page 1 of 1

Total newbie, trigger question

Posted: Tue Jul 28, 2015 9:03 pm
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?

Re: Total newbie, trigger question

Posted: Wed Jul 29, 2015 2:34 pm
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])

Re: Total newbie, trigger question

Posted: Wed Jul 29, 2015 5:24 pm
by Silvine
matches[3] I think.

Re: Total newbie, trigger question

Posted: Wed Jul 29, 2015 6:12 pm
by tarkenton
Nah, matches[2]. The first w is non capturing due to a lack of parentheses.

Re: Total newbie, trigger question

Posted: Wed Jul 29, 2015 6:33 pm
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.

Re: Total newbie, trigger question

Posted: Wed Jul 29, 2015 8:04 pm
by Silvine
Well I never knew that about the brackets! Every day a school day :)