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.
Entire forum
➜ MUSHclient
➜ Bug reports
➜ noting in omitted send to script calls OnPluginScreendraw twice
noting in omitted send to script calls OnPluginScreendraw twice
|
Posting of new messages is disabled at present.
Refresh page
Posted by
| Tspivey
Canada (54 posts) Bio
|
Date
| Thu 20 Jan 2011 11:59 PM (UTC) |
Message
| Using this trigger, OnPluginScreendraw is called with two notes:
<triggers>
<trigger
enabled="y"
match="test"
omit_from_output="y"
send_to="12"
sequence="100"
>
<send>Note("note")</send>
</trigger>
</triggers>
I was expecting OnPluginScreendraw to only be called with the one note. Sending to
script after omit, or using a script function with send to world works as expected.
Using MUSHclient 4.71. | Top |
|
Posted by
| Nick Gammon
Australia (23,122 posts) Bio
Forum Administrator |
Date
| Reply #1 on Fri 21 Jan 2011 01:20 AM (UTC) |
Message
| Testing that trigger for me only gives one speaking of the text, not two. Perhaps you have another trigger that also notes that particular line? Try enabling Trace mode (Ctrl+Alt+T) and seeing if more than one trigger matches. |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | Top |
|
Posted by
| Tspivey
Canada (54 posts) Bio
|
Date
| Reply #2 on Fri 21 Jan 2011 01:46 AM (UTC) |
Message
| I created a completely empty world, and put that trigger in it along with
a test plugin for OnPluginScreendraw with this function:
function OnPluginScreendraw(t, log, line)
AppendToNotepad("screendraw", t..":"..line.."\r\n")
end
When I use Debug simulated world input to trigger on the test line, I get the following in the notepad window:
The trace output (which doesn't seem very useful) shows:
TRACE: Trace onTRACE: Executing Plugin screendraw_test script
"OnPluginScreendraw"
TRACE: Matched trigger "test"TRACE: Executing Plugin screendraw_test
scriptTRACE: Executing Plugin screendraw_test script "OnPluginScreendraw"
"OnPluginScreendraw"TRACE: Executing Plugin screendraw_test script
"OnPluginScreendraw"
noteTRACE: Executing Plugin screendraw_test script "OnPluginScreendraw"TRACE:
Executing Plugin screendraw_test script "OnPluginScreendraw"
TRACE: Trace offTRACE: Executing Plugin screendraw_test script
"OnPluginScreendraw"
| Top |
|
Posted by
| Nick Gammon
Australia (23,122 posts) Bio
Forum Administrator |
Date
| Reply #3 on Fri 21 Jan 2011 02:48 AM (UTC) |
Message
| OK, I can reproduce that, thanks.
This is a new side-effect of the new feature where note lines combined with "omit from output" are not omitted like they once were.
What is happening is:
- You note the word "note"
- OnPluginScreendraw is called which speaks the line
- The line is omitted from output
- As part of omitting the line, all notes and user input are saved in a special list
- Output is now deleted from the start of the current output line to the end of the buffer
- The special list is then traversed and the saved notes are put back by noting them to the output window
- OnPluginScreendraw is called again because the line is noted again, which speaks the line a second time
I'm not sure there is a really easy way of fixing it. Probably you are best off using the known work-around, of using "script after omit" or a script function in the script file. |
- 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.
12,651 views.
Posting of new messages is disabled at present.
Refresh page
top