[Home] [Downloads] [Search] [Help/forum]

Gammon Forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  General
. . -> [Subject]  Setting variables in Triggers
Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?
(New message)
Subject: Setting variables in Triggers
Name:
Your forum user name.
Register forum user name
Password:
Your forum password.
Forgotten password?
Message:
Message to be posted (in English, please)
Maximum of 6000 characters. Text only please, no HTML.
Forum codes:
Check this if your message uses 'forum codes' or templates (auto-detected for new posts).
Forum codes Templates

Save this message ...


Subject review (reverse sequence)

Posted by Nick Gammon   Australia  (19,675 posts)  [Biography] bio   Forum Administrator
Date Sat 02 Jul 2011 09:09 AM (UTC)  quote  ]
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
[Go to top] top

Posted by Calicoxx   (14 posts)  [Biography] bio
Date Sat 02 Jul 2011 08:51 AM (UTC)  quote  ]
Message
I would like it to work for anyone who says it.
[Go to top] top

Posted by Nick Gammon   Australia  (19,675 posts)  [Biography] bio   Forum Administrator
Date Sat 02 Jul 2011 08:42 AM (UTC)  quote  ]
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
[Go to top] top

Posted by Calicoxx   (14 posts)  [Biography] bio
Date Sat 02 Jul 2011 08:37 AM (UTC)  quote  ]
Message
Thanks Gammon! Works like a charm! :)
[Go to top] top

Posted by Calicoxx   (14 posts)  [Biography] bio
Date Sat 02 Jul 2011 08:20 AM (UTC)  quote  ]
Message
Removed the regexp, still doesn't fire off.
Example: Vajen says, 'uub bless'
[Go to top] top

Posted by Nick Gammon   Australia  (19,675 posts)  [Biography] bio   Forum Administrator
Date Sat 02 Jul 2011 08:18 AM (UTC)  quote  ]
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
[Go to top] top

Posted by Nick Gammon   Australia  (19,675 posts)  [Biography] bio   Forum Administrator
Date Sat 02 Jul 2011 08:18 AM (UTC)  quote  ]
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
[Go to top] top

Posted by Twisol   USA  (2,257 posts)  [Biography] bio
Date Sat 02 Jul 2011 08:16 AM (UTC)  quote  ]

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
[Go to top] top

Posted by Calicoxx   (14 posts)  [Biography] bio
Date Sat 02 Jul 2011 08:14 AM (UTC)  quote  ]
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.
[Go to top] 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.


2,580 views.

It is now over 60 days since the last post. This thread is closed.   [New subject]  Start a new subject   [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

[Home]

Written by Nick Gammon - 5K

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( http://www.gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Web site powered by FutureQuest.Net]