Register forum user name Search FAQ

Gammon Forum

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 ➜ Plugins ➜ Plugin to omit blank lines

Plugin to omit blank lines

It is now over 60 days since the last post. This thread is closed.     Refresh page


Posted by Nick Gammon   Australia  (23,133 posts)  Bio   Forum Administrator
Date Thu 10 Jul 2008 06:07 AM (UTC)
Message
Sometimes you find multiple blank lines in your MUD output, especially if you are omitting other lines from output. The simple plugin below will omit all blank lines from your output window.

For this to work you need to go to the File menu -> Global Preferences -> General and make sure that "Regular expressions can match on an empty string" is checked.


To use, copy from between the lines below, save as Omit_Blank_Lines.xml in your MUSHclient -> Worlds -> Plugins folder, and then use the File menu -> Plugins to install it.



<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE muclient>
<!-- Saved on Monday, July 07, 2008, 1:07 PM -->
<!-- MuClient version 4.31 -->

<!-- Plugin "Omit_Blank_Lines" generated by Plugin Wizard -->

<muclient>
<plugin
   name="Omit_Blank_Lines"
   author="Nick Gammon"
   id="87a0ec3649ab9a04d5ea618d"
   language="Lua"
   purpose="Omits blank lines from output"
   date_written="2008-07-07 13:06:47"
   requires="4.00"
   version="1.0"
   >
<description trim="y">
<![CDATA[
Omits completely empty lines from output.
]]>
</description>

</plugin>


<!--  Triggers  -->

<triggers>
  <trigger
   enabled="y"
   match="^$"
   omit_from_output="y"
   regexp="y"
   sequence="100"
  >
  </trigger>
</triggers>

</muclient>



- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Artel   USA  (65 posts)  Bio
Date Reply #1 on Sun 05 Oct 2008 05:32 PM (UTC)

Amended on Sun 05 Oct 2008 06:49 PM (UTC) by Artel

Message
Is there a way to adapt this to only omit a line if it is part of a sequence of multiple blank lines?

i.e., if I receive \n\n, one of the blank lines should be omitted so that only \n remains. If I receive a single \n though, nothing should be omitted.

Artel.
Top

Posted by Artel   USA  (65 posts)  Bio
Date Reply #2 on Fri 10 Oct 2008 11:01 PM (UTC)
Message
I figured out what I was trying to do. Here is the resulting plugin:



<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE muclient>
<!-- Saved on Friday, October 10, 2008, 3:56 PM -->
<!-- MuClient version 4.37 -->

<!-- Plugin "OmitExtraBlankLines" generated by Plugin Wizard -->

<muclient>
<plugin
   name="OmitExtraBlankLines"
   author="Artel"
   id="62cda216f28bf192128a16a0"
   language="Lua"
   purpose="Omits extraneous blank lines from output."
   date_written="2008-10-10 15:51:00"
   requires="4.00"
   version="1.0"
   >
<description trim="y">
<![CDATA[
Reduces subsequent blank lines to a single blank line.
]]>
</description>

</plugin>

<!--  Triggers  -->

<triggers>
  <trigger
   enabled="y"
   match="^$"
   name="blank_line_two"
   omit_from_log="y"
   omit_from_output="y"
   regexp="y"
   sequence="75"
  >
  </trigger>
  <trigger
   enabled="y"
   match="^.+$"
   name="blank_line_three"
   regexp="y"
   send_to="12"
   sequence="100"
  >
  <send>EnableTrigger("blank_line_two", false)
EnableTrigger("blank_line_three", false)</send>
  </trigger>
  <trigger
   enabled="y"
   group="BlankLines"
   match="^$"
   name="blank_line_one"
   regexp="y"
   send_to="12"
   sequence="100"
  >
  <send>EnableTrigger("blank_line_two", true)
EnableTrigger("blank_line_three", true)</send>
  </trigger>
</triggers>

</muclient>

Artel.
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.


19,730 views.

It is now over 60 days since the last post. This thread is closed.     Refresh page

Go to topic:           Search the forum


[Go to top] top

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.