I wrote this some time ago. The pause alias I found on Hawkee. You can use halt instead of pause if you want, but it seems better to queue up commands instead of just halting everything. You'll need to add a call to the linecount alias anywhere in your scripts where you have msg #.

Let me know if it actually works, because I haven't tried it in practice



Code:

alias LineCount {
  if (%LineLimit) pause s 5
  if (!%LineCount) set %LineCount 0
  if (!%LineTimer) set %LineTimer $uptime
  inc %LineCount
  echo -a %LineCount lines in $calc($uptime - %LineTimer) seconds
  if ($calc($uptime - %LineTimer) < 30 ) && (%LineCount >= 49) {
    echo -a Limit reached
    unset %Line*
    set -u5 %LineLimit On
  }
  elseif ($calc($uptime - %LineTimer) > 30 ) && (%LineCount < 49) {
    echo -a Limit not reached, resetting counter
    set %LineCount 1
    set %LineTimer $uptime
  }
  elseif ($calc($uptime - %LineTimer) > 30 ) && (%LineCount >= 49) {
    echo -a Limit not reached, resetting counter
    set %LineCount 1
    set %LineTimer $uptime
  }
}


alias pause {
  var %e = !echo $color(info) -a * /pause:
  if ($version < 5.91) {
    %e this snippet requires atleast mIRC version 5.91
  }
  elseif ($isid) {
    %e this snippet can only be called as a command.
  }
  elseif (!$regex(pause,$1-,/^m?s \d+$/Si)) {
    %e incorrect/insufficient parameters. Syntax: /pause <s|ms> <N>
  }
  elseif ($1 == ms) && ($os isincs 9598ME) {
    %e cannot use milliseconds parameter on OS'es beneath Win2k
  }
  elseif ($2 !isnum 1-) {
    %e must specify a number within range 1-
  }
  else {
    var %wsh = $+(wsh,$ticks,$r(1111,9999)), %cmd
    if ($1 == s) %cmd = ping.exe -n $int($calc($2 + 1)) 127.0.0.1
    else %cmd = pathping.exe -n -w 1 -q 1 -h 1 -p $iif($2 > 40,$calc($2 - 40),$2) 127.0.0.1
    .comopen %wsh wscript.shell
    if ($comerr) %e unable to open Wscript.Shell
    else .comclose %wsh $com(%wsh,run,1,bstr*,% $+ comspec% /c %cmd >nul,uint,0,bool,true)
  }
}




Last edited by Sakana; 18/02/15 10:08 AM.