Remote and alias stats

By da^hype on Mar 24, 2005

Generates a neat little summary of your loaded alias and remote files.

;Remote and alias stats by da^hype @ WebChat
;url: www.hirc.org & www.mircmalaysia.com
;email: da-hype@hirc.org
;Echo's remote and alias stats to active window by typing /remotes

alias remotes {
  ;remotes
  var %total.stats = 1,%events,%RemoteLine.stats,%RemoteAveLine.stats,%:e = .echo -a,%RemoteSize.stats,%RemoteAveSize.stats,%RemoteSize.stats
  while ($script(%total.stats)) {
    %RemoteLine.stats = $calc(%RemoteLine.stats + $lines($script(%total.stats)))
    %RemoteSize.stats = $calc(%RemoteSize.stats + $file($script(%total.stats)).size)
    ;calc events
    filter -gff $+(",$v1,") nul ^(?i)(on|ctcp|raw) .+:.+
    inc %events $filtered
    inc %total.stats
  }
  %RemoteAveLine.stats = $round($calc(%RemoteLine.stats / $script(0)),0)
  %RemoteAveSize.stats = $round($calc((%RemoteSize.stats / $script(0)) / 1024),2)
  %RemoteSize.stats = $round($calc(%RemoteSize.stats / 1024),2)
  ;aliases
  var %total.stats = 1,%local,%global,%AliasLine.stats,%AliasAveLine.stats,%AliasSize.stats,%AliasAveSize.stats,%AliasSize.stats
  while ($script(%total.stats)) {
    %AliasLine.stats = $calc(%AliasLine.stats + $lines($alias(%total.stats)))
    %AliasSize.stats = $calc(%AliasSize.stats + $file($alias(%total.stats)).size)
    ;calc local aliases
    filter -gff $+(",$v1,") nul ^(?i)alias -l\s
    inc %local $filtered
    ;calc global aliases
    filter -gff $+(",$v1,") nul ^(?i)alias (?!-l)
    inc %global $filtered
    inc %total.stats
  }
  %AliasAveLine.stats = $round($calc(%AliasLine.stats / $alias(0)),0)
  %AliasAveSize.stats = $round($calc((%AliasSize.stats / $alias(0)) / 1024),2)
  %AliasSize.stats = $round($calc(%AliasSize.stats / 1024),2)
  ;echo's
  %:e $str($chr(149),10) Remote(s) $str($chr(149),10)
  %:e Total Remotes $chr(61) $script(0) file(s)
  %:e Total Line(s) $chr(61) %RemoteLine.stats line(s)
  %:e Total Size $chr(61) %RemoteSize.stats kb
  %:e Total Event(s) $chr(61) %events
  %:e Ave. Line(s) $chr(61) %RemoteAveLine.stats line(s)
  %:e Ave. Size $chr(61) %RemoteAveSize.stats kb
  %:e $str($chr(149),10) Alias(es) $str($chr(149),10)
  %:e Total Alias(es) $chr(61) $alias(0) file(s)
  %:e Total Line(s) $chr(61) %AliasLine.stats line(s)
  %:e Total Size $chr(61) %AliasSize.stats kb
  %:e Total Global Alias(es) $chr(61) %global
  %:e Total Local Alias(es) $chr(61) %local
  %:e Ave. Line(s) $chr(61) %AliasAveLine.stats line(s)
  %:e Ave. Size $chr(61) %AliasAveSize.stats kb
}

Comments

Sign in to comment.
zonirc   -  Apr 01, 2005

a nice snippet which will tell the relevant stats about ur alias/remote file. Good job da^hype

 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.