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

Gammon Software Solutions forum

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

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  Bug reports
. . -> [Subject]  noting in omitted send to script calls OnPluginScreendraw twice

Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?

noting in omitted send to script calls OnPluginScreendraw twice

[Reply to this subject]  Reply to this subject   [New subject]  Start a new subject   [Refresh] Refresh page


Posted by Tspivey   Canada  (50 posts)  [Biography] bio
Date Thu 20 Jan 2011 11:59 PM (UTC)  quote  ]
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.
[Go to top] top

Posted by Nick Gammon   Australia  (18,772 posts)  [Biography] bio   Forum Administrator
Date Reply #1 on Fri 21 Jan 2011 01:20 AM (UTC)  quote  ]
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
[Go to top] top

Posted by Tspivey   Canada  (50 posts)  [Biography] bio
Date Reply #2 on Fri 21 Jan 2011 01:46 AM (UTC)  quote  ]
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:

1:note
1:note


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

Posted by Nick Gammon   Australia  (18,772 posts)  [Biography] bio   Forum Administrator
Date Reply #3 on Fri 21 Jan 2011 02:48 AM (UTC)  quote  ]
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
[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.


868 views.

[Reply to this subject]  Reply to this subject   [New subject]  Start a new subject   [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

[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]    [Internet Contents Rating Association (ICRA) - 2K]    [Web site powered by FutureQuest.Net]