Send to script after omit

Posted by Myrk on Mon 28 Jul 2014 04:28 AM — 4 posts, 17,573 views.

#0
Hi,

Is there a way to detect if the line was omitted (by a different trigger) in a send to script after omit trigger?

Thanks :)
Australia Forum Administrator #1
Providing the other trigger(s) haven't added to the output buffer this should work:

  • Find what the trigger matched on
  • Find what the last line in the output buffer is


If they are not the same, we presume that line was omitted.

Example:


<triggers>
  <trigger
   enabled="y"
   match="Exits: *"
   name="myname"
   omit_from_output="y"
   send_to="14"
   sequence="100"
  >
  <send>

matched = GetTriggerInfo ("myname", 32)  -- what we matched on
lastLine = GetLineInfo (GetLinesInBufferCount (), 1)  -- last line in buffer

if matched ~= lastLine then
  print "Last line was omitted"
end -- if

</send>
  </trigger>
</triggers>


Template:pasting
For advice on how to copy the above, and paste it into MUSHclient, please see Pasting XML.
#2
Great idea, thanks for the fast reply :)
Australia Forum Administrator #3
My reply may not work for long lines (ones that wrap) as the last line in the output buffer is a single line after wrapping. So for example if the output was two lines long the last line will be the second one. You can work around that by finding where the previous line ends and then working forwards. However for short lines my solution should be OK.