tglogo.png

Downloading File

Filename: Remote and alias stats
;Remote and alias stats by da^hype @ WebChat
;url: www.hirc.org & www.mircmalaysia.com
;email: [email protected]
;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
}

Related Files

by Warrior124
by ProIcons
by Lindrian

Please note that on our website we use cookies necessary for the functioning of our website, cookies that optimize the performance. To learn more about our cookies, how we use them and their benefits, please read our Cookie Policy.
I Understand