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


Register forum user name Search FAQ

Gammon Forum

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  General
. . -> [Subject]  Blank line alias

Blank line alias

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


Posted by JSteele1234   USA  (27 posts)  [Biography] bio
Date Wed 18 Jun 2003 04:44 PM (UTC)
Message
I can't seem to find a way for an alias to stop a blank line from being sent. My only alias is *, which I would hope would match everything that's ever typed in, but it doesn't match on a blank line. ^$ looks like it would work, but it doesn't either. I don't know a whole lot about regular expressions, could there be a better one that will work?

~ JSteele1234 ~
[Go to top] top

Posted by Magnum   Canada  (580 posts)  [Biography] bio
Date Reply #1 on Wed 18 Jun 2003 08:11 PM (UTC)
Message
Try:

Click File, Global Preferences, General (tab), and check the box [ ] Regular expressions can match on an empty string

Get my plugins here: http://www.magnumsworld.com/muds/

Constantly proving I don't know what I am doing...
Magnum.
[Go to top] top

Posted by JSteele1234   USA  (27 posts)  [Biography] bio
Date Reply #2 on Thu 19 Jun 2003 02:48 AM (UTC)

Amended on Thu 19 Jun 2003 02:54 AM (UTC) by JSteele1234

Message
It's not working.

Here's my alias for catching the blank line.
http://jsteele1234.shacknet.nu/EditAlias.jpg

But it's not even calling the script function.

~ JSteele1234 ~
[Go to top] top

Posted by Nick Gammon   Australia  (22,990 posts)  [Biography] bio   Forum Administrator
Date Reply #3 on Thu 19 Jun 2003 07:10 AM (UTC)
Message
Take a look at the release notes for version 3.35, in particular point 13, sub-point "h" onwards.

http://www.gammon.com.au/scripts/showrelnote.php?version=3.35&productid=0

In essence, a blank line is treated as a bit of a special case, and does not go through alias processing.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by JSteele1234   USA  (27 posts)  [Biography] bio
Date Reply #4 on Thu 19 Jun 2003 07:59 AM (UTC)
Message
Well, I made a script to use in Mushclient to function as a client for a certain chat room, which uses a unique protocol. Whenever a bad command is sent to the server it automatically bans you for 24 hours, and blank lines count as a bad command. So if I ever accidentally press enter, I'm banned for the whole day.

~ JSteele1234 ~
[Go to top] top

Posted by Nick Gammon   Australia  (22,990 posts)  [Biography] bio   Forum Administrator
Date Reply #5 on Thu 19 Jun 2003 08:30 AM (UTC)
Message
Ah, I see. In that case, install this plugin, it will suppress blank lines. It uses the plugin callback OnPluginSend to detect and discard them ...


<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE muclient>
<!-- Saved on Thursday, June 19, 2003, 6:25 PM -->
<!-- MuClient version 3.42 -->

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

<muclient>
<plugin
   name="Suppress_Blank_Lines"
   author="Nick Gammon"
   id="020ea5e9855b555be70bcfe3"
   language="VBscript"
   purpose="Suppresses blank lines from being sent"
   date_written="2003-06-19 18:24:57"
   requires="3.31"
   version="1.0"
   >

</plugin>

<script>


Function OnPluginSend (sText)
  If Trim (sText) = "" Then
    OnPluginSend = vbFalse  ' discard blank lines
  Else  
    OnPluginSend = vbTrue  ' process it
  End If
End Function


</script>

</muclient>



- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Flannel   USA  (1,230 posts)  [Biography] bio
Date Reply #6 on Thu 19 Jun 2003 08:39 AM (UTC)

Amended on Thu 19 Jun 2003 08:40 AM (UTC) by Flannel

Message
Its late, so this is a bit fuzzy in my mind right now... but, possible solution would be to make a plugin, and have it automatically add a character to the line, using plugin callbacks.

[edit]

I should probably check for updates before I post... oh well.

~Flannel

Messiah of Rose
Eternity's Trials.

Clones are people two.
[Go to top] top

Posted by JSteele1234   USA  (27 posts)  [Biography] bio
Date Reply #7 on Thu 19 Jun 2003 01:29 PM (UTC)
Message
Thank you very much.

~ JSteele1234 ~
[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.


21,177 views.

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

Go to topic:           Search the forum


[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

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

[Home]


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( https://gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Hosted at HostDash]