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 ➜ 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  (23,140 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*"


Template:regexp 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  (23,140 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  (23,140 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  (23,140 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>


Template:pasting 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.


28,250 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.