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

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: 556
Joined: Sat Dec 05, 2009 3:19 pm

Re: Total newbie, trigger question

Post by demonnic » Wed Jul 29, 2015 2:34 pm

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 » Wed Jul 29, 2015 5:24 pm

matches[3] I think.
Mapper of Bedlam

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

Re: Total newbie, trigger question

Post by tarkenton » Wed Jul 29, 2015 6:12 pm

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

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

Re: Total newbie, trigger question

Post by demonnic » Wed Jul 29, 2015 6:33 pm

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 » Wed Jul 29, 2015 8:04 pm

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

Post Reply

Who is online

Users browsing this forum: No registered users and 11 guests