mIRC Homepage
Posted By: Okapia Text Length Cutoff - 25/04/09 11:28 PM
When messages are over a certain number of characters the message gets truncated. I understand this isn't the client's fault, but my issue with mirc is that it does not tell me when/if the message was truncated. It appears to go all the way through and the only way I know if the other person saw my entire message is if they tell me it looks like my message got cut off. I tested a few other irc clients and they do not do this. They put the excess text on new lines.

Perhaps my use is not typical, but I paste paragraphs into irc on a regular basis. Mirc not giving me any indication of whether or not the entirety of my message is going through is driving me crazy. It's enough to make me want to switch clients, but I'm hoping to find a way to make this work since I like mirc more overall when it comes to other features.

Is there any way to add this functionality to mirc? This isn't a default configuration setting I'm missing, is it? I would be willing to edit any files or install any scripts necessary to get this to work. I am using version 6.32 but I would be willing to switch to any version this feature works with.
Posted By: Horstl Re: Text Length Cutoff - 25/04/09 11:49 PM
First thing that comes to my mind is this script. It has a "break up lines longer than X chars" setting, besides many other settings to play with.
In fact the vast settings of this script may be it's biggest con - but then, you need to get the settings "right" only once laugh
Posted By: Okapia Re: Text Length Cutoff - 26/04/09 12:46 AM
Thank you. This appears to be exactly the kind of thing I'm looking for. Unfortunately, I can't get the "break up lines longer than X chars" option to work! The script loads without any issues, I have confirmed that the other options contained in the script are working, but the long paste lines still aren't being broken up. I tried changing the number of characters to several different values without any effect.
Posted By: RusselB Re: Text Length Cutoff - 26/04/09 03:30 AM
As a sidenote, not related to that script, but the original question, if you have your sounds enabled, mIRC will beep when a message hits the networks truncation point, and for each character above that point... or at least it does for the various networks that I have tested this on, either accidentally, or on purpose.
Posted By: genius_at_work Re: Text Length Cutoff - 26/04/09 04:41 AM
Try this script:

Code:

on *:CONNECT:.msg $me $+(MLT-,$str(º,512))
on me:^*:NICK:.msg $newnick $+(MLT-,$str(º,512))
on me:^*:TEXT:MLT-º*:?:{ set $+(%,MCL.,$cid) $len($gettok($rawmsg,3-,32)) | haltdef }
on *:DISCONNECT:unset $+(%,MCL.,$cid)
alias maxchars $iif($isid,return,echo -a Max:) $calc($iif($($+(%,MCL.,$cid),2),$ifmatch,512) - $iif($1,$len($1) - 1,0))

on *:INPUT:#:{
  if ($len($1-) < $maxchars($target)) return
  if (($inpaste) && (!$input(Warning: Line too long. $+ $crlf $+ Do you want to auto-wrap?,y))) halt
  if ((/* iswm $1) && (!$ctrlenter)) return
  var %s = 1, %t = $1-, %tt
  var %i = 0, %ii = $numtok(%t,32)
  while (%i < %ii) {
    inc %i
    if ($len($gettok(%t,$+(%s,-,%i),32)) < $maxchars($target)) {
      %tt = $gettok(%t,$+(%s,-,%i),32)
    }
    else {
      msg $target %tt
      %s = $calc(%i + 1)
    }
  }
  halt
}


You must reconnect to the network after loading the script. I only tested it a bit, but it seems to work. Let me know if there are any bugs.

-genius_at_work
Posted By: genius_at_work Re: Text Length Cutoff - 27/04/09 02:22 PM
Found a few problems, here is an updated script:

Code:

on *:CONNECT:.msg $me $+(MLT-,$str(º,512))
on me:^*:NICK:.msg $newnick $+(MLT-,$str(º,512))
on me:^*:TEXT:MLT-º*:?:{ set $+(%,MCL.,$cid) $len($gettok($rawmsg,3-,32)) | haltdef }
on *:DISCONNECT:unset $+(%,MCL.,$cid)
alias maxchars $iif($isid,return,echo -a Max:) $calc($iif($($+(%,MCL.,$cid),2),$ifmatch,512) - $iif($1,$len($1) - 1,0))

on *:INPUT:#:{
  if ($len($1-) < $maxchars($target)) return
  if (($inpaste) && (!$input(Warning: Line too long. $+ $crlf $+ Do you want to auto-wrap?,y))) halt
  if ((/* iswm $1) && (!$ctrlenter)) return
  var %s = 1, %t = $1-, %tt
  var %i = 0, %ii = $numtok(%t,32)
  while (%i < %ii) {
    inc %i
    if ($len($gettok(%t,$+(%s,-,%i),32)) < $maxchars($target)) {
      %tt = $gettok(%t,$+(%s,-,%i),32)
    }
    else {
      msg $target %tt
      dec %i
      %s = $calc(%i + 1)
    }
  }
  if (%tt != $null) msg $target %tt
  halt
}



Note that this code is meant to split up normal conversations where individual words are shorter than the maximum number of characters allowed for that network. Extremely long words may cause the script to fail.

-genius_at_work
© mIRC Discussion Forums