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
➜ Bug reports
➜ addtriggerex sets "eomitfromlog" when not in flags
addtriggerex sets "eomitfromlog" when not in flags
|
It is now over 60 days since the last post. This thread is closed.
Refresh page
Posted by
| Pompey1
(12 posts) Bio
|
Date
| Wed 19 Mar 2008 01:11 PM (UTC) |
Message
| The following javascript code snippet sets a gag trigger using a regexp stored in variable 'gag' and with a trigger name based on 'name'.
// code starts
flags = eEnabled | eOmitFromOutput | eIgnoreCase | eTriggerRegularExpression | eReplace;
n = "gag" + name.toLowerCase();
status = world.AddTriggerEx(n,gag,"",flags,-1,0,"","",0,80)
// code ends
However, if I then examine the trigger in the world, the "omit from log" checkbox is selected.
I can fix this by following the addTriggerEx with a setTriggerOption as follows:
// code starts
status = SetTriggerOption(n,"omit_from_log",0);
// code ends
but really the "omit from log" checkbox should not be checked unless I include the eOmitFromLog flag in the trigger flags.
I checked with Beale (as we play the same MUD) and he saw the same problem. I was using 4.22 but now have 4.23 and it affects both of those versions.
Is this intended behaviour ("output" is deemed to include logs) or is it a bug?
Pompey1 | Top |
|
Posted by
| Nick Gammon
Australia (23,158 posts) Bio
Forum Administrator |
Date
| Reply #1 on Wed 19 Mar 2008 09:17 PM (UTC) Amended on Wed 19 Mar 2008 09:18 PM (UTC) by Nick Gammon
|
Message
| This is a confirmed bug. In fact it was always setting "omit from log" to whatever your "omit from output" flag was (that is, true or false). It was a simple typo in that function.
This will be corrected in version 4.24, meanwhile I suggest you use your work-around.
This bug applies to all scripting languages, not just Javascript. |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | Top |
|
Posted by
| Nick Gammon
Australia (23,158 posts) Bio
Forum Administrator |
Date
| Reply #2 on Wed 19 Mar 2008 09:20 PM (UTC) |
Message
| Another approach, which might be better self-documentation anyway, is to use ImportXML. That won't have that problem, and lets you set all of the flags (some of which are not supported by AddTriggerEx), and is more readable.
http://www.gammon.com.au/scripts/doc.php?function=ImportXML
|
- 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.
13,143 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top