[script]
n0=on ^*:notice:*:#:{
n1=  ;/echo 3 -a ^notice# $chan $nick $1-
n2=  if ($istok($remove($level($mask($fulladdress,3)),$chr(61)),40,44) == $true) { if ($me isop $chan) { mode $chan -o+bb $nick $wildsite $mask($fulladdress,3) | kick $chan $nick $isset($r.shit($mask($fulladdress,3)),No Reason Specified) (Shitlisted) | aecho $nick $bracket($address) is going to be removed from $c(2) $+ $chan $+ $c(1) $+ . $bracket(Shitlisted) } }
n3=  if ($1) {
n4=    ;goto end    
n5=    set %~reply $nick
n6=    ;/echo 3 -a OpChat
n7=    if ($left($target,1) == @) && ($r.set(Opfunctions,OpNoticeWin) == on) {
n8=      var %opchan Opchat. $+ $right(#,-1)
n9=      if (!$window(%opchan).state) { window -ae @ $+ %opchan }
n10=      echo @ $+ %opchan  $+ $colour(notice) $+ $ts2 - $+ $nick $+ ( $+ $target $+ )- $visible($1-)
n11=    }
n12=    elseif ($r.set(OpFunctions,OpNoticeWin) == On) && ($pos($1-,ping reply,0) == 0) && ($pos($1-,duration:,0) == 0) && ($pos($ts2,chanserv,0) == 0) {
n13=      set %opmsgchan $nick
n14=      /var %~opmsgchan = $strip($1)
n15=      ;/echo 12 -a %opmsgchan , %~opmsgchan
n16=      if ($pos(%~opmsgchan,$chr(64),0) > 0) && ($pos(%~opmsgchan,$chr(35),0) > 0) {
n17=        %~opmsgchan = $remove(%~opmsgchan,$chr(64),$chr(58),$chr(40),$chr(41))
n18=        if (%~opmsgchan) && ($me ison %~opmsgchan) { %opmsgchan = %~opmsgchan }
n19=      }
n20=      elseif ($pos($1,Ops,0) > 0) && ($pos($3,$chr(35),0) > 0) {
n21=        /var %~opmsgchan = $strip($3)
n22=        %~opmsgchan = $gettok(%~opmsgchan,1,40)
n23=        %~opmsgchan = $remove(%~opmsgchan,$chr(64),$chr(58),$chr(40),$chr(41))
n24=        if (%~opmsgchan) && ($me ison %~opmsgchan) { %opmsgchan = %~opmsgchan }
n25=      }
n26=      elseif ($pos($1-,flood detect,0) == 0) {
n27=        set %opmsgname @OpChat $+ - $+ %opmsgchan
n28=        if (!$window(%opmsgname).state) { /window -ae %opmsgname }
n29=        echo $colour(notice) %opmsgname $chr(91) $+ [ $time(HH:nn) ] $+ $chr(93) - $+ $nick $+ $chr(40) $+ $chr(64) $+ %~opmsgchan $+ $chr(41) $+ - $visible($1-)
n30=      }
n31=      :end
n32=    }
n33=    ;    if ($chan != $active) && (($active == Status Window) || ($me ison $active) || ($query($active))) { echo $colour(notice) -a $ts2 - $+ $nick $+ ( $+ $target $+ )- $visible($1-) }
n34=    else { echo $colour(notice) $chan $ts2 - $+ $nick $+ ( $+ $target $+ )- $visible($1-) }
n35=  }
n36=  ;/echo 12 -a ^notice# $nick $1-
n37=  haltdef
n38=}
n39=
n40=on ^*:notice:*:?:{
n41=  var %~ticks $ticks
n42=  ;/echo 12 -a ^notice? $nick $1-
n43=  if ($nick == Nickserv) && ($1 $2 $3 == Password accepted for) || ($1 $2 $3 $4 == You are already identified)  || ($1 $2 $3 $4 == You have already identified) {
n44=    set %~identified. [ $+ [ $cid ] ] $addtok(%~identified. [ $+ [ $cid ] ],$me,32)
n45=    if (%~auto.time > 0) {
n46=      aecho Identified to NickServ in $sduration($calc(( $ticks - %~auto.time) / 1000)) for $network
n47=      if ($active != status window) { secho Identified to NickServ in $sduration($calc(( $ticks - %~auto.time) / 1000)) }
n48=      unset %~auto.time
n49=    }
n50=  }
n51=  elseif ($nick == ChanServ) && ($r.set(OpFunctions,OpAKickDlg) == On) {
n52=    if ($pos($1-,access for,0) > 0) && ($pos($1-,changed from,0) > 0) {
n53=      set %~oliststat $strip($1-)
n54=      if ($10 == sop) { /timeroplist 1 3 /chanserv aop %~olistchan list }
n55=      else { /timeroplist 1 3 /chanserv sop %~olistchan list }
n56=      if ($active != status) { secho $1- }
n57=      else { aecho $1- }
n58=      halt
n59=    }
n60=    elseif ($pos($1-,removed from,0) > 0) && ($pos($1-,akick list,0) > 0) {
n61=      set %~oliststat $strip($1-)
n62=      /timerklist 1 3 /chanserv akick %~olistchan list
n63=      if ($active != status) { secho $1- }
n64=      else { aecho $1- }
n65=      halt
n66=    }
n67=    elseif ($pos($1-,added to,0) > 0) && ($pos($1-,akick list,0) > 0) {
n68=      set %~oliststat $strip($1-)
n69=      /timerklist 1 3 /chanserv akick %~olistchan list
n70=      if ($active != status) { secho $1- }
n71=      else { aecho $1- }
n72=      halt
n73=    }
n74=    elseif ($pos($1-,removed from,0) > 0) && ($pos($1-,op list,0) > 0) {
n75=      set %~oliststat $strip($1-)
n76=      if ($8 == sop) { /timeroplist 1 3 /chanserv sop %~olistchan list }
n77=      else { /timeroplist 1 3 /chanserv aop %~olistchan list }
n78=      if ($active != status) { secho $1- }
n79=      else { aecho $1- }
n80=      halt
n81=    }
n82=    elseif ($pos($1-,added to,0) > 0) && ($pos($1-,op list,0) > 0) {
n83=      set %~oliststat $strip($1-)
n84=      if ($8 == sop) { /timeroplist 1 3 /chanserv sop %~olistchan list }
n85=      else { /timeroplist 1 3 /chanserv aop %~olistchan list }
n86=      if ($active != status) { secho $1- }
n87=      else { aecho $1- }
n88=      halt
n89=    }
n90=    elseif ($pos($1-,akick list for,0) > 0) {
n91=      unset %~olistname*
n92=      set %~olistchan $strip($4)
n93=      set %~olisttitle AKick $2 $3 %~olistchan
n94=      if ($active != status) { secho $1- }
n95=      else { aecho $1- }
n96=      halt
n97=    }
n98=    elseif ($pos($1-,op list for,0) > 0) {
n99=      unset %~olistname*
n100=      set %~olistchan $strip($4)
n101=      if ($1 == aop) { set %~olisttitle AOP $2 $3 %~olistchan | set %~olistbtn ->SOP }
n102=      else { set %~olisttitle SOP $2 $3 %~olistchan | set %~olistbtn ->AOP }
n103=      if ($active != status) { secho $1- }
n104=      else { aecho $1- }
n105=      halt
n106=    }
n107=    elseif ($1 isnum) {
n108=      set %~olistnum $1
n109=      set %~olistname $+ [ %~olistnum ] $3-
n110=      if ($active != status) { secho $1- }
n111=      else { aecho $1- }
n112=      halt
n113=    }
n114=    elseif ($pos($1-,end of list,0) > 0) {
n115=      if ($pos(%~olisttitle,akick,0) > 0) {
n116=        if (%~oliststat) && (%~oliststat != "") {
n117=          if ($pos(%~oliststat,added to,0) > 0) { %~olisttitle = %~olisttitle - $gettok(%~oliststat,1,32) added }
n118=          elseif ($pos(%~oliststat,removed from,0) > 0) { %~olisttitle = %~olisttitle - $gettok(%~oliststat,1,32) removed }
n119=        }
n120=        /dialog -m viewklist viewklist
n121=      }
n122=      else {
n123=        if (%~oliststat) && (%~oliststat != "") {
n124=          %~oliststat = $replace(%~oliststat,aop,AOP)
n125=          %~oliststat = $replace(%~oliststat,sop,SOP)
n126=          if ($pos(%~oliststat,added to,0) > 0) { %~olisttitle = %~olisttitle - $gettok(%~oliststat,1,32) added to $gettok(%~oliststat,8-9,32) }
n127=          elseif ($pos(%~oliststat,removed from,0) > 0) { %~olisttitle = %~olisttitle - $gettok(%~oliststat,1,32) removed from $gettok(%~oliststat,8-9,32) }
n128=          elseif ($pos(%~oliststat,changed from,0) > 0) { %~olisttitle = %~olisttitle - $gettok(%~oliststat,3,32) $gettok(%~oliststat,6-,32) }
n129=        }
n130=        /dialog -m viewolist viewolist
n131=      }
n132=      if ($active != status) { secho $1- }
n133=      else { aecho $1- }
n134=      halt
n135=    }
n136=  }
n137=  elseif ($nick == MemoServ) && ($r.set(OpFunctions,MemoDlg) == On) {
n138=    if ($pos($1-,new memo,0) > 0) {
n139=      set -u30 %~readmemos 1
n140=      set %~memonum $gettok($1-,3,32)
n141=      .timerlistmemo 1 3 .memoserv LIST
n142=      aecho $1- | halt
n143=    }
n144=    elseif ($pos($1-,memo list for,0) > 0) { unset %~memofrom* }
n145=    elseif ($gettok($1-,1,32) == purged) && ($gettok($1-,3,32) == memos) { if ($gettok($1-,2,32) != 0) { .timerlistmemo 1 3 .memoserv LIST } | aecho $1- | halt }
n146=    elseif ($gettok($1-,1,32) == memo) && ($gettok($1-,3,32) == from) { set %~memoread $gettok($1-,2,32) | set %~memof $4 | %~memof = $left(%~memof,-1) }
n147=    elseif ($right($1-,3) == GMT) {
n148=      set %~memonum $gettok($1-,1,32)
n149=      set %~memofroms $2-
n150=      set %~memofromt ·
n151=      if ($left($1,1) == d) {
n152=        set %~memofromt ×
n153=        %~memonum = $right(%~memonum,-1)
n154=      }
n155=      if ($left($1,1) == *) {
n156=        set %~memofromt *
n157=        %~memonum = $right(%~memonum,-1)
n158=      }
n159=      %~memofroms = $gettok(%~memofroms,1,32) %~memofromt $gettok(%~memofroms,2-,32) %~memofromt
n160=      set %~memofrom $+ [ %~memonum ] %~memofroms
n161=    }
n162=    elseif ($pos($1-,end of memo,0) > 0) && (%~memodolist == 1) {
n163=      if (%~viewy != 0) { /dialog -x pickmemo }
n164=      ;set %~memodolist 0
n165=      set %~viewy 40 | if (%~memonum) { %~viewy = %~viewy + $calc(%~memonum * 30) } | /dialog -m pickmemo pickmemo
n166=    }
n167=    elseif ($pos($1-,marked as deleted,0) > 0) && (%~memodolist == 1) { .timerlistmemo 1 3 .memoserv LIST }
n168=    elseif ($pos($1-,you have no,0) != 0) { aecho $1- | halt }
n169=    elseif ($gettok($1-,1,32) != memo) && ($gettok($1-,3,32) != from) && ($pos($1-,end of memo,0) == 0) && (%~memonum > 0) && (%~readmemos == 1) {
n170=      if (!%~memotitle) || (%~memotitle == "") { set %~memotitle %~memof }
n171=      set %~memotext $1-
n172=      /dialog -m viewmemo viewmemo
n173=    }
n174=    if ($active != status) { secho $1- }
n175=    else { aecho $1- }
n176=    halt
n177=  }
n178=  elseif ($istok($remove($level($mask($fulladdress,3)),$chr(61)),40,44) == $true) { .notice $nick You were shitlisted, you've just been added to my ignore list! $slogox | close -m $nick | .ignore -pntiu60 $wildsite | aecho $nick $bracket($address) has been put on ignore. $bracket(Shitlisted) }
n179=  else {
n180=    set %~reply $nick
n181=    if (($r.set(Personal.Flood.Protection,Notice) == On) && ($isnum($r.set(Personal.Flood.Protection,Notice.Lines)) == $true) && ($isnum($r.set(Personal.Flood.Protection,Notice.Interval)) == $true) && ($isnum($r.set(Personal.Flood.Protection,Ignore.Time)) == $true) && ($gnick($nick) == $true) && ($nick != $me) && ($host != $site)) {
n182=      inc %~pflood-notice. [ $+ [ $replace($site,*,_,?,_) ] ] 1
n183=      if (%~pflood-notice. [ $+ [ $replace($site,*,_,?,_) ] ] >= $r.set(Personal.Flood.Protection,Notice.Lines)) {
n184=        close -m $nick | .ignore -pntiu [ $+ [ $r.set(Personal.Flood.Protection,Ignore.Time) ] ] $wildsite
n185=        .notice $nick $c(1) $+ Notice flood detected, protection enabled. $bracket($r.set(Personal.Flood.Protection,Notice.Lines),lines within,$r.set(Personal.Flood.Protection,Notice.Interval),second interval per line) $slogox
n186=        aecho $nick $bracket($address) was put on ignore for $r.set(Personal.Flood.Protection,Ignore.Time) seconds for Notice flooding you.  To unignore $nick press $c(2) $+ Control+F6 $+ $c(1) now! $bracket($r.set(Personal.Flood.Protection,Notice.Lines),lines within,$r.set(Personal.Flood.Protection,Notice.Interval),second interval per line)
n187=      }
n188=      utimer ~pflood-notice. [ $+ [ $replace($site,*,_,?,_) ] ] $r.set(Personal.Flood.Protection,Notice.Interval)
n189=    }
n190=    if (%~pflood-notice. [ $+ [ $replace($site,*,_,?,_) ] ] < $r.set(Personal.Flood.Protection,Notice.Lines)) || (!%~pflood-notice. [ $+ [ $replace($site,*,_,?,_) ] ]) {
n191=      if (($r.set(Auto.ID,Status) == On) && (($nick == NickServ) || (services isin $nick) || ($nick == ChanServ)) && (($pos($1-,This nick,0) > 0) || ($pos($1-,do not have access to op,0) > 0))) { 
n192=        if (%opretry < 6) && (!%~autoident. [ $+ [ $cid ] ]) { 
n193=          aecho Auto-Identifyng to nickserv on $network $+ .
n194=          doidentify 
n195=          set -u60 %~autoident. [ $+ [ $cid ] ] 1
n196=        }
n197=      }
n198=      if (($away == $true) && ($r.set(Away,Auto.Reply) == On) && ($nick != $me) && ($gnick($nick) == $true) && ($1 != XDCC) && (!%~idle. [ $+ [ $nick ] ]) && ($idle > 60)) { .notice $nick $bracket(Away) $away.time $away.reason $away.pager $slogox | set %~idle. [ $+ [ $nick ] ] 1 | .timer 1 10 unset %~idle. [ $+ [ $nick ] ] }
n199=      if (($nick == ChanServ) && ($pos($1-,Any bans against,0) > 0)) {
n200=        if ($gettok($1-,4,32) == $me) {
n201=          /var %~unbanchan = $gettok($1-,6,32)
n202=          if ($me !ison %~unbanchan) { /join %~unbanchan }
n203=        }
n204=      }
n205=    }
n206=  }
n207=  if ($r.set(OpFunctions,OpNoticeWin) == On) && ($pos($1-,ping reply,0) == 0) && ($pos($1-,duration:,0) == 0) && ($pos($ts2,chanserv,0) == 0) {
n208=    /var %~opnochan = $numtok(%~meonchans. [ $+ [ $server ] ],44)
n209=    :checkopno
n210=    if (%~opnochan > 0) {
n211=      /var %~opnochans = $gettok(%~meonchans. [ $+ [ $server ] ],%~opnochan,44)
n212=      if ($nick isop %~opnochans) { goto opnok }
n213=      dec %~opnochan
n214=      goto checkopno
n215=    }
n216=    :opnok
n217=    ;echo 7 -s %~opnochans , %~opnochan , $nick , $r.set(OpFunctions,UserWin)
n218=    if ((%~opnochan == 0) && ($r.set(OpFunctions,UserWin) == On)) || ((%~opnochan > 0) && ($r.set(OpFunctions,PvtOpWin) == On)) {
n219=      set %opmsgchan $nick
n220=      if (($right(%opmsgchan,4) != serv) || ($r.set(OpFunctions,ServiceWin) == On)) {
n221=        if ($1 != DCC) && ($pos($1-,Auto Op,0) == 0) && ($findtok($1-,send,0,32) == 0) && ($findtok($1-,sending,0,32) == 0) && ($findtok($1-,sent,0,32) == 0) && ($findtok($1-,flood detect,0,32) == 0) {
n222=          if ($pos($1,Ops,0) > 0) && ($pos($3,$chr(35),0) > 0) {
n223=            /var %~opmsgchan = $strip($3)
n224=            %~opmsgchan = $gettok(%~opmsgchan,1,40)
n225=            %~opmsgchan = $remove(%~opmsgchan,$chr(64),$chr(58),$chr(40),$chr(41))
n226=            if (%~opmsgchan) && ($me ison %~opmsgchan) { %opmsgchan = %~opmsgchan }
n227=          }
n228=          set %opmsgname @OpChat $+ - $+ %opmsgchan
n229=          if (!$window(%opmsgname).state) { /window -ae %opmsgname }
n230=          echo $colour(notice) %opmsgname $chr(91) $+ [ $time(HH:nn) ] $+ $chr(93) - $+ $nick $+ - $visible($1-)
n231=          haltdef
n232=        }
n233=      }
n234=    }
n235=  }
n236=  ;echo -s End of checks Notice time: $calc($ticks - %~ticks) $+ ms
n237=  if ($comchan($nick,0) > 0) {
n238=    ecomc $colour(notice) $nick $ts2 - $+ $nick $+ - $visible($1-)
n239=  }
n240=  ;echo -s End of echo Notice time: $calc($ticks - %~ticks) $+ ms
n241=  var %~textstrip = $strip($1-,burc)
n242=  if ($pos(%~textstrip,trigger,0) > 0) && ($pos(%~textstrip,sends,0) > 0) && (($pos(%~textstrip,serve,0) > 0) || ($pos(%~textstrip,TDCC,0) > 0)) {
n243=    if ($me ison %~list.countchan) {
n244=      if ($locate.item($1-).triggers != ?) {
n245=        var %temp = $setchantrigger.silent(%~list.countchan,$nick,$locate.item($1-).queues,$locate.item($1-).min_cps,$locate.item($1-).triggers)
n246=      }
n247=      elseif ($locate.item($1-).trigger != ?) {
n248=        var %temp = $setchantrigger.silent(%~list.countchan,$nick,$locate.item($1-).queues,$locate.item($1-).min_cps,$locate.item($1-).trigger)
n249=      }
n250=    }
n251=  }
n252=  if ($nick !ison $active) && (($active == Status Window) || ($me ison $active) || ($query($active))) { echo $colour(notice) -a $ts2 - $+ $nick $+ - $visible($1-) }
n253=  if (!$comchan($nick,1)) && ($active != Status Window) { echo $colour(notice) -s $ts2 - $+ $nick $+ - $visible($1-) }
n254=  if ((%~list.count == on) && ($nick ison %~list.countchan)) { 
n255=  if ($hfind(!list.summary,$nick,0) == 0) { hadd !list.summary $nick | .timer!list.summary 1 15 show.!list.summary } }
n256=  ;/echo 12 -a ^Notice?
n257=  ;echo -s End of event Notice time: $calc($ticks - %~ticks) $+ ms
n258=  haltdef
n259=}
n260=on *:dialog:viewmemo:*:*:{
n261=  if ($devent == init) {
n262=    /did -ra $dname 1 %~memotext
n263=  }
n264=  if ($devent == sclick) {
n265=    if ($did == 497) { .memoserv SEND $gettok(%~memotitle,1,32) $$?="Reply Message" }
n266=    if ($did == 498) { .memoserv DEL %~memoread }
n267=    /dialog -x viewmemo
n268=  }
n269=}
n270=Dialog viewmemo {
n271=  title %~memotitle
n272=  size -1 -1 400 150
n273=  text "", 1, 5 10 385 130
n274=  button "Reply", 497, 65 122 80  25, cancel
n275=  button "Delete", 498, 160 122 80  25, cancel
n276=  button "Cancel", 499, 255 122 80 25, cancel
n277=}
n278=on *:dialog:viewolist:*:*:{
n279=  if ($devent == init) {
n280=    /unset %~olistsel
n281=    /var %~viewm 0
n282=    :viewloop
n283=    inc %~viewm
n284=    set %~olistf %~olistname [ $+ [ %~viewm ] ]
n285=    if (%~olistf) && (%~olistf != "") {
n286=      /did -a $dname 10 %~olistf
n287=      goto viewloop
n288=    }
n289=    /did -ra $dname 495 %~olistbtn
n290=    if (%~olistbtn == ->AOP) { /did -ra $dname 498 List AOP }
n291=    else { /did -ra $dname 498 List SOP }
n292=  }
n293=  if ($devent == sclick) {
n294=    if ($did == 10) {
n295=      set %~olistsel $did(10,1).sel
n296=      set %fname $did(10,%~olistsel)
n297=      ;/memoserv READ %fsel
n298=    }
n299=    if ($did == 495) {
n300=      if (%~olistsel) {
n301=        if (%~olistbtn == ->AOP) {
n302=          /chanserv AOP %~olistchan ADD $gettok(%fname,1,32)
n303=        }
n304=        else {
n305=          /chanserv SOP %~olistchan ADD $gettok(%fname,1,32)
n306=        }
n307=        /dialog -x viewolist
n308=      }
n309=    }
n310=    if ($did == 496) {
n311=      /dialog -x viewolist
n312=      if (%~olistbtn == ->AOP) { /chanserv SOP %~olistchan ADD $$?="Enter Nick/Mask" }
n313=      else { /chanserv AOP %~olistchan ADD $$?="Enter Nick/Mask" }
n314=    }
n315=    elseif ($did == 497) {
n316=      if (%~olistsel) {
n317=        if (%~olistbtn == ->AOP) { /chanserv SOP %~olistchan DEL $gettok(%fname,1,32) }
n318=        else { /chanserv AOP %~olistchan DEL $gettok(%fname,1,32) }
n319=        /dialog -x viewolist
n320=      }
n321=    }
n322=    elseif ($did == 498) {
n323=      if (%~olistbtn == ->AOP) { /chanserv AOP %~olistchan LIST }
n324=      else { /chanserv SOP %~olistchan LIST }
n325=      /dialog -x viewolist
n326=    }
n327=    if ($did == 499) { /dialog -x viewolist }
n328=  }
n329=}
n330=Dialog viewolist {
n331=  title %~olisttitle
n332=  size -1 -1 400 230
n333=  list 10, 5 10 388 210
n334=  button "->AOP", 495, 5 202 70 25
n335=  button "Add", 496, 85 202 70 25
n336=  button "Delete", 497, 165 202 70 25
n337=  button "List", 498, 245 202 70 25
n338=  button "Cancel", 499, 325 202 70 25, cancel
n339=}
n340=on *:dialog:viewklist:*:*:{
n341=  if ($devent == init) {
n342=    /unset %~olistsel
n343=    /var %~viewm 0
n344=    :viewloop
n345=    inc %~viewm
n346=    set %~olistf %~olistname [ $+ [ %~viewm ] ]
n347=    if (%~olistf) && (%~olistf != "") {
n348=      /did -a $dname 10 %~olistf
n349=      goto viewloop
n350=    }
n351=  }
n352=  if ($devent == sclick) {
n353=    if ($did == 10) {
n354=      set %~olistsel $did(10,1).sel
n355=      set %fname $did(10,%~olistsel)
n356=    }
n357=    if ($did == 496) {
n358=      /chanserv AKICK %~olistchan ADD $$?="Enter Nick/Mask" $$?="Enter Reason" 
n359=      /dialog -x viewklist
n360=    }
n361=    elseif ($did == 497) {
n362=      if (%~olistsel) {
n363=        /chanserv AKICK %~olistchan DEL $gettok(%fname,1,32)
n364=        /dialog -x viewklist
n365=      }
n366=    }
n367=    elseif ($did == 499) { /dialog -x viewklist }
n368=  }
n369=}
n370=Dialog viewklist {
n371=  title %~olisttitle
n372=  size -1 -1 400 230
n373=  list 10, 5 10 388 210
n374=  button "Add", 496, 85 202 70 25
n375=  button "Delete", 497, 165 202 70 25
n376=  button "Cancel", 499, 245 202 70 25, cancel
n377=}
