Basic — File Browser

Basicv09272000 / Basicv09272000 / SYS / events.ini

events.ini — 30.78 KB — Download this file

[script]
n0=on *:DNS:{
n1=  if ($nick) var %dnsnick = $nick
n2=  elseif ($ial($bind(*!*@,$raddress),1)) var %dnsnick = $ifmatch
n3=  elseif ($ial($bind(*!*@,$naddress),1)) var %dnsnick = $ifmatch
n4=  elseif ($ial($bind(*!*@,$iaddress),1)) var %dnsnick = $ifmatch
n5=  if ((($nick) && (%send2ip.nick == $nick)) || (%send2ip.nick != $null)) {
n6=    if (($raddress) && ($iaddress) && (%send2ip.file)) { if ((%msend.delay) && (%msend.nick) && (%msend.file)) multisend² $nick %msend.file | else dcc send $iaddress %send2ip.file }
n7=    else iecho Unable to send to IP of %send2ip.nick | unset %send2ip.* %msend.* | halt
n8=  }
n9=  if ((%dcc.ip) && ($window(@DCC Status))) { if ($raddress) titlebar @DCC Status - %dcc.ip resolved to $raddress | else titlebar @DCC Status - Unable to resolve: %dcc.ip | unset %dcc.ip | halt }
n10=  if ((%clone.ip) && ($window(@Clones))) { if ($raddress) titlebar @Clones - %clone.ip resolved to $raddress | else titlebar @Clones - Unable to resolve: %clone.ip | unset %clone.ip | halt }
n11=  if ((%who.dns) && ($window(@Who Results for))) {
n12=    var %.t = @Who Results for | var %.c = $gettok($window(%.t).title,1,32)
n13=    if ($raddress) titlebar %.t %.c - %who.dns resolved to $raddress | else titlebar %.t %.c - Unable to resolve: %who.dns | unset %who.dns | halt
n14=  }
n15=  if ($format(dns,$address,$iaddress,$naddress,%dnsnick,$raddress)) { _echo $ifmatch | halt }
n16=  if ($raddress == $null) { iecho  $+ $c3 $+ DNS: Unable to resolve $+ $c3 $iif($naddress,$naddress,$iaddress)  $+ $c1 $+ ( $+ $c3 $+ %dnsnick $+  $+ $c1 $+ ) | halt }
n17=  if (%dnsnick) iecho $iaddress  $+ $c3 $+ is resolved to $raddress  $+ $c1 $+ ( $+ $c3 $+ $naddress $+  $+ $c1 $+ : $+ $c3 $+ %dnsnick $+  $+ $c1 $+ )
n18=  else iecho $iaddress  $+ $c3 $+ is resolved to $raddress  $+ $c1 $+ ( $+ $c3 $+ $naddress $+  $+ $c1 $+ )
n19=}
n20=alias ctcp {
n21=  if (($server == $null) || ($1 == $null)) return
n22=  set %last.relsc $1-
n23=  if ($me !ison $1) set %ctcp.nick. $+ $1 TRUE
n24=  else {
n25=    var %c = 1
n26=    while ($nick($1,%c,a)) {
n27=      set %ctcp.nick. $+ $ifmatch TRUE
n28=      inc %c
n29=    }
n30=  }
n31=  if ($2 == PING) .raw PRIVMSG $1 :PING $ticks $+  | elseif ($3 != $null) .raw PRIVMSG $1 : $+ $upper($2) $3- $+  | else .raw PRIVMSG $1 : $+ $upper($2) $+ 
n32=  if (($show) && ($i(ctcps,outgoing) != silent)) { var %-a = - $+ $left($i(ctcps,outgoing),1) | if ($format(ctcp,$1,$2-)) echo %-a $ifmatch | else echo %-a -> $bind(,$c2,[,$c3,ctcp,$c2,$chr(40),,$c3,$1,,$c2,$chr(41),],$c3) $upper($2-) }
n33=}
n34=alias isticks { return $iif((($calc($ctime - $1) > 604800) || ($calc($ctime - $1) < -604800)),$true,$false) }
n35=on *:CTCPREPLY:*:{
n36=  if (($fludd(ctcps,$wildsite,main)) && ($nick != $me)) { unset $_var(ctcp.nick.,$nick) | .ignore $bind(-ntu,$i(ctcps,ignore_time)) $wildsite | iecho Possible CTCPREPLY abuse from $nick  $+ $c1 $+ ( $+ $c3 $+ $address $+  $+ $c1 $+ ) | halt }
n37=  if (($nick != $me) && ($i(ctcps,ctcp_abuse) == on) && ($__var(ctcp.nick.,$nick) != TRUE)) { .ignore $bind(-ntu,$i(ctcps,ignore_time)) $wildsite | iecho Possible CTCPREPLY abuse from $nick  $+ $c1 $+ ( $+ $c3 $+ $address $+  $+ $c1 $+ ) | halt }
n38=  unset $_var(ctcp.nick.,$nick)
n39=  if (($2 isnum) && ($isticks($2)) && ($__var(massping,$nick))) {
n40=    var %pc = $__var(massping,$nick) | unset $_var(massping,$nick)
n41=    inc $_var(masspingchanresult,%pc) $calc(($ticks - $2) / 1000)
n42=    inc $_var(masspingchantotal.2.,%pc)
n43=    var %total = $__var(masspingchantotal.1.,%pc), %current = $__var(masspingchantotal.2.,%pc)
n44=    .timerAvgPing 1 1 emping %pc $__var(masspingchanresult,%pc) $__var(masspingchantotal.2.,%pc) %current %total
n45=    halt
n46=  }
n47=  if (($1 == PING) && ($2 isnum)) {
n48=    if ($isticks($2)) %last.relcr = $calc(($ticks - $2) / 1000) seconds
n49=    else %last.relcr = $duration($calc($ctime - $2))
n50=  }
n51=  else %last.relcr = $iif($len($2),$2-, )
n52=  if (@* iswm $active) %_cr.cmd = echo -stli14 | else %_cr.cmd = echo - $+ $left($i(ctcps,incoming),1) $+ tli14
n53=  if ($format(ctcp_reply,$nick,$address,$1,%last.relcr)) %_cr.cmd $ifmatch | else %_cr.cmd $pre CTCP $+ $c3 $1 reply from $+ $c3 $nick $+ : %last.relcr
n54=  %last.relcr = $nick $address $1 %last.relcr | halt
n55=}
n56=alias -l emping {
n57=  if ($int($calc(($4 * 100) / $5)) >= 75) {
n58=    var %output = Avg. &c3PING reply from&c3 $1 $+ :&c3 $round($div($2,$3),3) $+ s ( $+ $4 $+ / $+ $5 $+ u $int($calc(($4 * 100) / $5)) $+ $chr(37) $+ )
n59=    iecho $replace(%output,&c3,$c3,&c1,$c1)
n60=    unset %massping*
n61=  }
n62=}
n63=on *:INVITE:#:{
n64=  _botnetfld invite $wildsite
n65=  if ($i(no_spam,list)) {
n66=    var %_inv_chan = $ifmatch , %_inv = 1
n67=    while ($comchan($nick,%_inv).op) {
n68=      var %_inv_tmp = $comchan($nick,%_inv)
n69=      if (($nick !isop %_inv_tmp) && (($istok(%_inv_chan,%_inv_tmp,44)) || (%_inv_chan == main))) .raw MODE %_inv_tmp +b $wildsite $+ $lf $+ KICK %_inv_tmp $nick :Invites suck!
n70=      inc %_inv
n71=    }
n72=  }
n73=}
n74=on *:KICK:#:_eventsound Kick
n75=on *:NICK:{
n76=  if ($nick == $me) { update.self-address $newnick | var %b = $i(main,permnick) | if (($i(main,nickregain) == on) && ($newnick == %b) && (%b isnotify)) .notify -r %b }
n77=  else {
n78=    if ( %§opch. [ $+ [ $nick ] ] ) %§opch. [ $+ [ $newnick ] ] = $ifmatch | if ( %§user. [ $+ [ $nick ] ] ) %§user. [ $+ [ $newnick ] ] = $ifmatch
n79=    unset %§*. [ $+ [ $nick ] ] | _botnetfld nick $wildsite | _eventsound Nick
n80=  }
n81=}
n82=on *:NOTICE:*:*:_botnetfld notice $wildsite $target
n83=on *:TEXT:*:#:_botnetfld text $wildsite #
n84=on *:TEXT:*:?:checkautoget $nick $1-
n85=on *:ACTION:*:#:_botnetfld text $wildsite #
n86=alias -l _vsplit if ((// !isin $1-) && (.. !isin $1-) && (! !isin $1-) && ([ !isin $1-) && (] !isin $1-) && ( !isin $1-) && ( !isin $1-) && ( !isin $1-) && (*www* !iswm $1-)) return 1
n87=on ^*:QUIT:{
n88=  autocycle | _eventsound Quit
n89=  if (($query($nick)) && ($istok($i(windows,autoclose),on_quit,32))) close -m $nick
n90=  if (%netsplit === ON) {
n91=    if ((*.* iswm $1) && (*.* iswm $2) && ($3 == $null) && ($_vsplit($1-))) {
n92=      if ($_isfile($__var(netsplitfile.,$server))) var %tmpfile = $ifmatch
n93=      else { set %netsplitfile. $+ $server ns $+ $ticks $+ .$$$ | var %tmpfile = $__var(netsplitfile.,$server) }
n94=      write %tmpfile $nick $address $2
n95=      if ($gettok($2,1,46) != *) %split.jump = $2
n96=      if ( %^netsplit. [ $+ [ $2 ] ] ) { .timer. [ $+ [ $2 ] ] 1 10 unset %^netsplit. [ $+ [ $2 ] ] | halt }
n97=      set %^netsplit. $+ $2 $true
n98=      iecho Netsplit detected $bind(,$c1,$chr(40),,$c3,$atime,,$c1,$chr(41),) at $bind(,$c1,$2,.) $fcom(/wholeft) $bind(,$c3,$fkey(/wholeft),) to see who split.
n99=      if (* !isin $2) iecho $fcom(/jump) $bind(,$c3,$fkey(/jump),) to join $bind(,$c3,$2,.)
n100=      halt
n101=    }
n102=  }
n103=  unset $_var(§*.,$nick) $_var(§*.,$address($nick,3),.*)
n104=}
n105=on *:JOIN:#:{
n106=  if ($nick == $me) { unset $_var(§exempt.*.,$chan) | set %onjoin.hidemode. $+ $chan $true | unset %sc. [ $+ [ $chan ] ] %nameshow_II. [ $+ [ $chan ] ] | goto end }
n107=  var %nfile = $__var(netsplitfile.,$server)
n108=  if ($isfile(%nfile)) {
n109=    %.split.check = $read -ns $nick %nfile
n110=    if (%.split.check) {
n111=      echo -lti $chan $pre Netjoin detected on  $+ $c3 $+ $nick at  $+ $c1 $+ ( $+ $c3 $+ $atime $+  $+ $c1 $+ )
n112=      unset $_var(^netsplit.,$gettok(%.split.check,2-,32)) $_var(netsplitfile.,$server)
n113=      .remove %nfile | goto end
n114=    }
n115=  }
n116=  if ($me isop $chan) { if ($istok($__var(§user.,$nick),$chan,44)) goto end | set $_var(§user.,$nick) $addtok($__var(§user.,$nick),$chan,44) }
n117=  _botnetfld join $wildsite # | :end | _eventsound Join
n118=}
n119=on *:PART:#:{
n120=  autocycle #
n121=  if ($sub($numtok($__var(§user.,$nick),44),1) == 0) unset $_var(§user.,$nick) | else set $_var(§user.,$nick) $remtok($__var(§user.,$nick),$chan,44)
n122=  if ($sub($numtok($__var(§opch.,$nick),44),1) == 0) unset $_var(§opch.,$nick) | else set $_var(§opch.,$nick) $remtok($__var(§opch.,$nick),$chan,44)
n123=  if ($nick == $me) unset $_var(§exempt.*.,$chan) | else unset $_var(§exempt.,$address($nick,3),.,$chan)
n124=}
n125=on @*:VOICE:#:set $_var(§exempt.,$address($opnick,3),.,$chan) $true
n126=on *:OP:#:{
n127=  if ($opnick == $me) {
n128=    var %s = 1
n129=    while ($nick($chan,%s)) {
n130=      %§name = $ifmatch
n131=      set $_var(§user.,%§name) $addtok($__var(§user.,%§name),$chan,44)
n132=      if (%§name isop $chan) {
n133=        set $_var(§opch.,%§name) $addtok($__var(§opch.,%§name),$chan,44)
n134=        set $_var(§exempt.,$address(%§name,3),.,$chan) $true
n135=      }
n136=      if (%§name isvo $chan) set $_var(§exempt.,$address(%§name,3),.,$chan) $true
n137=      inc %s
n138=    }
n139=  }
n140=  else set $_var(§exempt.,$address($opnick,3),.,$chan) $true
n141=}
n142=on *:INPUT:#:if (((/+* iswm $1) || (/-* iswm $1-)) && ($ctrlenter == $false)) { mode # $remove($1-,/) | halt }
n143=on ^*:CHAT:* {
n144=  if ((SOUND isin $1) || (MP3 isin $1)) {
n145=    if (($_mopt(3,20)) && (($inmidi) || ($inwave))) halt
n146=    var %cs1 = $nopath($remove($2-,)), %x = 0
n147=    var %cs2 = $replace(%cs1,?,_), %cs3 = $replace(%cs1,?,-), %cs4 = $replace(%cs1,?,$chr(32))
n148=    iecho $nick has played %cs1
n149=    if ($nosound(%cs1)) goto end
n150=    if ($findfile($_sounddir(-1,%cs1),$replace(%cs1,-,?,_,?),1)) { splay $ifmatch | goto end² }
n151=    :loop
n152=    inc %x
n153=    if (%x > 4) goto end
n154=    var %f = %cs [ $+ [ %x ] ]
n155=    if ($_isfile($_sounddir(%f))) { splay %f | goto end² }
n156=    goto loop
n157=    :end
n158=    if ($_mopt(3,21)) { iecho Sound request: %cs1 does not exist | if ($_mopt(1,23)) .msg =$nick ! $+ $nick %cs1 }
n159=    :end²
n160=    halt
n161=  } 
n162=  elseif (((PING isin $1) || ($1 === PING)) && ($remove($2,) isnum)) { 
n163=    if ($__var(dcc.ping.,$nick)) halt 
n164=    set -u15 $_var(dcc.ping.,$nick) 1
n165=    .msg =$nick PONG $2-
n166=    halt
n167=  }
n168=}
n169=alias ovdock {
n170=  if ($window(@Oper-view) == $null) ov on
n171=  var %.oldwin = @Oper-view, %.ovwin = @Oper-view.2, %.ovswitches = $iif($i(windows,oview.dock) == off,+f,+flts)
n172=  _set windows oview.dock $iif(%.ovswitches == +f,on,off)
n173=  window -k %.ovswitches %.ovwin $_winstat1(%.oldwin) %.oldwin
n174=  filter -wwp %.oldwin %.ovwin *
n175=  close -@ %.oldwin
n176=  renwin %.ovwin %.oldwin
n177=}
n178=alias bhelp {
n179=  if ($istok(Courier.Courier New.Fixedsys.Terminal.IBMPC.GwdTE_437,$i(display,font),46) == $false) { help Basic Commands | return }
n180=  var %temp.1 = $_readini(help.txt,topics,1), %temp.3 = $_readini(help.txt,topics,2)
n181=  if ($1 == $null) {
n182=    var %temp.topics = $sorttok(%temp.1,32), %temp.2, %x = 1
n183=    :loop
n184=    while ($gettok(%temp.topics,%x,32)) {
n185=      var %temp.2 = %temp.2 $align(10,$upper($ifmatch))
n186=      if ($numtok($strip(%temp.2),32) == 5) { iecho %temp.2 | var %temp.2 }
n187=      inc %x
n188=    }
n189=    if (%temp.3) { var %temp.topics = $sorttok(%temp.3,32), %temp.3, %x = 1 | goto loop }
n190=    if (%temp.2) iecho %temp.2
n191=    iecho Usage: /BHELP [COMMAND] to get help on specific commands
n192=  }
n193=  elseif (($istok(%temp.1,$1,32) == $false) && ($istok(%temp.3,$1,32) == $false)) iecho No help available for $1
n194=  else {
n195=    var %temp.help = $_readini(help.txt,commands,$1), %e = echo $iif(@* iswm $active,-sh,-ah)
n196=    var %temp.help.1 = $gettok(%temp.help,1,59), %temp.help.2 = $gettok(%temp.help,2,59)
n197=    %e $pre Usage: $clr(%temp.help.1)   
n198=    %e $x(9) - %temp.help.2 
n199=    var %i = 3, %x = $x(9)
n200=    while ($gettok(%temp.help,%i,59)) { echo -ai14 %x - $ifmatch | inc %i }
n201=  }
n202=}
n203=dialog help {
n204=  title "Basic Help"
n205=  size -3 -3 243 170
n206=  option dbu
n207=  tab "General", 6, 3 1 80 150
n208=  tab "Commands", 7
n209=  button "&Close", 1, 185 155 50 12, cancel
n210=  text "Contents:", 2, 10 18 25 7, tab 6
n211=  list 3, 8 25 72 130, autovs autohs, tab 6
n212=  edit "",4, 85 19 155 133, read multi vsbar
n213=  check "Always open desktopped.", 5, 5 158 100 7
n214=  text "Contents:", 8, 10 18 25 7, tab 7
n215=  list 9, 8 25 72 130, autovs autohs sort tab 7
n216=}
n217=alias callhelp if ($dialog(help) == $null) dialog $iif($i(windows,HelpDesktop),-md,-m) help help
n218=alias help {
n219=  if (/* iswm $1)  {
n220=    var %topic1 = $readini -n sys\help.txt topics 1, %topic2 = $readini -n sys\help.txt topics 2
n221=    if (($istok(%topic1,$remove($1,/),32)) || ($istok(%topic2,$remove($1,/),32))) {
n222=      callhelp
n223=      var %v = $readini -n sys\help.txt commands $remove($1,/), %i = 1
n224=      did -a help 4 Usage: $crlf $crlf
n225=      while ($gettok(%v,%i,59)) {
n226=        var %s = $ifmatch, %o = $wildtok($ifmatch,/*,1,32)
n227=        did -a help 4 $replace(%s,%o,$upper(%o)) $crlf $crlf
n228=        inc %i
n229=      }
n230=    }
n231=    else help $1-
n232=  }
n233=  else {
n234=    if ($1 == basic) { callhelp | return }
n235=    if ($1- == What's New?) { if ($findfile($mircdir,changes.txt,1)) { .timer 1 0 loadbuf -o help 4 $ifmatch | callhelp | did -r help 4 | dialog -v help } | return }
n236=    var %topic = $replace($1-,$chr(32),_)
n237=    if (($initopic(sys\help.txt,%topic)) && (%topic != commands) && (%topic != topics)) { .timer 1 0 loadbuf -ot [ $+ [ %topic ] ] help 4 sys\help.txt | callhelp | did -r help 4 | if ($didwm(help,3,$replace($1-,$chr(32),?,_,?))) did -c help 3 $ifmatch | dialog -v help }
n238=    else help $1-
n239=  }
n240=}
n241=on *:DIALOG:help:init:*:{
n242=  didtok help 3 46 About.What's New?.Help on Help. .Addon Manager.Autojoin List.Away Settings.Banned words & nicks.Basic Commands.Channel Modes.Channel Setup.DCC History.DCC Options.Display Settings.Extras.File Locations.Floodnet
n243=  didtok help 3 46 Function Keys.General.Kick Messages.Known Bugs.Log Manager.Miscellaneous.Nick Completion.Personal.Quit Messages.Second Instance.Server List.Sounds.Spam Control.Startup.Themes.Titlebar.Userlist CTCPs.Userlists.Windows
n244=  did $iif($i(windows,HelpDesktop),-c,-u) help 5 | didtok help 9 32 $_readini(help.txt,topics,1) | didtok help 9 32 $_readini(help.txt,topics,2)
n245=}
n246=on *:DIALOG:help:sclick:1:{
n247=  if ($dialog(userlist)) dialog -v userlist
n248=  elseif ($dialog(settings)) dialog -v settings
n249=  elseif ($dialog(cset)) dialog -v cset
n250=  elseif ($dialog(display)) dialog -v display
n251=  elseif ($dialog(lists)) dialog -v lists
n252=  elseif ($dialog(sl)) dialog -v sl
n253=  elseif ($dialog(runmirc)) dialog -v runmirc
n254=  _set windows HelpDesktop $did(5).state
n255=}
n256=on *:dialog:help:sclick:9:did -r $dname 4 | help / $+ $did(9,$did(9).sel)
n257=on *:DIALOG:help:sclick:3:{
n258=  if ($did(3,$did(3).sel) ==  ) return | did -r help 4
n259=  if ($did(3,$did(3).sel) == Basic Commands) {
n260=    did -a help 4 *** Basic Commands *** $crlf $crlf
n261=    var %a = $readini -n sys\help.txt topics 1, %b = $readini -n sys\help.txt topics 2
n262=    var %t = %a, %i = 1
n263=    :do
n264=    while ($gettok(%t,%i,32)) {
n265=      var %c = $ifmatch
n266=      var %z = $readini -n sys\help.txt commands %c
n267=      var %lump, %y = 1
n268=      while ($gettok(%z,%y,59)) {
n269=        var %^ = $ifmatch
n270=        if (%y == 1) var %^ = $upper($gettok(%^,1,32)) $gettok(%^,2-,32)
n271=        var %lump = %lump $crlf %^
n272=        inc %y
n273=      }
n274=      if (%lump) did -a help 4 $gettok(%lump,1,32) $gettok(%lump,2-,32) $str($crlf,2)
n275=      inc %i
n276=    }
n277=    if (%t == %a) {
n278=      var %t = %b, %i = 1
n279=      goto do
n280=    }
n281=  }
n282=  elseif ($did(3,$did(3).sel)) help $ifmatch
n283=}
n284=on *:CLOSE:@:{
n285=  if ($istok(@Away Messages @Ignore list @Ban Stats @Who Results for @DCC @Clones @Scan @DCC History,$target,32)) savewinpos $target
n286=  if ($istok(@Who Results for @Whoresults @Whoresults2,$target,32)) close -@ @Who Results for @whoresults @whotemp @whoresults2
n287=  if ($target == @Clones) unset %clscan.*
n288=}
n289=menu @Awaymsgs {
n290=  &Delete:if ($_cnfrm(Delete away.log?)) remlog
n291=  &Save log...:{
n292=    savebuf $active $logdir $+ awaymessages_ $+ $date(yyyymmdd) $+ .log
n293=    if ($_cnfrm(Close away.log window?)) close -@ $active
n294=  }
n295=  &Font...:font 
n296=  -
n297=  &Close:savewinpos $active | close -@ $active 
n298=}
n299=menu @Oper-View {
n300=  &Disable:ov off
n301=  Dock/&Undock:ov dock
n302=  &Font:font
n303=  -
n304=  &Close:savewinpos $active | close -@ $active
n305=}
n306=alias -l _sline² return $gettok($sline($active,1),$1,9)
n307=alias -l sort_by_size {
n308=  window -slh @kbwin | window -slh @mbwin | window -slh @bwin
n309=  var %type = $1 $+ *, %mb = 0, %kb = 0, %b = 0, %i = 1, %window = @DCC History, %1 = 0, %2 = $calc($fline(%window,$1*,0) * 2)
n310=  _progress Sorting $replace($lower($1),rcvd,received) DCC entries
n311=  while ($line(%window,$fline(%window,%type,%i))) {
n312=    var %s = $ifmatch, %t = $gettok($ifmatch,4,9)
n313=    if (m isin %t) aline @mbwin $addz(%t) %s
n314=    elseif (k isin %t) aline @kbwin $addz(%t) %s
n315=    else aline @bwin $addz(%t) %s
n316=    inc %1 | _progress² %1 %2 | inc %i
n317=  }
n318=  var %Total = $fline(%window,%type,0) , %Base = $fline(%window,%type,1)
n319=  if ($2 == -a) {
n320=    var %window = @mbwin, %i = $line(@mbwin,0)
n321=    :sort.1
n322=    while (%i) {
n323=      if ($line(%window,%i)) rline @DCC History $calc(%Base + %Total - 1) $gettok($ifmatch,2-,32)
n324=      dec %Total
n325=      dec %i
n326=      inc %1 | _progress² %1 %2
n327=    }
n328=    if (%window == @mbwin) { var %window = @kbwin, %i = $line(@kbwin,0) | goto sort.1 }
n329=    if (%window == @kbwin) { var %window = @bwin, %i = $line(@bwin,0) | goto sort.1 }
n330=  }
n331=  else {
n332=    var %window = @bwin, %i = 1
n333=    :sort.2
n334=    while ($line(%window,%i)) {
n335=      if ($ifmatch != $null) rline @DCC History $calc(%Base + %Total - 1) $gettok($ifmatch,2-,32)
n336=      dec %Total | inc %1 | _progress² %1 %2 | inc %i
n337=    }
n338=    if (%window == @bwin) { var %window = @kbwin, %i = 1 | goto sort.2 }
n339=    if (%window == @kbwin) { var %window = @mbwin, %i = 1 | goto sort.2 }
n340=  }
n341=  close -@ @kbwin @mbwin @bwin
n342=}
n343=alias -l addz { tokenize 32 $1- | var %len = $len($gettok($1,1,46)) | if (%len == 1) return 00 $+ $1 | if (%len == 2) return 0 $+ $1 | return $1 }
n344=; /Sort_DCC_Entries <Rcvd|Sent> <Num>
n345=alias -l Sort_DCC_Entries {
n346=  if ($2 == 4) { sort_by_size $1 $3 | return }
n347=  var %Window_1 = @DCC History, %Index = 1, %Window_2 = @ $+ $ticks , %Type = $1 $+ *
n348=  var %Total = $fline(%Window_1,%Type,0) , %Base = $fline(%Window_1,%Type,1)
n349=  var %Counter = $calc(%Total * 2) , %Counter_2 = 0
n350=  if (%Total) _progress Sorting DCC $replace($lower($1),rcvd,received) entries
n351=  window -slh %Window_2
n352=  while ($line(%Window_1,$fline(%Window_1,%Type,%Index))) {
n353=    var %Match = $ifmatch
n354=    aline %Window_2 $gettok(%Match,$2,9) %Match
n355=    inc %Counter_2
n356=    _progress² %Counter_2 %Counter
n357=    inc %Index
n358=  }
n359=  while (%Total) {
n360=    if ($line(%Window_2,%Total)) rline %Window_1 $calc(%Base + %Total - 1) $1 $chr(9) $gettok($ifmatch,2-,9)
n361=    inc %Counter_2
n362=    dec %Total
n363=    _progress² %Counter_2 %Counter
n364=  }
n365=  close -@ %Window_2
n366=}
n367=alias -l remlines {
n368=  var %i = $sline($1,0)
n369=  while ($sline($1,%i).ln) { dline $1 $ifmatch | dec %i }
n370=  savebuf $iif((Rcvd* !iswm $line($1,3)) && (Sent* !iswm $line($1,3)),4-999,3-999) $1 $_dcclog
n371=}
n372=menu @DCC History {
n373=  &Sort entries
n374=  .$iif($fline($active,Rcvd*,2),&Received)
n375=  ..by &Date:Sort_DCC_Entries Rcvd 2
n376=  ..by &Nick:Sort_DCC_Entries Rcvd 3
n377=  ..by &Size
n378=  ...&Ascending:Sort_DCC_Entries Rcvd 4 -a
n379=  ...&Descending:Sort_DCC_Entries Rcvd 4 -d
n380=  ..by &Filename:Sort_DCC_Entries Rcvd 5
n381=  .$iif($fline($active,Sent*,2),&Sent)
n382=  ..by &Date:Sort_DCC_Entries Sent 2
n383=  ..by &Nick:Sort_DCC_Entries Sent 3
n384=  ..by &Size
n385=  ...&Ascending:Sort_DCC_Entries Sent 4 -a
n386=  ...&Descending:Sort_DCC_Entries Sent 4 -d
n387=  ..by &Filename:Sort_DCC_Entries Sent 5
n388=  .$iif($fline($active,Sent*,2) || $fline($active,Rcvd*,2),&All)
n389=  ..by &Date:Sort_DCC_Entries Sent 2 | Sort_DCC_Entries Rcvd 2
n390=  ..by &Nick:Sort_DCC_Entries Sent 3 | Sort_DCC_Entries Rcvd 3
n391=  ..by &Size
n392=  ...&Ascending:Sort_DCC_Entries Sent 4 -a | Sort_DCC_Entries Rcvd 4 -a
n393=  ...&Descending:Sort_DCC_Entries Sent 4 -d | Sort_DCC_Entries Rcvd 4 -d
n394=  ..by &Filename:Sort_DCC_Entries Sent 5 | Sort_DCC_Entries Rcvd 5
n395=  -
n396=  $iif(($_sline3 > 2) && ($_sline),&Open)
n397=  .&Containing folder:{
n398=    if ($_isdir($nofile($_sline²(5-)))) run $remove($ifmatch,")
n399=    else .timer -m 1 0 s.err That folder does not seem to exist anymore.
n400=  }
n401=  .&Selected file:{
n402=    if ($_isfile($_sline²(5-))) _run $remove($ifmatch,")
n403=    else .timer -m 1 0 s.err That file does not seem to exist anymore.
n404=  }
n405=  $iif($fline($active,R*,1) || $fline($active,S*,1),&Remove)
n406=  .$iif($sline($active,0) == 1,&Selected entry):_remsel $_sline3 $active $_sline
n407=  .$iif($sline($active,2),Selected &entries):if (($_sline) && ($_sline3 > 2) && ($_cnfrm(Remove selected entries from the DCC log?))) remlines $active
n408=  .&Obsolete entries:_remob $active
n409=  $iif(($fline($active,R*,1) || $fline($active,S*,1)) && ($_isfile($_sline²(5-))),&Delete file):if ($_cnfrm(Are you sure you want to DELETE this file from your computer? [ $crlf $_sline²(5-) ] )) { .remove " $+ $_sline²(5-) $+ " | s.err Deleted $nopath($_sline²(5-)) "DCC History }
n410=  $iif((($server) && ($_isfile($_sline²(5-)))) || ($mouse.key & 2),S&end to...): var %dcc_file = $gettok($remove($_sline,$chr(9)),5-,32) | set %.dct $inputbox(Specify the nick to send [ %dcc_file ] ) | if (%.dct) dcc send $ifmatch " $+ %dcc_file $+ "
n411=  $iif((($_sline3 > 2) && ($_sline) && ($_isfile($_sline²(5-)) == $null)) || ($mouse.key & 2),&Find...):find $nopath($_sline²(5-))
n412=  $iif((*.wav iswm $_sline²(5-)) || (*.mid iswm $_sline²(5-)) || ($mouse.key & 2),&Preview):if ($_isfile($_sline²(5-))) splay $ifmatch
n413=  $iif($_isfile($_sline²(5-)) || ($mouse.key & 2),&View in notepad):notepad $_sline²(5-)
n414=  $iif($lines($_dcclog),Clear &DCC log):if (($_isfile($_dcclog)) && ($_cnfrm(Remove all entries?))) { .remove $_dcclog | dline $active 3- }
n415=  -
n416=  &Help:help dcc_history
n417=  &Close:savewinpos $active | close -@ $active
n418=}
n419=alias -l _remsel {
n420=  if (($3-) && ($1 > 2) && ($_cnfrm(Remove selected entry from the DCC log?))) {
n421=    if ( $read -ns" $+ $3- $+ " $_dcclog ) write -dl $readn $_dcclog
n422=    dline $2 $1
n423=  }
n424=}
n425=alias -l _remob {
n426=  if ($_cnfrm(Remove obsolete entries from the DCC log? This will remove all entries with files that do not exist anymore.)) {
n427=    var %i = 3, %t = $line($1,0)
n428=    _progress Removing obsolete entries
n429=    write -c dcclog.$$$
n430=    while (%i <= %t) {
n431=      var %r = $line($1,%i)
n432=      if ((%r) && (%r != $x)) { if ($_isfile($gettok($replace(%r,$chr(9),$chr(32)),5-,32))) write dcclog.$$$ %r }
n433=      _progress² %i %t
n434=      inc %i
n435=    }
n436=    .remove $_dcclog | .rename dcclog.$$$ $_dcclog | .remove dcclog.$$$ | _progress² %t %t | dcc_hist
n437=  }
n438=}
n439=menu @DCC Status {
n440=  DCC &windows
n441=  .&Chats
n442=  ..&Hide:_hchat -h
n443=  ..&Show:_hchat -w
n444=  .&Sends
n445=  ..&Hide:_hsend -h
n446=  ..&Show:_hsend -w
n447=  .&Gets
n448=  ..&Hide:_hget -h
n449=  ..&Show:_hget -w
n450=  &DNS IP $iif($sline($active,1).ln > 2, $bind($chr(40),$gettok($remove($_sline,$chr(9)),2,32),$chr(41)) ):{
n451=    set %dcc.ln $remove($_sline,$chr(9)) 
n452=    set %dcc.nick $gettok(%dcc.ln,2,32)
n453=    set %dcc.ln $gettok(%dcc.ln,1,32) 
n454=    if (%dcc.ln == CHAT) set %dcc.ip $chat(%dcc.nick).ip
n455=    elseif (%dcc.ln == SEND) set %dcc.ip $send(%dcc.nick).ip
n456=    elseif (%dcc.ln == GET) set %dcc.ip $get(%dcc.nick).ip
n457=    elseif (%dcc.ln == FSERV) set %dcc.ip $fserv(%dcc.nick).ip
n458=    else return
n459=    .dns %dcc.ip
n460=    titlebar $active - Looking up %dcc.ip ...
n461=  }
n462=  -
n463=  &Close DCC status:savewinpos $active | hsend -w | close -@ $active
n464=}
n465=menu @Clones {
n466=  $iif($linecheck,$_sline2(2)):/
n467=  -
n468=  $iif($linecheck,$mservchk(&Whois)):whois $_sline2(2)
n469=  $iif((($linecheck) && ($me isop %c.chan)),&Control)
n470=  .&Kick:kick %c.chan $_sline2(2) Clones are not allowed in here
n471=  .&Global kban:gkb $_sline2(2) Clones are not allowed in here
n472=  .$iif(*!*@* iswm $_sline2(1),&Filterkick):fk %c.chan $_sline2(1) Clones are not allowed in here
n473=  .$iif(*!*@* iswm $_sline2(1),F&ilterkickban):fkb %c.chan $_sline2(1) Clones are not allowed in here
n474=  .Kick&ban:.raw MODE %c.chan -o+b $_sline2(2) $_sline2(1) $lf KICK %c.chan $_sline2(2) :Clones are not allowed in here
n475=  .&Warn:.notice $_sline2(2) Clones are not allowed in here
n476=  $iif($linecheck,$mservchk(C&TCP))
n477=  .&Ping:ctcp $_sline2(2) ping
n478=  .&Finger:ctcp $_sline2(2) finger
n479=  .&Version:ctcp $_sline2(2) version
n480=  $iif($linecheck,&DNS):set %clone.ip $_sline2(2) | .dns %clone.ip | titlebar $active - Looking up %clone.ip
n481=  -
n482=  $iif($linecheck,$mservchk(&Ignore))
n483=  .&Temporary
n484=  ..&Everything:ignore -u $+ $i(ctcps,ignore_time) $_sline2(1)
n485=  ..C&TCP's:ignore -tu $+ $i(ctcps,ignore_time) $_sline2(1)
n486=  ..&Notices:ignore -nu $+ $i(ctcps,ignore_time) $_sline2(1)
n487=  ..&Invites:ignore -iu $+ $i(ctcps,ignore_time) $_sline2(1)
n488=  ..&Messages:ignore -pu $+ $i(ctcps,ignore_time) $_sline2(1)
n489=  ..&Channel:ignore -cu $+ $i(ctcps,ignore_time) $_sline2(1)
n490=  .&Permanent
n491=  ..&Everything:ignore $_sline2(1)
n492=  ..C&TCP's:ignore -t $_sline2(1)
n493=  ..&Notices:ignore -n $_sline2(1)
n494=  ..&Invites:ignore -i $_sline2(1)
n495=  ..&Messages:ignore -p $_sline2(1)
n496=  ..&Channel:ignore -c $_sline2(1)
n497=  $iif($linecheck,$mservchk(&Shitlist...)):{
n498=    %_clone.sm = $_sline2(1)
n499=    %_clone.sl = $inputbox(Enter banlevel (1-5)"Shitlist)
n500=    if (%_clone.sl !isnum 1-5) halt
n501=    %_clone.sc = $inputbox(Enter channels"Shitlist)
n502=    if (%_clone.sc == $null) %_clone.sc = *
n503=    %_clone.sr = $inputbox(Enter reason for ban"Shitlist)
n504=    addshit %_clone.sl %_clone.sm %_clone.sc %_clone.sr
n505=  }
n506=  -
n507=  &Close:savewinpos $active | close -@ $active
n508=}
n509=alias -l linecheck if (($_sline3 > 2) && ($_sline)) return 1
n510=alias -l _scomch return %=comchan. [ $+ [ $_sline2(1) ] $+ ] . [ $+ [ $1 ] ]
n511=alias setcomchans {
n512=  var %i = 1
n513=  while ($comchan($1,%i).op) {
n514=    set %=comchan. $+ $1 $+ . $+ %i $comchan($1,%i)
n515=    inc %i
n516=  }
n517=}
n518=on *:CLOSE:@Scan:unset %=comchan.*
n519=menu @Scan {
n520=  $iif($_sline3,$bind(&,$_sline2(1))):/
n521=  -
n522=  $iif($_sline3 > 2,&Info)
n523=  .&Whois:whois $_sline2(1)
n524=  .W&hois++:whois $_sline2(1) $_sline2(1)
n525=  .&DNS:dns $_sline2(1)
n526=  $iif($_sline3 > 2,&CTCP)
n527=  .&Ping:ping $_sline2(1)
n528=  .&Finger:ctcp $_sline2(1) finger
n529=  .&Version:ctcp $_sline2(1) version
n530=  .P&age:ctcp $_sline2(1) page
n531=  $iif($_sline3 > 2,&Filter)
n532=  .&Kick from
n533=  ..$_scomch(1):fk $_scomch(1) $_sline2(2)
n534=  ..$_scomch(2):fk $_scomch(2) $_sline2(2)
n535=  ..$_scomch(3):fk $_scomch(3) $_sline2(2)
n536=  ..$_scomch(4):fk $_scomch(4) $_sline2(2)
n537=  ..$_scomch(5):fk $_scomch(5) $_sline2(2)
n538=  ..$_scomch(6):fk $_scomch(6) $_sline2(2)
n539=  ..$_scomch(7):fk $_scomch(7) $_sline2(2)
n540=  ..$_scomch(8):fk $_scomch(8) $_sline2(2)
n541=  ..$_scomch(9):fk $_scomch(9) $_sline2(2)
n542=  ..$_scomch(10):fk $_scomch(10) $_sline2(2)
n543=  ..-
n544=  ..&Specify...:set %comchan.temp $inputbox(Enter channelname) | if (%comchan.temp) fk %comchan.temp $_sline2(2)
n545=  ..&All channels:var %m = $_sline2(1) $+ ! $+ $_sline2(2) | fka $_mask(%m,2)
n546=  .K&ban from
n547=  ..$_scomch(1):fkb $_scomch(1) $_mask($_sline2(2),2)
n548=  ..$_scomch(2):fkb $_scomch(2) $_mask($_sline2(2),2)
n549=  ..$_scomch(3):fkb $_scomch(3) $_mask($_sline2(2),2)
n550=  ..$_scomch(4):fkb $_scomch(4) $_mask($_sline2(2),2)
n551=  ..$_scomch(5):fkb $_scomch(5) $_mask($_sline2(2),2)
n552=  ..$_scomch(6):fkb $_scomch(6) $_mask($_sline2(2),2)
n553=  ..$_scomch(7):fkb $_scomch(7) $_mask($_sline2(2),2)
n554=  ..$_scomch(8):fkb $_scomch(8) $_mask($_sline2(2),2)
n555=  ..$_scomch(9):fkb $_scomch(9) $_mask($_sline2(2),2)
n556=  ..$_scomch(10):fkb $_scomch(10) $_mask($_sline2(2),2)
n557=  ..-
n558=  ..&All channels:var %m = $_sline2(1) $+ ! $+ $_sline2(2) | fkba $_mask(%m,2)
n559=  $iif($_sline3 > 2,Ig&nore)
n560=  .$mask($replace($_sline2(1-2),$chr(32),!),2) :ignore -u [ $+ [ $i(ctcps,ignore_time) ] ] $mask($replace($_sline2(1-2),$chr(32),!),2)
n561=  .$mask($replace($_sline2(1-2),$chr(32),!),3) :ignore -u [ $+ [ $i(ctcps,ignore_time) ] ] $mask($replace($_sline2(1-2),$chr(32),!),3)
n562=  .$mask($replace($_sline2(1-2),$chr(32),!),4) :ignore -u [ $+ [ $i(ctcps,ignore_time) ] ] $mask($replace($_sline2(1-2),$chr(32),!),4)
n563=  .-
n564=  .&Specify...:if ($InputBox(Enter mask type"Ignore user)) ignore -u [ $+ [ $i(ctcps,ignore_time) ] ] $_sline2(1) $ifmatch
n565=  -
n566=  &Close:close -@ @Scan | unset %=comchan.*
n567=}
n568=menu @Ignores {
n569=  $iif($_sline3 > 2,$_sline2(1))
n570=  .$iif($_sline3 > 2,&Unignore)
n571=  ..Compl&ete:.ignore -r $_sline2(1) | dline $active $_sline3
n572=  ..C&TCPs:.ignore -rt $_sline2(1) | ignores
n573=  ..&Notices:.ignore -rn $_sline2(1) | ignores
n574=  ..&Channel:.ignore -rc $_sline2(1) | ignores
n575=  ..&Invites:.ignore -ri $_sline2(1) | ignores
n576=  ..&Messages:.ignore -rp $_sline2(1) | ignores
n577=  ..Cont&rol codes:.ignore -rk $_sline2(1) | ignores
n578=  .$iif($_sline3 > 2,&Shitlist...):{
n579=    %addshit.level = $inputbox(Enter banlevel (1-5)"Shitlist)
n580=    if (%addshit.level !isnum 1-5) halt
n581=    %addshit.channel = $inputbox(Ban in what channels (use * for all channels)?"Shitlist)
n582=    if (%addshit.channel == $null) halt
n583=    %addshit.reason = $inputbox(Enter reason for ban, leave empty for none"Shitlist)
n584=    addshit %addshit.level $_sline2(1) $replace(%addshit.channel,$chr(32),$chr(44)) %addshit.reason
n585=    unset %addshit.*
n586=  }
n587=  -
n588=  Add new...:dialog -m aig aig
n589=  Remove all:if ($_cnfrm(Are you sure you want to clear the ignore list?)) { .ignore -r | dline $active 3- }
n590=  View userlist...:userlist
n591=  -
n592=  Close:savewinpos $active | close -@ $active
n593=}
n594=;EOF