Gammon Forum
Entire forum
MUSHclient
General
Setting variables in Triggers
Setting variables in Triggers
|
It is now over 60 days since the last post. This thread is closed.
  Refresh page
Posted by
| Calicoxx
(14 posts) bio
|
Date
| Sat 02 Jul 2011 08:14 AM (UTC) |
Message
| Hey, I need some help in setting up a trigger that includes variables, which I'm not too great at.
<triggers>
<trigger
enabled="y"
expand_variables="y"
match="@target *uub*bless*"
regexp="y"
sequence="100"
>
<send>foc 'bless' @target</send>
</trigger>
</triggers>
I used that, which I copied from the FAQ and edited to work in my MUD. I copied it using the copy key on the trigger menu.
What I'm trying to do is make it so when any target says my name and bless, it will target them and bless them. It seemed fairly simple, but I am having a very hard time getting it to work. It doesn't fire at all, and I'm not handy with triggers like this, so I was wondering if someone here could take a look at it and diagnose my problem. | top |
|
Posted by
| Twisol
USA (2,257 posts) bio
|
Date
| Reply #1 on Sat 02 Jul 2011 08:16 AM (UTC) Amended on Sat 02 Jul 2011 08:17 AM (UTC) by Twisol
|
Message
| Could you please paste an example of the line you're trying to trigger on from the MUD?
[EDIT]: Oh, wait. You should probably remove the regexp="y" ("Regular expression" option in the trigger dialog). That pattern there doesn't appear to be a regular expression. |
'Soludra' on Achaea
Blog: http://jonathan.com/
GitHub: http://github.com/Twisol | top |
|
Posted by
| Nick Gammon
Australia (22,975 posts) bio
Forum Administrator |
Date
| Reply #2 on Sat 02 Jul 2011 08:18 AM (UTC) |
Message
| This doesn't look like a regular expression to me:
match="@target *uub*bless*"
|
Regular expressions
- Regular expressions (as used in triggers and aliases) are documented on the Regular expression tips forum page.
- Also see how Lua string matching patterns work, as documented on the Lua string.find page.
|
|
- Nick Gammon
www.gammon.com.au, www.mushclient.com | top |
|
Posted by
| Nick Gammon
Australia (22,975 posts) bio
Forum Administrator |
Date
| Reply #3 on Sat 02 Jul 2011 08:18 AM (UTC) |
Message
|
Twisol said:
Oh, wait. You should probably remove the regexp="y" ("Regular expression" option in the trigger dialog).
What he said. |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | top |
|
Posted by
| Calicoxx
(14 posts) bio
|
Date
| Reply #4 on Sat 02 Jul 2011 08:20 AM (UTC) |
Message
| Removed the regexp, still doesn't fire off.
Example: Vajen says, 'uub bless'
| top |
|
Posted by
| Calicoxx
(14 posts) bio
|
Date
| Reply #5 on Sat 02 Jul 2011 08:37 AM (UTC) |
Message
| Thanks Gammon! Works like a charm! :) | top |
|
Posted by
| Nick Gammon
Australia (22,975 posts) bio
Forum Administrator |
Date
| Reply #6 on Sat 02 Jul 2011 08:42 AM (UTC) |
Message
| What is the "target" variable set to? Or do you want it to work for anyone who says it? |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | top |
|
Posted by
| Calicoxx
(14 posts) bio
|
Date
| Reply #7 on Sat 02 Jul 2011 08:51 AM (UTC) |
Message
| I would like it to work for anyone who says it. | top |
|
Posted by
| Nick Gammon
Australia (22,975 posts) bio
Forum Administrator |
Date
| Reply #8 on Sat 02 Jul 2011 09:09 AM (UTC) |
Message
| You want something more like this then:
<triggers>
<trigger
enabled="y"
match="* says, 'uub bless'"
sequence="100"
>
<send>foc 'bless' %1</send>
</trigger>
</triggers>
|
For advice on how to copy the above, and paste it into MUSHclient, please see Pasting XML.
|
|
- 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.
24,248 views.
It is now over 60 days since the last post. This thread is closed.
  Refresh page
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.