All pastes #464663 Raw Edit

mIRC cutscript

public text v1 · immutable
#464663 ·published 2007-04-29 17:13 UTC
rendered paste body

Copy paste this code into the aliases section of your mIRC
----------------------------------------------------------

get_end_cc { 
  if ($prop == bold) return $iif($calc($count($$1,) % 2),$true,$null) 
  if ($prop == underline) return $iif($calc($count($$1,) % 2),$true,$null) 
  if ($prop == reverse) return $iif($calc($count($$1,) % 2),$true,$null) 
  var %re = /(\d{1,2}(?:,\d{1,2})*)(?:[^]*)$/ 
  !.echo -q $regex(get_last,$$1,%re) 
  return $iif($regml(get_last,1),$ifmatch,$null) 
}


Copy paste the code below into the remotes section of your mIRC
---------------------------------------------------------------

on *:input:*: { 
  if ( ( $left($1,1) != / ) || ( $1 == /me ) ) { 
    var %next     = $chr(3) $+ 106-- 
    var %continue = $chr(3) $+ 106-- 
    var %done     = $chr(3) $+ 10 
    var %more     = $chr(3) $+ 106-- 

    var %emote_c  = 06 
    var %say_c    = 20 

    var %textlen = $len($1-)

    if (%textlen > 400) { 
      var %pos = 1 
      var %text = $mid($1-, %pos, 400) 
      var %firsttime = 1 
      var %lastcolor = $null 
      var %nextcolor = $null 
      while ( %text != $null ) { 
        if ( $len($deltok(%text, -1, 32)) < 370 ) { 
          var %text = $left(%text, 370) 
          inc %pos 370 
        } 
        else { 
          var %text = $deltok(%text,-1,32) 
          inc %pos $len(%text) 
          inc %pos 
        } 
        var %outtext = %text 
        var %text = $mid($1-, %pos, 400) 
        if (%firsttime == 1) { 
          var %lastcolor = $get_end_cc(%outtext) 
          if ($gettok(%outtext, 1, 32) == /me) { 
            %outtext %next 
            if (%lastcolor == $null) { 
              %lastcolor = %emote_c 
            } 
          } 
          else { 
            say %outtext %next 
            if (%lastcolor == $null) { 
              var %lastcolor = %say_c 
            } 
          } 
          var %firsttime = 0 
        } 
        else { 
          var %newcolor = $chr(3) $+ %lastcolor 
          if (%text != $null) { 
            say %continue $+ %newcolor %outtext %next 
          } 
          else { 
            if (%textlen <= 945) { 
              say %continue $+ %newcolor %outtext %done 
            } 
            else { 
              say %continue $+ %newcolor %outtext %more 
            } 
          } 
          %nextcolor = $get_end_cc(%outtext) 
          if (%nextcolor != $null) { 
            var %lastcolor = %nextcolor 
          } 
        } 
      } 
      halt
    } 
  } 
}