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
➜ Lua
➜ Overriding a trigger
It is now over 60 days since the last post. This thread is closed.
Refresh page
| Posted by
| Gore
(207 posts) Bio
|
| Date
| Wed 04 Apr 2007 04:29 AM (UTC) |
| Message
| <triggers>
<trigger
group="skills-tarot-creator"
match="^(.*?)$"
name="ignore_creator"
omit_from_log="y"
omit_from_output="y"
regexp="y"
send_to="14"
sequence="2"
>
<send>ColourNote ('dimgray', 'white', 'Creator:%1')</send>
</trigger>
<trigger
group="skills-tarot-creator"
match="(.*?)h\, (.*?)m"
name="ignore_off"
regexp="y"
send_to="14"
sequence="1"
>
<send>EnableTriggerGroup ('skills-tarot-creator', false)</send>
</trigger>
</triggers>
Can anyone tell me why when ignore_creator is enabled, the omitted lines still fire triggers from a plugin of mine?
| | Top |
|
| Posted by
| Shaun Biggs
USA (644 posts) Bio
|
| Date
| Reply #1 on Wed 04 Apr 2007 05:02 AM (UTC) |
| Message
| I'm not quite sure what you're asking about here. Could you post an example of the output from the mud that you expect triggers to fire on correctly, but they don't?
If what I'm thinking you're asking about is correct though, omitting output does not interfere with a trigger from firing. I have several triggers in various plugins that fire from the same omitted line. |
It is much easier to fight for one's ideals than to live up to them. | | Top |
|
| Posted by
| Gore
(207 posts) Bio
|
| Date
| Reply #2 on Wed 04 Apr 2007 05:10 AM (UTC) |
| Message
| | Correct, is there anyway to prevent them from firing without actually affecting them at all? | | Top |
|
| Posted by
| Shaun Biggs
USA (644 posts) Bio
|
| Date
| Reply #3 on Wed 04 Apr 2007 05:48 AM (UTC) |
| Message
| Turning them off is the only way I can think of. And you seem to be doing that with the EnableTriggerGroup call. The only thing i can suggest is to make sure that the script ends up disabling the triggers.
Another question I thought of though... Are the triggers that are tripped in the plugin in the same plugin as the triggers you posted here? If they are not in the same plugin, they will not be able to affect each other, since it's in effect a different system. You might have to shut them off with a CallPlugin call. |
It is much easier to fight for one's ideals than to live up to them. | | Top |
|
| Posted by
| Gore
(207 posts) Bio
|
| Date
| Reply #4 on Wed 04 Apr 2007 06:18 AM (UTC) |
| Message
| | No, the triggers that I don't want firing are every affliction trigger in my healing system. The trigger that I had hoped would override it was the (.*?) trigger heh. | | Top |
|
| Posted by
| Nick Gammon
Australia (23,173 posts) Bio
Forum Administrator |
| Date
| Reply #5 on Wed 04 Apr 2007 06:36 AM (UTC) |
| Message
| |
| Posted by
| Shaun Biggs
USA (644 posts) Bio
|
| Date
| Reply #6 on Wed 04 Apr 2007 06:59 AM (UTC) |
| Message
| Or if it's in the same plugin (or just part of a bigger plugin), just set up a quick script function to disable them one at a time or as a group if they can be clumped together. I've had plenty of weird looking scripts that just turn various triggers on and off.
function init()
EnableTrigger("qcompletecatcher", false)
EnableTrigger("notQuesting", false)
EnableTrigger("tierqpcatcher", false)
EnableTrigger("luckyqpcatcher", false)
EnableTrigger("tpcatcher", false)
EnableTrigger("mccpqpcatcher", false)
EnableTrigger("anyLine", false)
EnableTrigger("traincatcher", false)
EnableTrigger("praccatcher", false)
gains = {
["qp"] = 0,
["tp"] = 0,
["train"] = 0,
["prac"] = 0
}
end -- init
That just runs through making sure that nothing is triggered to start with aside from the initial trigger, which never gets turned off within the plugin. The whole set of triggers can with a quick command if I decide I don't want my quests tracked at all for a while. |
It is much easier to fight for one's ideals than to live up to them. | | Top |
|
| Posted by
| Nick Gammon
Australia (23,173 posts) Bio
Forum Administrator |
| Date
| Reply #7 on Wed 04 Apr 2007 07:29 AM (UTC) |
| Message
| You could probably save a bit of repetition by making a table of things you want to disable. Then the same table could be used to enable them later.
for _, name in ipairs {
"qcompletecatcher",
"notQuesting",
"tierqpcatcher",
"luckyqpcatcher",
"tpcatcher",
"mccpqpcatcher",
"anyLine",
"traincatcher",
"praccatcher",
} do EnableTrigger (name, false) end
|
- Nick Gammon
www.gammon.com.au, www.mushclient.com | | Top |
|
| Posted by
| Shaun Biggs
USA (644 posts) Bio
|
| Date
| Reply #8 on Wed 04 Apr 2007 05:29 PM (UTC) |
| Message
| | I converted that from Jscript to Lua on the first day that I was learning Lua, so I didn't know about Lua's weird little tricks about applying a whole table to a function. Also, these functions are turned on one by one laster in the script, so it's not terribly efficient to keep them clumped together. |
It is much easier to fight for one's ideals than to live up to them. | | 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.
31,233 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top