I have made an output alias for a socket bot that hard-wraps the text so that it is never more than a specified length. However, I want to do a soft wrap (wherein it never cuts into the middle of a word unless the word itself is > max length) but I can't quite figure out how to go about it.
Could anyone gimme a suggestion?
Heres the hard wrap:
Code:
alias kuran.output {
  var %kuran.length = 80
  var %kuran.output = $2-

  while ($len(%kuran.output) > 0) {
    sockwrite -n $1 $left(%kuran.output, %kuran.length)
    %kuran.output = $right(%kuran.output, $calc(0 - %kuran.length))
  }
}
  


-------------
I am the self-appointed God of needlessly complex mIRCscript.