Public paste
on event
By: on event | Date: Mar 22 2011 02:10 | Format: None | Expires: never | Size: 21.82 KB | Hits: 894

  1. ; ––––––––––––––––––––––––––––––––––––––––
  2. ; NNScript by ESNation v4.22 - main events - coded by greeny & mute
  3. ; Don't edit anything in here unless you REALLY know what you're doing!
  4. ; ––––––––––––––––––––––––––––––––––––––––
  5. on ^*:part:#:{
  6.   if ($nick == $me) {
  7.     $+(.timerialq.,$cid,.,$chan) off
  8.     ialq.update remove $chan
  9.   }
  10.   elseif ($cprot.chkst($nick,$chan)) && (%cprot. [ $+ [ %cprot.curchan ] $+ ] .join-/partflood) { cprot.dchk join-/partflood }
  11. }
  12. on ^*:logon:*:{
  13.   toolbar.conbtn
  14.   toolbar.refinfo
  15.   winpic Status Window
  16. }
  17. on *:connect:{
  18.   newserv $+($server,   ,$iif($network,$nbr($network)))
  19.   if ($mouse.key & 4) {
  20.     thmecho -a Cancelling execution of $thmhl(auto-join) list...
  21.     .autojoin -s
  22.   }
  23.   else { .autojoin -d2 }
  24. }
  25. on *:signal:connect:{
  26.   if (%getexternalip) { .timergetip 1 10 getip }
  27.   winpic Status Window
  28.   toolbar.conbtn
  29.   toolbar.refinfo
  30.   if (%gs.auth.auto) { gs.doauth }
  31.   if (%x.auth.auto) { x.doauth }
  32.   if (%q.auth.auto) { q.doauth }
  33.   if (%psybnc.info. [ $+ [ $cid ] ]) || (%sbnc.info. [ $+ [ $cid ] ]) { .timer 1 2 q.checkauth }
  34.   inc %stat.connects
  35.   if (%awretain) && (%away.status) {
  36.     tokenize 32 $v1
  37.     if ($4-) { !away $4- $nbr(since $asctime($1,%timeformat)) }
  38.   }
  39.   if (%autoaway) { .timercheckidle -i 0 60 checkidle }
  40. }
  41. on *:disconnect:{
  42.   .signal -n disconnect
  43.   unset %psybnc.info. $+ $cid
  44.   unset %sbnc.info. $+ $cid
  45.   if (%psybnc.cid == $cid) && ($dialog(psybnc)) { dialog -c $v1 }
  46. }
  47. on *:signal:disconnect:{
  48.   winpic Status Window
  49.   toolbar.conbtn
  50.   toolbar.refinfo
  51.   if ($cid == $activecid) && ($toolbar(infobox)) { lagbar.clear }
  52.   if ($hget(cprot)) { hdel -w cprot $+(*.*.,$cid,.*.*) }
  53.   if ($hget(pprot)) { hdel -w pprot $+(*.,$cid,.*.*) }
  54.   unset %ialupdate. $+ $cid %q.newauthck. $+ $cid %psybnc.modehide. $+ $cid %away.seen.*. $+ $cid %q.authed. $+ $cid $&
  55.     %usermodes. $+ $cid %laghistory. $+ $cid %whois. $+ $cid %whowas. $+ $cid %rconnected. $+ $cid %ghosttry. $+ $cid %modedsp. $+ $cid $+ .*
  56.   unset %qcls.ls. $+ $cid $+ .* %nickretry. $+ $cid %joinretry. $+ $cid %who.show. $+ $cid %topiclen. $+ $cid %silencenum. $+ $cid %maxbans. $+ $cid $&
  57.     %pingticks. $+ $cid $+ .* %q.challengeauth. $+ $cid %ctcp.emfp. $+ $cid %names.show. $+ $cid %joinprog.*. $+ $cid %topicset.*. $+ $cid
  58.   if (%chancentral.cid == $cid) && ($dialog(chancentral)) { dialog -c $v1 }
  59. }
  60. on *:appactive:{
  61.   dcx xSignal 1
  62.   set %appactive $appactive
  63. }
  64. on *:filercvd:*:{
  65.   dccfin.sd
  66.   newget $filename
  67.   inc %stat.dccgot $get(-1).size
  68.   inc %stat.dccgotfiles
  69.   if (!$halted) {
  70.     if (%dcc.sinfo) { thmecho -a DCC get of $thmhl($get(-1).file) from $thmhl($get(-1)) $+ $iif($get(-1).ip != 255.255.255.255,/ $+ $thmhl($v1)) finished. Downloaded $thmhl($bytes($get(-1).size,3).suf) $iif($get(-1).resumed,after resuming from $thmhl($bytes($v1,3).suf)) in $thmhl($sduration($get(-1).secs)) at an average of $thmhl($bytes($get(-1).cps,3).suf $+ /s) $+ . }
  71.     haltdef
  72.   }
  73. }
  74. on *:filesent:*:{
  75.   dccfin.sd
  76.   inc %stat.dccsent $get(-1).size
  77.   inc %stat.dccsentfiles
  78.   if (!$halted) {
  79.     if (%dcc.sinfo) { thmecho -a DCC send of $thmhl($send(-1).file) to $thmhl($send(-1)) $+ $iif($send(-1).ip != 255.255.255.255,/ $+ $thmhl($v1)) finished. Uploaded $thmhl($bytes($send(-1).size,3).suf) $iif($send(-1).resumed,after resuming from $thmhl($bytes($v1,3).suf)) in $thmhl($sduration($send(-1).secs)) at an average of $thmhl($bytes($send(-1).cps,3).suf $+ /s) $+ . }
  80.     haltdef
  81.   }
  82. }
  83. on *:getfail:*:{
  84.   inc %stat.dccgot $get(-1).rcvd
  85.   if (!$halted) {
  86.     if (%dcc.sinfo) { thmerror -a DCC get of $thmhl($get(-1).file) from $thmhl($get(-1)) $+ $iif($get(-1).ip != 255.255.255.255,/ $+ $thmhl($v1)) failed! Downloaded $thmhl($+($bytes($get(-1).rcvd,3),/,$bytes($get(-1).size,3).suf)) $+ / $+ $thmhl($get(-1).pc $+ %) $iif($get(-1).resumed,after resuming from $thmhl($bytes($v1,3).suf)) in $thmhl($sduration($get(-1).secs)) at an average of $thmhl($bytes($get(-1).cps,3).suf $+ /s) $+ . }
  87.     haltdef
  88.   }
  89. }
  90. on *:sendfail:*:{
  91.   inc %stat.dccsent $send(-1).sent
  92.   if (!$halted) {
  93.     if (%dcc.sinfo) { thmerror -a DCC send of $thmhl($send(-1).file) to $thmhl($send(-1)) $+ $iif($send(-1).ip != 255.255.255.255,/ $+ $thmhl($v1)) failed! Uploaded $thmhl($+($bytes($send(-1).sent,3),/,$bytes($send(-1).size,3).suf)) $+ / $+ $thmhl($send(-1).pc $+ %) $iif($send(-1).resumed,after resuming from $thmhl($bytes($v1,3).suf)) in $thmhl($sduration($send(-1).secs)) at an average of $thmhl($bytes($send(-1).cps,3).suf $+ /s) $+ . }
  94.     haltdef
  95.   }
  96. }
  97. on ^*:invite:#:{ if (!$halted) && ($nick != $me) && (%pprot.inviteflood) { checkpp inviteflood } }
  98. ; Need to create 3 identical input events due to mirc sucking.
  99. on *:input:?:{
  100.   var %ul = $minirc.actchan
  101.   if (!$halted) {
  102.     if ($inpaste) {
  103.       .timerpaste -io 1 0 dopaste
  104.       haltdef
  105.     }
  106.     elseif (!$cmdchar($1)) || ($ctrlenter) {
  107.       inc %stat.writtenchars $len($1-)
  108.       inc %stat.writtenwords $0
  109.       inc %stat.writtenlines
  110.       if ($right($1-,1) == ?) { inc %stat.writtenqu }
  111.       if (%ul) && (!$ctrlenter) && (%nick.comp) && ($right($1,1) isin %nick.comp.chr) && ($len($1) > 3) {
  112.         var %r = $n.comp($left($1,-1),0)
  113.         if (%r > 1) {
  114.           set %nickcomp.text $1-
  115.           set %nickcomp.chan %ul
  116.           if (!$dialog(nickcomp)) {
  117.             nndlg $iif($active == @MinIRC,-mdo,-m) nickcomp
  118.             while (%r) {
  119.               did -a nickcomp 3 $n.comp($left($1,-1),%r)
  120.               dec %r
  121.             }
  122.             did -c nickcomp 3 1
  123.           }
  124.           haltdef
  125.           return
  126.         }
  127.         elseif ($n.comp($left($1,-1),0)) {
  128.           var %x = $replace(%nickcomp.format,<nick>,$n.comp($left($1,-1),1))
  129.           msg %ul $iif($cchan(%ul),$strip(%x),%x) $2-
  130.           haltdef
  131.           return
  132.         }
  133.       }
  134.       if (%away.ipback) && (%away.status) { back }
  135.       msg %ul $1-
  136.       haltdef
  137.     }
  138.   }
  139. }
  140. on *:input:#:{
  141.   var %ul = $minirc.actchan
  142.   if (!$halted) {
  143.     if ($inpaste) {
  144.       .timerpaste -io 1 0 dopaste
  145.       haltdef
  146.     }
  147.     elseif (!$cmdchar($1)) || ($ctrlenter) {
  148.       inc %stat.writtenchars $len($1-)
  149.       inc %stat.writtenwords $0
  150.       inc %stat.writtenlines
  151.       if ($right($1-,1) == ?) { inc %stat.writtenqu }
  152.       if (%ul) && (!$ctrlenter) && (%nick.comp) && ($right($1,1) isin %nick.comp.chr) && ($len($1) > 3) {
  153.         var %r = $n.comp($left($1,-1),0)
  154.         if (%r > 1) {
  155.           set %nickcomp.text $1-
  156.           set %nickcomp.chan %ul
  157.           if (!$dialog(nickcomp)) {
  158.             nndlg $iif($active == @MinIRC,-mdo,-m) nickcomp
  159.             while (%r) {
  160.               did -a nickcomp 3 $n.comp($left($1,-1),%r)
  161.               dec %r
  162.             }
  163.             did -c nickcomp 3 1
  164.           }
  165.           haltdef
  166.           return
  167.         }
  168.         elseif ($n.comp($left($1,-1),0)) {
  169.           var %x = $replace(%nickcomp.format,<nick>,$n.comp($left($1,-1),1))
  170.           msg %ul $iif($cchan(%ul),$strip(%x),%x) $2-
  171.           haltdef
  172.           return
  173.         }
  174.       }
  175.       if (%away.ipback) && (%away.status) { back }
  176.       msg %ul $1-
  177.       haltdef
  178.     }
  179.   }
  180. }
  181. on *:input:@MinIRC:{
  182.   var %ul = $minirc.actchan
  183.   if (!$halted) {
  184.     if ($inpaste) {
  185.       .timerpaste -io 1 0 dopaste
  186.       haltdef
  187.     }
  188.     elseif (!$cmdchar($1)) || ($ctrlenter) {
  189.       inc %stat.writtenchars $len($1-)
  190.       inc %stat.writtenwords $0
  191.       inc %stat.writtenlines
  192.       if ($right($1-,1) == ?) { inc %stat.writtenqu }
  193.       if (%ul) && (!$ctrlenter) && (%nick.comp) && ($right($1,1) isin %nick.comp.chr) && ($len($1) > 3) {
  194.         var %r = $n.comp($left($1,-1),0)
  195.         if (%r > 1) {
  196.           set %nickcomp.text $1-
  197.           set %nickcomp.chan %ul
  198.           if (!$dialog(nickcomp)) {
  199.             nndlg $iif($active == @MinIRC,-mdo,-m) nickcomp
  200.             while (%r) {
  201.               did -a nickcomp 3 $n.comp($left($1,-1),%r)
  202.               dec %r
  203.             }
  204.             did -c nickcomp 3 1
  205.           }
  206.           haltdef
  207.           return
  208.         }
  209.         elseif ($n.comp($left($1,-1),0)) {
  210.           var %x = $replace(%nickcomp.format,<nick>,$n.comp($left($1,-1),1))
  211.           msg %ul $iif($cchan(%ul),$strip(%x),%x) $2-
  212.           haltdef
  213.           return
  214.         }
  215.       }
  216.       if (%away.ipback) && (%away.status) { back }
  217.       msg %ul $1-
  218.       haltdef
  219.     }
  220.   }
  221. }
  222. on ^*:kick:#:{
  223.   if ($nick == $me) { inc %stat.kickcount }
  224.   if ($knick == $me) {
  225.     inc %stat.skickcount
  226.     $+(.timerialq.,$cid,.,$chan) off
  227.     ialq.update remove $chan
  228.     if ($gettok($readini($mircini,options,n0),8,44)) { .timerjdel 1 0 join $chan $chan($chan).key }
  229.   }
  230. }
  231. on *:topic:#:{
  232.   if ($nick == $me) { inc %stat.topicchanges }
  233.   topic.shist $chan $ctime $1-
  234. }
  235. on ^*:nick:{
  236.   if ($nick === $newnick) { haltdef }
  237.   else {
  238.     if ($timer(nickchg. $+ $cid)) && ($nick == %nickretry. [ $+ [ $cid ] ]) { nick $nick }
  239.     if ($nick == $me) {
  240.       inc %stat.nicks
  241.       .timernickchg. $+ $cid off
  242.     }
  243.     if ($hfind(black,$address($newnick,5),0,W)) {
  244.       var %c = $comchan($newnick,0)
  245.       while (%c) {
  246.         if ($ccontrol($chan)) { black.kick $comchan($newnick,%c) $newnick }
  247.         dec %c
  248.       }
  249.     }
  250.     if ($query($newnick)) {
  251.       if (%qcls.ls. [ $+ [ $cid ] $+ ] . [ $+ [ $nick ] ]) {
  252.         set $+(%,qcls.ls.,$cid,.,$newnick) %qcls.ls. [ $+ [ $cid ] $+ ] . [ $+ [ $nick ] ]
  253.         unset $+(%,qcls.ls.,$cid,.,$nick)
  254.       }
  255.     }
  256.     winpic $newnick
  257.   }
  258. }
  259. on &^*:notify:{
  260.   var %i = $ini($mircini,notify,0)
  261.   while (%i) {
  262.     var %l = $readini($mircini,n,notify,n $+ $calc(%i -1)),%y = 0
  263.     if (+* iswm %l) { var %l = $mid(%l,2),%y = 1 }
  264.     if ($nick == %l) {
  265.       if (%y) { whois $nick }
  266.       break
  267.     }
  268.     dec %i
  269.   }
  270. }
  271. on ^*:quit:{ if ($query($nick)) { unset $+(%,qcls.ls.,$cid,.,$nick) } }
  272. on ^*:join:#:{
  273.   if ($nick != $me) {
  274.     if ($nick($chan,0)) && ((!$hget(peaks,$chan)) || ($wd($hget(peaks,$chan),1) < $nick($chan,0))) { hadd -m peaks $chan $nick($chan,0) $ctime }
  275.     if ($ccontrol($chan)) {
  276.       black.kick $chan $nick
  277.       if ($cprot.chkst($nick,$chan)) && (%cprot. [ $+ [ %cprot.curchan ] $+ ] .join-/partflood) { cprot.dchk join-/partflood }
  278.     }
  279.   }
  280.   else {
  281.     inc %stat.joins
  282.     if ($fulladdress == Q!TheQBot@CServe.quakenet.org) && (%q.auth.auto) { .timersplitauth. $+ $cid 1 10 q.doauth }
  283.     if (%joinretry. [ $+ [ $cid ] ] == $chan) { $+(.timerjoinretry.,$cid) off }
  284.   }
  285. }
  286. on ^*:open:?:{
  287.   if (%pprot.blockallqueries) { haltdef }
  288.   elseif ($nick == $me) { if ($1- == AIDLE) { haltdef } }
  289.   elseif (!$halted) {
  290.     if (%pprot.spam) && (($regex($strip($1-),/#.+|www..+..+|http.//.+..+|a.?s.?l??/i)) || ($count($1-,,,,) > 4)) && ($prot.exclps($fulladdress)) { pprot.dotrig spam }
  291.     if (%pprot.queryflood) { checkpp queryflood }
  292.     if (%contentfilter.queries) && (%contentfilter) && ($regex($strip($1-),%contentfilter)) { haltdef }
  293.     if (!$halted) {
  294.       if (%query.notify) {
  295.         var %c = $cid
  296.         scid $activecid
  297.         thmecho -a $thmhl($nick) $+ / $+ $thmhl($address) opened a query with $iif(%c != $cid,you on $thmhl($iif($scid(%c).network,$v1,$scid(%c).server)),you) $+ : $1-
  298.         scid -r
  299.       }
  300.     }
  301.   }
  302.   if (!$halted) { set $+(%,qcls.ls.,$cid,.,$nick) $ctime }
  303. }
  304. on *:open:?:{
  305.   playmircsound query
  306.   if (!$halted) {
  307.     thmls $nick
  308.     thmecho $nick Query with $thmhl($nick) $+ / $+ $thmhl($gettok($address($nick,0),2,33)) opened on $thmhl($longtime) $+ .
  309.     stat.queryref
  310.     if (%querystats) {
  311.       thmecho $nick Total queries: $thmhl(%stat.queries) $+ / $+ $thmhl(~ $+ $iif($dayavg(%stat.queries,1) < %stat.queries,$v1,%stat.queries) per day)
  312.       thmecho $nick Queries today: $thmhl(%stat.queriestoday)
  313.       if ($comchan($nick,0)) {
  314.         var %i = $comchan($nick,0),%r
  315.         while (%i) {
  316.           if ($nick !isreg $comchan($nick,%i)) { var %p = $left($nick($comchan($nick,%i),$nick).pnick,1) }
  317.           else { unset %p }
  318.           var %r = %r %p $+ $comchan($nick,%i)
  319.           dec %i
  320.         }
  321.         thmecho $nick Common channels: $thmhl(%r)
  322.       }
  323.     }
  324.     thmls $nick
  325.     echo $nick 
  326.   }
  327. }
  328. on *:signal:winevent:{
  329.   if ($1 == Create) {
  330.     var %w = $window(*,0)
  331.     while (%w) {
  332.       if ($window(*,%w).hwnd == $3) {
  333.         winpic $window(*,%w)
  334.         return
  335.       }
  336.       dec %w
  337.     }
  338.   }
  339. }
  340. on *:active:*:{ winpic $active }
  341. on *:close:?:{ unset $+(%,qcls.ls.,$cid,.,$target) }
  342. on *:ban:*:{
  343.   if ($nick == $me) { inc %stat.bancount }
  344.   elseif ($ccontrol($chan)) && (%pprot.ban) && ($banmask iswm $address($me,5)) && ($prot.exclps($fulladdress)) { pprot.dotrig ban $chan $banmask }
  345.   if ($banmask iswm $ial($me)) { inc %stat.sbancount }
  346.   if (%bndsp) && ($ialchan($banmask,$chan,0)) {
  347.     var %i = $v1,%r
  348.     while (%i) {
  349.       %r = %r $nick($chan,$ialchan($banmask,$chan,%i).nick).pnick
  350.       if ($len(%r) > 3000) {
  351.         %r = %r $+ ...
  352.         break
  353.       }
  354.       dec %i
  355.     }
  356.     thmecho $chan This $thmhl($banmask) ban affects: $thmhl($replace(%r,$chr(32),$chr(44) $+ $chr(32)))
  357.   }
  358. }
  359. ctcp ^*:*:*:{
  360.   if ($nick != $me) {
  361.     if (!$chan) { if (!$halted) && (%pprot.ctcpflood) { checkpp ctcpflood } }
  362.     elseif ($cprot.chkst($nick,$chan)) && (%cprot. [ $+ [ %cprot.curchan ] $+ ] .ctcpflood) { cprot.dchk ctcpflood }
  363.   }
  364.   if (!$halted) {
  365.     if ($1 == dcc) {
  366.       var %p,%a
  367.       if ($regex($1-,/^DCC SEND .+ d+ d+ d+ d+$/i)) {
  368.         %p = 1
  369.         if ($wd($1-,-3)) { %a = 1 }
  370.       }
  371.       if ($2 == send) {
  372.         if (%p) { thmecho -a Passive DCC send $iif(%a,answer,request) from $thmhl($nick) received. Trying to $iif(%a,send,get) $thmhl($deltok($3-,-4-,32)) $+ / $+ $thmhl($bytes($wd($1-,-2)).suf) $+ ... }
  373.         else { thmecho -a DCC send request from $thmhl($nick) $+ / $+ $thmhl($longip($wd($1-,-3))) received. Trying to get $thmhl($deltok($3-,-3-,32)) $+ / $+ $thmhl($bytes($wd($1-,-1)).suf) through port $thmhl($wd($1-,-2)) $+ ... }
  374.       }
  375.       elseif ($2 == chat) {
  376.         if (!$5) { thmecho -a Passive DCC chat $iif(%a,answer,request) from $thmhl($nick) received. }
  377.         else { thmecho -a DCC chat request from $thmhl($nick) $+ / $+ $thmhl($longip($4)) received. Trying to chat through port $thmhl($5) $+ ... }
  378.       }
  379.     }
  380.     if ($istok(version userinfo clientinfo script,$1,32)) && (%sendversion) { .ctcpreply $nick $1 12( NoNameScript $replace(%version,.,.) 12:: www.nnscript.com 12:: www.esnation.com 12) }
  381.     elseif ($1 == time) { .ctcpreply $nick $1 $asctime }
  382.     elseif ($1 == finger) { .ctcpreply $nick $1 $iif($readini($mircini,text,finger),$v1,Don't finger me $+ $chr(44) pervert!) }
  383.     elseif ($istok(sound mp3,$1,32)) && ($gettok($readini($mircini,options,n3),19,44)) {
  384.       var %x = $sound($gettok($2-,-1,46)) $+ $2-,%z
  385.       if ($isfile(%x)) { %z = %x }
  386.       elseif ($isfile($2-)) { %z = $2- }
  387.       elseif ($gettok($readini($mircini,options,n3),21,44)) { .timercsound 1 0 thmerror $iif($chan,$chan,$nick) Warning: file $thmhl($2-) does not exist. }
  388.       if (((!$insong) && (!$inwave) && (!$inmidi)) || ($gettok($readini($mircini,options,n3),20,44))) && (%z) { .splay %z }
  389.     }
  390.   }
  391. }
  392. on ^*:notice:*:#:{
  393.   if ($nick != $me) {
  394.     if (!$halted) {
  395.       var %o = $strip($1-)
  396.       if ($isachl(%o)) && (%pprot.highlightflood) { checkpp highlightflood }
  397.       if (%pprot.spam) && (($regex(%o,/#.+|www..+..+|http.//.+..+|a.?s.?l??/i)) || ($count($1-,,,,) > 4)) && ($prot.exclps($fulladdress)) { pprot.dotrig spam }
  398.       if (%pprot.noticeflood) { checkpp noticeflood }
  399.     }
  400.     if ($cprot.chkst($nick,$chan)) && (%cprot. [ $+ [ %cprot.curchan ] $+ ] .noticeflood) { cprot.dchk noticeflood }
  401.   }
  402. }
  403. on ^*:notice:*:?:{
  404.   var %o = $strip($1-)
  405.   if ($nick == NickServ) && ((*/msg nickserv identify* iswm %o) || (*/nickserv identify* iswm %o) || (*/ns identify* iswm %o) || (*is a registered nick*auth* iswm %o) || (*/identify* iswm %o)) {
  406.     tokenize 32 %nsset. [ $+ [ $network ] ]
  407.     if ($4) && ($5 == $me) { $iif($1,!.nickserv,!.msg nickserv) identify $decode($4,m) }
  408.   }
  409.   if ($nick != $me) && (!$halted) {
  410.     if ($isachl(%o)) && (%pprot.highlightflood) { checkpp highlightflood }
  411.     if (%pprot.spam) && (($regex(%o,/#.+|www..+..+|http.//.+..+|a.?s.?l??/i)) || ($count($1-,,,,) > 4)) && ($prot.exclps($fulladdress)) { pprot.dotrig spam }
  412.     if (%pprot.noticeflood) { checkpp noticeflood }
  413.   }
  414.   elseif ($regex($1-,^LAGCHK d+(?:.?d+)?$)) {
  415.     var %t = $int($calc(($nnticks - $2)*1000)),%h = %laghistory. [ $+ [ $cid ] ]
  416.     if ($len(%h) >= 3000) || ($numtok(%h,32) >= 100) { set %laghistory. $+ $cid %t $deltok(%h,-1,32) }
  417.     else { set %laghistory. $+ $cid %t %h }
  418.     if ($cid == $activecid) {
  419.       toolbar.dlag %t
  420.       toolbar.refinfo
  421.     }
  422.     haltdef
  423.   }
  424. }
  425. on *:exit:{
  426.   sysinfo.chkuptimerecord
  427.   close -@
  428.   if ($hget(peaks)) { hsave -ob peaks scriptstablespeaks.tbl }
  429.   if ($hget(rssdone)) { hsave -ob rssdone scriptstablesrssdone.tbl }
  430.   if ($hget(topichist)) { hsave -ob topichist scriptstablestopichist.tbl }
  431.   unsetvars
  432.   var %i = $dll(0)
  433.   while (%i) {
  434.     dll -u $dll(%i)
  435.     dec %i
  436.   }
  437.   set %nocrash 1
  438. }
  439. on *:voice:#:{ if ($nick == $me) { inc %stat.voiced } }
  440. on *:devoice:#:{
  441.   if ($nick == $me) { inc %stat.devoiced }
  442.   elseif (? !iswm $nick) && ($vnick == $me) {
  443.     if ($q.net) && (%q.autorecmode) && (%q.authed. [ $+ [ $cid ] ]) && ((q ison $chan) || (l ison $chan)) && (!%reqvoice. [ $+ [ $cid ] $+ ] . [ $+ [ $chan ] ]) {
  444.       .msg $iif(q ison $chan,q,l) voice $chan
  445.       set -u30 $+(%,reqvoice.,$cid,.,$chan) 1
  446.     }
  447.     elseif ($u.net) && (%x.autorecmode) && (x ison $chan) && (!%reqvoice. [ $+ [ $cid ] $+ ] . [ $+ [ $chan ] ]) {
  448.       .msg x voice $chan
  449.       set -u30 $+(%,reqvoice.,$cid,.,$chan) 1
  450.     }
  451.     elseif ($gsurge) && (%gs.autorecmode) && (ChanServ ison $chan) && (!%reqvoice. [ $+ [ $cid ] $+ ] . [ $+ [ $chan ] ]) {
  452.       .msg chanserv $chan voice $me
  453.       set -u30 $+(%,reqvoice.,$cid,.,$chan) 1
  454.     }
  455.   }
  456. }
  457. on ^*:text:*:#:{
  458.   var %o = $strip($1-)
  459.   cprot.chktxtevent $1-
  460.   if ($contentfilter(%o).chan) { haltdef }
  461.   elseif (!$halted) && ($nick != $me) {
  462.     var %z = $isachl(%o),%a = $cid
  463.     if (%z) {
  464.       if (%pprot.highlightflood) { checkpp highlightflood }
  465.       if (!$halted) {
  466.         if (%showhla) && ($chan != $active) && ((@MinIRC != $active) || ($chan != $wd(%minirc,1)) || ($cid != $wd(%minirc,2))) {
  467.           scid $activecid
  468.           thmecho -a $thmhl($nick) highlighted you in $iif($activecid != %a,$thmhl($chan) on $thmhl($iif($scid(%a).network,$v1,$scid(%a).server)),$thmhl($chan)) $+ : $1-
  469.           scid -r
  470.         }
  471.         aw.chkhl
  472.       }
  473.     }
  474.   }
  475. }
  476. on ^*:text:*:?:{
  477.   var %o = $strip($1-)
  478.   if ($nick == $me) { if ($1- == AIDLE) { haltdef } }
  479.   elseif ($contentfilter(%o).query) { haltdef }
  480.   elseif (!$halted) && ($nick != $me) {
  481.     var %z = $isachl(%o),%a = $cid
  482.     if (%pprot.textflood) { checkpp textflood }
  483.     if (%z) {
  484.       if (%pprot.highlightflood) { checkpp highlightflood }
  485.       if (%showhla) && ($nick != $active) && ($query($nick)) && ((@MinIRC != $active) || ($nick != $wd(%minirc,1)) || ($cid != $wd(%minirc,2))) {
  486.         scid $activecid
  487.         thmecho -a $thmhl($nick) highlighted $iif($activecid != %a,you on $thmhl($iif($scid(%a).network,$v1,$scid(%a).server)),you) $+ : $1-
  488.         scid -r
  489.       }
  490.     }
  491.   }
  492. }
  493. on ^*:action:*:#:{
  494.   var %o = $strip($1-)
  495.   cprot.chktxtevent $1-
  496.   if ((%away.msghide) && ($regex(%o,/away|gone|hlsw|zur(?:ü|ue)ck|daddel|spiel|zock|playing|weg|wech|back|returned|left|leaving/i))) || ($contentfilter(%o).chan) { haltdef }
  497.   elseif (!$halted) && ($nick != $me) {
  498.     var %z = $isachl(%o),%a = $cid
  499.     if (%z) {
  500.       if (%pprot.highlightflood) { checkpp highlightflood }
  501.       if (!$halted) {
  502.         if (%showhla) && ($chan != $active) && ((@MinIRC != $active) || ($chan != $wd(%minirc,1)) || ($cid != $wd(%minirc,2))) {
  503.           scid $activecid
  504.           thmecho -a $thmhl($nick) highlighted you in $iif($activecid != %a,$thmhl($chan) on $thmhl($iif($scid(%a).network,$v1,$scid(%a).server)),$thmhl($chan)) $+ : $1-
  505.           scid -r
  506.         }
  507.         aw.chkhl
  508.       }
  509.     }
  510.   }
  511. }
  512. on ^*:action:*:?:{
  513.   if ($nick != $me) {
  514.     var %o = $strip($1-)
  515.     if ($contentfilter(%o).query) { haltdef }
  516.     elseif (!$halted) {
  517.       var %z = $isachl(%o),%a = $cid
  518.       if (%pprot.textflood) { checkpp textflood }
  519.       if (%z) {
  520.         if (%pprot.highlightflood) { checkpp highlightflood }
  521.         if (%showhla) && ($nick != $active) && ($query($nick)) && ((@MinIRC != $active) || ($nick != $wd(%minirc,1)) || ($cid != $wd(%minirc,2))) && (!$halted) {
  522.           scid $activecid
  523.           thmecho -a $thmhl($nick) highlighted $iif($activecid != %a,you on $thmhl($iif($scid(%a).network,$v1,$scid(%a).server)),you) $+ : %o
  524.           scid -r
  525.         }
  526.       }
  527.     }
  528.   }
  529. }
  530. on *:rawmode:#:{
  531.   if (%chanpasses.save) {
  532.     if ($regex(pwchg,$1-,/(+|-)[a-z]*k[a-z]*/i)) {
  533.       if ($regml(pwchg,1) == +) { set %pass.chan. [ $+ [ $curconserv ] $+ ] . [ $+ [ $chan ] ] $encode($chan($chan).key,m) }
  534.       else { unset %pass.chan. $+ $curconserv $+ . $+ %u }
  535.     }
  536.   }
  537. }
  538. on *:deop:#:{
  539.   if ($nick != $me) {
  540.     if ($cprot.chkst($nick,$chan)) && (%cprot. [ $+ [ %cprot.curchan ] $+ ] .mass-deop) { cprot.dchk mass-deop }
  541.     if (? !iswm $nick) && ($opnick == $me) {
  542.       if ($q.net) && (%q.autorecmode) && (%q.authed. [ $+ [ $cid ] ]) && ((q ison $chan) || (l ison $chan)) && (!%reqop. [ $+ [ $cid ] $+ ] . [ $+ [ $chan ] ]) {
  543.         .msg $iif(q ison $chan,q,l) op $chan
  544.         set -u30 $+(%,reqop.,$cid,.,$chan) 1
  545.       }
  546.       elseif ($u.net) && (%x.autorecmode) && (x ison $chan) && (!%reqop. [ $+ [ $cid ] $+ ] . [ $+ [ $chan ] ]) {
  547.         .msg x op $chan
  548.         set -u30 $+(%,reqop.,$cid,.,$chan) 1
  549.       }
  550.       elseif ($gsurge) && (%gs.autorecmode) && (ChanServ ison $chan) && (!%reqop. [ $+ [ $cid ] $+ ] . [ $+ [ $chan ] ]) {
  551.         .msg chanserv $chan op $me
  552.         set -u30 $+(%,reqop.,$cid,.,$chan) 1
  553.       }
  554.     }
  555.   }
  556. }
  557. ; ––––––––––––––––––––––––––––––––––––––––
  558. ; End of file
  559. ; ––––––––––––––––––––––––––––––––––––––––