PuNkTuReD commented on a Page, [Bot script] Split message if its overlimit  -  Feb 08, 2010

instead of piping several "vars" just use ","

var %a = 1, %b = 2, %c = 3
and even then i dont think the "="'s are needed.

why 452? i think different servers use different limits.

an alias/identifier, would be nice
example:

alias msg.limit return 452

then in script, you can do $msg.limit
and people can edit that alias/identifier as they wish.

oh also, in your description, you should add that the usage is
$chan
and i may be wrong but there is no need to tokensize, since your outgoing msg is already tokened by spaces.

heres a version of this i wrote a while ago

alias check.len {
  var %aa = $1-
  if ($len(%aa) <= 250) { msg $chan %aa }
  else {
    var %a = 250, %b = $len(%aa)
    while (%a <= %b) {
      msg $chan $iif(%a == 250,$left(%aa,%a),$right($left(%aa,%a),$calc(%a - 250)))
      if (%a < %b && $calc(250 + %a) > %b) { msg $chan $right(%aa,$calc(%b - %a)) | halt }
      else { inc %a 250 }
    }
  }
}      
 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.