SHARE
TWEET

chanscan.mrc

Seb Nov 18th, 2018 104 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # A code by l4roxyl - 07/24/2009
  2. # Edited and optimised by Seb on #Sebastien @ Undernet 5/28/2018
  3.  
  4. on *:join:#:{
  5.   if (%anti.infochan.flood) { HALT }
  6.   if ($nick !== $me) { halt }
  7.   else { .timer 1 1 infochan # }
  8. }
  9. on *:DISCONNECT:{ set %anti.infochan.flood on }
  10. on *:START:{ .timer 1 40 unset %anti.infochan.flood }
  11.  
  12. alias -l qt returnex $+($chr(2),$1-,$chr(2))
  13. alias infochan {
  14.   var %_ec = echo -aceq info $str($chr(149),3) /infochan:
  15.   if ($1) {
  16.     if ($hget($1,_delay)) { %_ec Same channel( $+ $1 $+ ) pls $hget($1,_delay).unset seconds waiting. | returnex }
  17.     if ($1 !ischan) { %_ec $1 no such channel. | returnex }
  18.   }
  19.   else { %_ec insufficient parameters. /infochan <#channel> | returnex }
  20.   hinc -mu10 $1 _delay 1 | .enable #_chan_info | who $1
  21. }
  22. #_chan_info off
  23. raw *:*: {
  24.   haltdef | tokenize 32 $rawmsg
  25.   if ($2 = 352) { hinc -m $+(stats_,$4) _all_user 1 | hinc -m $+(stats_,$4) $+(server_,$7) 1
  26.     if ($7 = $server) hinc -m $+(stats_,$4) _server 1
  27.     hadd -m $+(stats_,$4) $6 $addtok($hget($+(stats_,$4),$6),$8,63)
  28.     if ($regex($9,\*)) { hinc -m $+(stats_,$4) _irc_op 1
  29.       hadd -m $+(stats_,$4) _ircop_nick $addtok($hget($+(stats_,$4),_ircop_nick),$8,44)
  30.     }
  31.     if ($regex($9,G)) { hinc -m $+(stats_,$4) _away 1
  32.       hadd -m $+(stats_,$4) _away_nick $addtok($hget($+(stats_,$4),_away_nick),$8,44)
  33.     }
  34.     if ($regex(prefix,$9,(@|&|%|\+|~))) { hinc -m $+(stats_,$4) _prefixes 1
  35.       hadd -m $+(stats_,$4) _prefixes_nick $addtok($hget($+(stats_,$4),_prefixes_nick),$+($regml(prefix,1),$8),44)
  36.     }
  37.     if ($regex($9,B)) { hinc -m $+(stats_,$4) _bot 1
  38.       hadd -m $+(stats_,$4) _bot_nick $addtok($hget($+(stats_,$4),_bot_nick),$8,44)
  39.     }
  40.     if ($regex($9,H)) hinc -m $+(stats_,$4) _here 1
  41.     if ($regex($9,r)) hinc -m $+(stats_,$4) _reg_nick 1
  42.   }
  43.   if ($2 = 315) {
  44.     var %_str = echo -c info $4 $str($chr(149),3)
  45.     %_str 14Total user: $//qt($hget($+(stats_,$4),_all_user))
  46.     if ($hget($+(stats_,$4),_reg_nick)) {
  47.       %_str Registered nick: $//qt($v1 $+($chr(40),%,$left($calc($v1 *100/ $hget($+(stats_,$4),_all_user)),4),$chr(41)))
  48.     }
  49.     if ($hget($+(stats_,$4),_away)) { %_str 5Away user(s): $//qt($v1 $+($chr(40),%,$left($calc($v1 *100/ $hget($+(stats_,$4),_all_user)),4),$chr(41))) }
  50.     if ($hget($+(stats_,$4),_here)) { %_str 3Here user(s): $//qt($v1 $+($chr(40),%,$left($calc($v1 *100/ $hget($+(stats_,$4),_all_user)),4),$chr(41))) }
  51.     if ($hget($+(stats_,$4),_prefixes)) {
  52.       %_str 14Prefixes nick: $//qt($v1 $+($chr(40),%,$left($calc($v1 *100/ $hget($+(stats_,$4),_all_user)),4),$chr(41)))
  53.       %_str 14Prefixes nick(s): $//qt($regsubex($regsubex($hget($+(stats_,$4),_prefixes_nick),/ $+ $chr(44) $+ /g,$chr(32)),/([@&%+~])/g,$+($chr(40),\1,$chr(41))))
  54.     }
  55.     if ($hget($+(stats_,$4),_bot)) {
  56.       %_str 11Bots: $//qt($v1 $+($chr(40),%,$left($calc($v1 *100/ $hget($+(stats_,$4),_all_user)),4),$chr(41))) - $regsubex($hget($+(stats_,$4),_bot_nick),/( $+ $chr(44) $+ )/g,$+(\1,$chr(32)))
  57.     }
  58.     var %_sttl = $calc($hget($+(stats_,$4),_server) *100/ $hget($+(stats_,$4),_all_user))
  59.     ;%_str 14Connected server: $//qt($server) - Users: $//qt($hget($+(stats_,$4),_server)) $+($chr(40),%,$left(%_sttl,4),$chr(41)))
  60.     if ($hget($+(stats_,$4),_irc_op)) {
  61.       %_str 4IRC-op(s): $//qt($v1 $+($chr(40),%,$left($calc($v1 *100/ $hget($+(stats_,$4),_all_user)),4),$chr(41))) - $&
  62.         $regsubex($hget($+(stats_,$4),_ircop_nick),/( $+ $chr(44) $+ )/g,$+(\1,$chr(32)))
  63.     }
  64.     if ($hfind($+(stats_,$4),\?,0,r).data) {
  65.       %_str 7Total clone(s): $//qt($v1 $+($chr(40),%,$left($calc($v1 *100/ $hget($+(stats_,$4),_all_user)),4),$chr(41)))
  66.     }
  67.     var %1 = 1,%_clonnick
  68.     while ($hfind($+(stats_,$4),\?,%1,r).data) {
  69.       %_clonnick = $regsubex($hget($+(stats_,$4),$v1),/(\?)/g,$chr(32) - $+ $chr(32))
  70.       %_str 14Add: $//qt($v1) - $+(Nicks,$chr(40),$numtok(%_clonnick,45),$chr(41),:) $//qt(%_clonnick)
  71.       inc %1
  72.     }
  73.     hfree $+(stats_,$4) | .disable #_chan_info
  74.   }
  75. }
  76. #_chan_info end
  77. ;end code
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top