This sounds like it could be a useful feature. It may be a good idea to include options for it though. "Enable/Disable" and "Auto/Ask" come to mind.

I came up with this code a while ago for a similar problem. It could be used to detect if the text is too long to send on one line, and break it up. This code doesn't actually do that splitting, it just tests how the max character len that can be sent as a PRIVMSG.

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 return $iif($($+(%,MCL.,$cid),2),$ifmatch,512)


The max length is everything that comes after the PRIVMSG in the $rawmsg. This could be tested with something like this:
Code:
on *:INPUT:#:{
  if ((/* iswm $1) && (!$ctrlenter)) return
  if ($len($target $1-) > $maxchars) echo 4 -at *** This line was cut off at this point: $mid($target $1-,$calc($maxchars - 16),15)
}


-genius_at_work

Last edited by genius_at_work; 26/02/06 06:45 PM.