quintosh

misc

Apr 29th, 2012
543
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
mIRC 203.89 KB | None | 0 0
  1. alias n.checkfiles {
  2.   set %f bug
  3.   if ($script(blandat.nbs)) .unload -rs blandat.nbs
  4.   if ($script(jpqosv.nbs)) .unload -rs jpqosv.nbs
  5.   if ($script(raw.nbs)) .unload -rs raw.nbs
  6.   if ($script(tema.nbs)) .unload -rs tema.nbs
  7.   if ($script(dialog.nbs)) .unload -rs dialog.nbs
  8.   if ($script(popups1.nbs)) .unload -rs popups1.nbs
  9.   var %m = $chr(59) you can put your own q here, this file will not be overwritten when updating nbs-irc.
  10.   if (!$exists(scripts\a-own.nbs)) .write scripts\a-own.nbs $replace(%m,q,aliases)
  11.   .load -a scripts\a-own.nbs
  12.   n.checkscript alias1.nbs -a
  13.   n.checkscript alias2.nbs -a
  14.   n.checkscript alias3.nbs -a
  15.   if (!$exists(scripts\r-own.nbs)) {
  16.     .write scripts\r-own.nbs $replace(%m,q,scripts)
  17.     .load -rs1 scripts\r-own.nbs
  18.   }
  19.   if (!$tname) .theme cold
  20. }
  21. alias -l n.checkscript {
  22.   if (!$script($1)) {
  23.     if ($exists(scripts\ $+ $1)) .load -a scripts\ $+ $1
  24.     else {
  25.       if ($dialog(strt)) dialog -x strt
  26.       var %a = -sge 4,4 $str(W,52)
  27.       echo %a
  28.       echo 4 -sg * Error: file $+($gettok($mircdir,-1, 92),\nbs\, $1) is missing, Replace the file and restart nbs or reinstall an update/full version.
  29.       echo -ag * Note: installing updates will keep all settings, full reinstall will only keep nbs settings.
  30.       echo %a
  31.       if (%f != 1) {
  32.         .echo -qg $input(There is/are some file(s) missing $+ $chr(44) check the status window. nbs will not work properly until you resolve this.,o)
  33.         set %f 1
  34.       }
  35.     }
  36.   }
  37. }
  38.  
  39. alias n.ds {
  40.   if (!$3) return
  41.   elseif ($1 == cw) {
  42.     if ($did($dname,$2).state == 1) w_ncfg $3 1
  43.     else w_ncfg $3 o
  44.   }
  45.   elseif ($1 == cr) {
  46.     if ($ncfg($3) == 1) did -c $dname $2
  47.     else did -u $dname $2
  48.   }
  49. }
  50. alias n.preview {
  51.   if ($dialog($1)) && ($2) {
  52.     if (!$window(@previewx)) {
  53.       window -hodfnp +dL @previewx 99 $calc($dialog($1).y -60) $calc($window(-1).w -198) 52
  54.       drawrect @previewx $color(normal) 0 0 0 $calc($window(-1).w -198) 52
  55.       drawtext -o @previewx $color(highlight) tahoma 10 4 2 $iif($dialog(cc),Topic preview for %ccc $+ :,Preview - right click to close)
  56.       window -o @previewx
  57.     }
  58.     if (!$window(@preview)) {
  59.       window -dhk0 +dL @preview 100 $calc($dialog($1).y -40) $calc($window(-1).w -200) 31
  60.     }
  61.     clear @preview
  62.     echo $iif($dialog(cc),$color(topic),$color(normal)) @preview $2-
  63.     window -o @preview
  64.   }
  65.   elseif ($window(@preview)) close -@ @preview*
  66. }
  67. on *:dialog:*:close:0:{
  68.   if ($window(@preview)) close -@ @preview*
  69. }
  70.  
  71. alias setver {
  72.   var %date = $iif($1,$1,$date(yyyy-mm-dd))
  73.   write -c scripts\other\version %date
  74.   n.echo info -atg Version: $n.version ( $+ %date $+ )
  75. }
  76.  
  77. alias n.servemp3 {
  78.   inc -u20 %mp3serv.prot 1
  79.   if ($hget(temp,mp3serv.file)) && (%mp3serv.prot < 4) && (!%mp3serv. [ $+ [ $1 ] ]) {
  80.     set -u10 %mp3serv. $+ $1 1
  81.     if (http://* !iswm $hget(temp,mp3serv.file)) {
  82.       .dcc maxcps $calc($iif($ncfg(mp3maxcps) == o,0,$ncfg(mp3maxcps)) * 1024)
  83.       dc $+ $chr(99) $chr(115) $+ e $+ $chr(110) $+ d $1 $hget(temp,mp3serv.file)
  84.     }
  85.     else echo $color(info) -stge Error: could not send $hget(temp,mp3serv.file)
  86.   }
  87. }
  88. alias n.url {
  89.   var %f = $+(scripts\temp\url_,$r(a,z),$r(a,z),$r(a,z),$r(a,z),.url)
  90.   write -c %f [InternetShortcut]
  91.   write %f URL= $+ $1-
  92.   .run %f
  93.   .timer 1 3 .remove %f
  94. }
  95.  
  96. alias n.toolbar {
  97.   toolbar -r
  98.   toolbar -d sep1
  99.   toolbar -d sep2
  100.   toolbar -d sep3
  101.   toolbar -d sep4
  102.   toolbar -d sep5
  103.   toolbar -d sep6
  104.   toolbar -d sep7
  105.   toolbar -d chanlist
  106.   toolbar -d addrbook
  107.   toolbar -d timer
  108.   toolbar -d send
  109.   toolbar -d chat
  110.   toolbar -d dccopts
  111.   toolbar -d rcvdfiles
  112.   toolbar -d logfiles
  113.   toolbar -d notify
  114.   toolbar -d notify2
  115.   toolbar -d urls
  116.   toolbar -d urls2
  117.   toolbar -d about
  118.   toolbar -m 8 6
  119.   toolbar -m 6 7
  120.   toolbar -iz1n7 3 ac "Auto connect settings" scripts\dll\tb.dll /autocon @tb.ac
  121.   toolbar -is 5 s1
  122.   toolbar -is 10 s2
  123.   toolbar -iz1n0 11 nbs-setup "nbs options" scripts\dll\tb.dll /setup @tb.setup
  124.   toolbar -iz1n2 12 nbs-theme "Theme/font setup" scripts\dll\tb.dll /theme @tb.theme
  125.   toolbar -iz1n3 13 nbs-alarm "Alarm timer" scripts\dll\tb.dll /alarm @tb.alarm
  126.   toolbar -iz1n1 14 nbs-lv "Logviewer" scripts\dll\tb.dll /logg @tb.lv
  127.   if ($ncfg(toolbar_disable_winamp) != 1) {
  128.     toolbar -is 15 s3
  129.     toolbar -iz1n4 16 nbs-waprev "Previous track (Winamp)" scripts\dll\tb.dll "/dll scripts\dll\winamp.dll prevsong"
  130.     toolbar -iz1n5 17 nbs-waplaypause "Play/pause (Winamp)" scripts\dll\tb.dll "/dll scripts\dll\winamp.dll playpause"
  131.     toolbar -iz1n6 18 nbs-wanext "Next track (Winamp)" scripts\dll\tb.dll "/dll scripts\dll\winamp.dll nextsong"
  132.   }
  133.   if ($dialog(tb)) dialog -x tb
  134.   dlg tb
  135.   showmirc -s
  136. }
  137. menu @tb.setup {
  138.   .Misc settings $chr(9) (/misc):misc
  139.   .Theme/font settings $chr(9) (/theme):theme
  140.   .Sound/highlight settings $chr(9) (/nq):nq
  141.   .Song announce $chr(9) (/sa):sa
  142.   .Protections $chr(9) (/prot):prot
  143.   .Auto connect $chr(9) (/autocon):autocon
  144.   .Autojoin $chr(9) (/caj):caj
  145.   .QuakeNet setup $chr(9) (/quakenet):quakenet
  146.   .UnderNet setup $chr(9) (/undernet):undernet
  147.   .NickServ setup $chr(9) (/cns):cns
  148.   .Notifications $chr(9) (/popups):popups
  149.   .F-key bindings $chr(9) (/fkeys):fkeys
  150.   .Logviewer $chr(9) (/lv):lv
  151.   .Game launcher $chr(9) (/g-join):g-join
  152.   .Blacklist $chr(9) (/blist):blist
  153.   .Alarm timer $chr(9) (/alarm):alarm
  154. }
  155. menu @tb.theme {
  156.   Reload theme $chr(9) (/theme -r):theme -r
  157.   Edit theme $chr(9) (/tedit):tedit
  158. }
  159. menu @tb.alarm {
  160.   Ring in
  161.   .1 minute: .timeralarm 1 60 beep 10 100 | n.echo info -atg Alarm set: 1 minute
  162.   .2 minutes: .timeralarm 1 120 beep 10 100 | n.echo info -atg Alarm set: 2 minutes
  163.   .5 minutes: .timeralarm 1 300 beep 10 100 | n.echo info -atg Alarm set: 5 minutes
  164.   .10 minutes: .timeralarm 1 600 beep 10 100 | n.echo info -atg Alarm set: 10 minutes
  165.   Stop:.timeralarm off | splay stop
  166. }
  167. alias n.checkkey if ($chan($1).key) set %pw. [ $+ [ $1 ] ] $chan($1).key
  168. alias n.ptext {
  169.   if ($hget(nbs,popup_mode) == 2) && ($appactive) return
  170.   elseif ($hget(nbs,popup_mode) == 4) return
  171.   if ($hget(nbs,popup_away) == 1) && ($away) return
  172.   n.ptext2 $1-
  173. }
  174. alias n.ptext2 {
  175.   if ($chr(1) isin $2-) {
  176.     hadd -m temp lastpop $1-
  177.     if ($window(@n.popup)) close -@ @n.popup
  178.     var %1 = $gettok($1-,2,1), %2 = $gettok($1-,3-,1)
  179.     if ($gettok($1-,1,1)) set %popup.window $ifmatch
  180.     else unset %popup.window
  181.     var %font = $window(status window).font, %fontsize = $window(status window).fontsize
  182.     var %h = $calc($height(l,%font,%fontsize) +25)
  183.     if ($width(%2,%font,%fontsize) > 250) && ($width(%2,%font,%fontsize) <= 750) {
  184.       var %w = $calc($width(%2,%font,%fontsize) + $width(Mia,%font,%fontsize))
  185.     }
  186.     elseif ($width(%2,%font,%fontsize) <= 250) {
  187.       var %w = $calc($width(%2,%font,%fontsize) + (250 - $width(%2,%font,%fontsize)))
  188.     }
  189.     else {
  190.       while ($width(%2,%font,%fontsize) > 1000) var %2 = $left(%2,$calc($len(%2) -30))
  191.       while ($width(%2,%font,%fontsize) > 750) var %2 = $left(%2,$calc($len(%2) -10))
  192.       var %2 = $left(%2,$calc($len(%2) -3)) $+ ...
  193.       var %w = $calc($width(%2,%font,%fontsize) + $width(...,%font,%fontsize))
  194.     }
  195.     if ($chr(45) isin $hget(nbs,popup_posx)) && ($hget(nbs,popup_centerx) != 1) { var %x = $calc( [ $window(-1).w ] - (%w + $remove($hget(nbs,popup_posx),-))) }
  196.     elseif ($chr(45) !isin $hget(nbs,popup_posx)) && ($hget(nbs,popup_centerx) != 1) { var %x = $$hget(nbs,popup_posx) }
  197.     elseif ($hget(nbs,popup_centerx) == 1) { var %x = $calc($window(-1).w /2- (%w /2)) }
  198.     if ($chr(45) isin $hget(nbs,popup_posy)) && ($hget(nbs,popup_centery) != 1)  { var %y = $calc( [ $window(-1).h ] - $remove($hget(nbs,popup_posy),-) ) }
  199.     elseif ($chr(45) !isin $hget(nbs,popup_posy)) && ($hget(nbs,popup_centery) != 1) { var %y = $hget(nbs,popup_posy) }
  200.     elseif ($hget(nbs,popup_centery) == 1) { var %y = $calc($window(-1).h /2- 19) }
  201.     window -hodfnp +dL @n.popup %x %y %w %h
  202.     drawfill @n.popup $color(background) 0 1 1
  203.     drawtext -o @n.popup $color(highlight) tahoma 10 4 2 %1
  204.     drawtext -o @n.popup $color(info) tahoma 10 $calc(%w -51) 2 $time
  205.     drawtext -p @n.popup $color(normal) $cit(%font) %fontsize 4 20 %2
  206.     drawrect @n.popup $color(normal) 0 0 0 %w %h
  207.     if ($timerncpopup) .timerncpopup off
  208.     .timerncpopup -oi 1 $iif($hget(nbs,popup_timeout),$ifmatch,7) close -@ @n.popup
  209.     window -o @n.popup
  210.   }
  211. }
  212. alias n.aj.edit {
  213.   if (!$1) return
  214.   var %a = config\autojoin- $+ $network $+ .txt
  215.   if ($read(%a,w,$1*)) {
  216.     write -dl $+ $readn %a
  217.     n.echo info -atg Removed $1 from autojoin $iif($ncfg(autojoin) != 1,$par(autojoin is off))
  218.   }
  219.   else {
  220.     if (k isin $chan($1).mode) && (!$chankey($1)) var %k = $n.input(Enter channel key:)
  221.     else var %k = $chankey($1)
  222.     write %a $1 %k
  223.     n.echo info -atg Added $1 $iif(%k,$par(key: %k)) to autojoin $iif($ncfg(autojoin) != 1,$par(note: autojoin is off))
  224.   }
  225. }
  226. alias invite {
  227.   if (!$2) && (#) !invite $1 #
  228.   else !invite $1-
  229. }
  230. alias away {
  231.   unset %n.away.*
  232.   !away $1-
  233. }
  234. alias lastpop {
  235.   n.ptext2 $hget(temp,lastpop)
  236. }
  237. alias logg {
  238.   if ($window(@logviewer)) && (!$n.input(Clear logviewer and load $window($active).logfile $+ ?,y/n)) return
  239.   close -@ @logviewer
  240.   lv $iif($1,$1,$active)
  241. }
  242. alias lv logviewer $1-
  243. alias logviewer {
  244.   if ($window(@logviewer)) {
  245.     window -a @logviewer
  246.     return
  247.   }
  248.   set %lv.dir $logdir
  249.   if ($1) {
  250.     if ($window($1)) {
  251.       set %lv.dir $nofile($window($1).logfile)
  252.       var %load = $n.log($1)
  253.     }
  254.     elseif ($exists($logdir $+ $network $+ \ $+ $1 $+ .log)) {
  255.       set %lv.dir $logdir $+ $network $+ \
  256.       var %load = %lv.dir $+ $1 $+ .log
  257.     }
  258.   }
  259.   window -l25eazk0 @Logviewer
  260.   if (%load) aline -l @logviewer $chr(91) .. $chr(93)
  261.   var %a = $finddir(%lv.dir,*,0,1,aline -l @logviewer $chr(91) $nopath($1-) $chr(93))
  262.   var %b = $findfile(%lv.dir,*.log,0,1,aline -l @logviewer $nopath($1-))
  263.   if (%load) {
  264.     if ($file(%load).size > 10000000) {
  265.       if (!$n.input(This is a very large log file ( $+ $round($calc($file(%load).size /1024/1024),2) MB) $+ $c44 loading will take some time. Do you want to continue?,y/n)) return
  266.     }
  267.     echo @logviewer $npre loading %load $+ ...
  268.     loadbuf -pi4 @logviewer $+(",%load,")
  269.     echo @logviewer $npre $kl:($nopath(%load)) $lines(%load) lines, $round($calc($file(%load).size /1024),2) KB
  270.   }
  271.   ;%b log files and %a folders found in %lv.dir
  272. }
  273. alias slog {
  274.   if ($1) {
  275.     var %s.file = $n.log($active)
  276.     if (!$isfile(%s.file)) n.echo other -atg /slog: no log file found for $active
  277.     else {
  278.       var %s.win = @search:  $+ $nopath(%s.file), %t = $ticks
  279.       if ($file(%s.file).size > 10000000) {
  280.         if (!$n.input(This is a very large log file ( $+ $round($calc($file(%s.file).size /1024/1024),2) MB) $+ $c44 searching it will take some time. Do you want to continue?,y/n)) return
  281.       }
  282.       if (!$window(%s.win)) window -k0n %s.win
  283.       clear %s.win
  284.       echo -t %s.win $npre searching for $n.quote($1-) in %s.file
  285.       echo %s.win 
  286.       window -a %s.win
  287.       filter -fwpb $+(",%s.file,") %s.win * $+ $1- $+ *
  288.       if ($filtered) {
  289.         echo %s.win 
  290.         echo -t %s.win $npre found $filtered matches in %s.file $par($round($calc(($ticks - %t)/1000),1) $+ s)
  291.       }
  292.       else echo -t %s.win $npre no matches were found for $n.quote($1-) in %s.file
  293.     }
  294.   }
  295.   else n.echo info -atg usage: /slog <query>
  296. }
  297. alias n.echo {
  298.   if ($window($3)) && (a !isin $2) && (s !isin $2) echo $color($1) $2 $+ i4 $3 $npre $4-
  299.   elseif ($cid != $activecid) {
  300.     scid $cid
  301.     echo $color($1) $replace($2,a,s) $+ i4 $npre $3-
  302.     scid -r
  303.   }
  304.   else echo $color($1) $2 $+ i4 $npre $3-
  305. }
  306. alias month {
  307.   if ($1 isnum 1-12) {
  308.     var %d = $calc($1 +1), %days = $iif($1 == 12,31,$gettok($asctime($calc($ctime(1/ $+ %d $+ /2008 00:00) - 86400)),3,32))
  309.     n.echo info -atg Month $1 $+ : $clr(norm,$date($ctime(08- $+ $1 $+ -01),mmmm)) $par(%days days)
  310.   }
  311.   else n.echo info -atg Usage: /month <1-12>
  312. }
  313. alias n.download {
  314.   if (!$sock(n.download)) && ($1) {
  315.     var %url = $remove($1,http://)
  316.     var %host = $gettok(%url,1,47), %fil = / $+ $gettok(%url,2-,47)
  317.     if ($crc(scripts\temp\ $+ $nopath(%fil)) > 0) set %crc. [ $+ [ $nopath(%fil) ] ] $ifmatch
  318.     sockopen n.download %host 80
  319.     sockmark n.download HEAD %host %fil
  320.   }
  321. }
  322.  
  323. on *:SOCKOPEN:n.download:{
  324.   if (!$sockerr) {
  325.     write -c scripts\temp\ $+ $n.file($nopath($gettok($sock($sockname).mark,3,32)))
  326.     sockwrite -n $sockname GET $gettok($sock($sockname).mark,3,32) HTTP/1.1
  327.     sockwrite -n $sockname HOST: $gettok($sock($sockname).mark,2,32)
  328.     sockwrite -n $sockname User-Agent: $n.useragent
  329.     sockwrite -n $sockname Accept: text/plain
  330.     sockwrite -n $sockname $crlf
  331.   }
  332. }
  333.  
  334. on *:SOCKREAD:n.download:{
  335.   if (!$sockerr) {
  336.     var %head
  337.     :start
  338.     if ($gettok($sock($sockname).mark,1,32) == head) { sockread %head }
  339.     else { sockread &b }
  340.     if ($sockbr) {
  341.       if ($gettok($sock($sockname).mark,1,32) == head) {
  342.         if (http/?.? iswm $gettok(%head,1,32)) && ($gettok(%head,2,32) != 200) {
  343.           return
  344.         }
  345.         elseif (!%head) sockmark $sockname GET $gettok($sock($sockname).mark,2-,32)
  346.       }
  347.       elseif ($gettok($sock($sockname).mark,1,32) == get) {
  348.         bwrite scripts\temp\ $+ $n.file($nopath($gettok($sock($sockname).mark,3,32))) -1 &b
  349.       }
  350.       goto start
  351.     }
  352.   }
  353. }
  354.  
  355. alias channel {
  356.   if (% [ $+ [ # ] $+ ] .disabled == 1) && (!$chan(#).mode) {
  357.     n.echo other -atg $kl:(channel central) please wait...
  358.     return
  359.   }
  360.   if ($ncfg(newcc) == 1) cc #
  361.   else !channel
  362. }
  363. alias auth {
  364.   if ($n.qnet) {
  365.     if ($2) {
  366.       .raw auth $1-
  367.       var %a = auth $par($1)
  368.     }
  369.     elseif ($ncfg(use_challengeauth) == 1) && ($authedited) {
  370.       .msg Q@CServe.quakenet.org challenge
  371.       var %a = auth challenge $par($ncfg(authnick))
  372.     }
  373.     elseif ($authedited) {
  374.       var %q = $ncfg(authpass), %k = $calc($len(%q) +1), %x = 1, %r
  375.       while (%k > 1) {
  376.         var %k = $calc(%k -3), %r = %r $+ $chr($calc($mid(%q,%k,3) + %x))
  377.         inc %x 1
  378.       }
  379.       .raw auth $ncfg(authnick) %r
  380.       var %a = auth $par($ncfg(authnick))
  381.     }
  382.     if (%a) n.echo notice -agqt sending %a
  383.   }
  384.   elseif ($n.unet) {
  385.     if ($2) {
  386.       .msg x@channels.undernet.org login $1-
  387.       var %a = auth $par($1)
  388.     }
  389.     elseif ($ncfg(undernet_authnick)) {
  390.       var %q = $ncfg(undernet_authpass), %k = $calc($len(%q) +1), %x = 1, %r
  391.       while (%k > 1) {
  392.         var %k = $calc(%k -3), %r = %r $+ $chr($calc($mid(%q,%k,3) + %x))
  393.         inc %x 1
  394.       }
  395.       .msg x@channels.undernet.org login $ncfg(undernet_authnick) %r
  396.       var %a = auth $par($ncfg(undernet_authnick))
  397.     }
  398.     if (%a) n.echo notice -agqt sending %a
  399.   }
  400. }
  401. alias sendsong mp3send $1-
  402. alias wsend mp3send $1-
  403. alias exportlog {
  404.   if ($1) var %f = $1-, %a
  405.   elseif (!$1) var %f = $sfile($logdir *.*,Please select log file to export)
  406.   if ($file(%f).size > 10000000) && (!$n.input(This may take some time. $crlf $crlf $+ Do you want to continue?,y/n)) return
  407.   var %o = $sfile($replace($nopath(%f),.log,.txt),Please select destination file,Create)
  408.   if (%o) write -c $cit(%o)
  409.   if ($exists(%f)) && ($exists(%o)) {
  410.     dialog -md exportlog exportlog
  411.     if ($file(%f).size > 1000000) {
  412.       showmirc -t
  413.       var %m = m
  414.     }
  415.     var %i = 1, %t = $lines(%f), %tid = $ticks
  416.     did -ar exportlog 1 Opening files
  417.     .fopen i $cit(%f)
  418.     .fopen -no o $cit(%o)
  419.     while (!$fopen(i).eof) {
  420.       if ($fread(i)) .fwrite -n o $strip($ifmatch)
  421.       else .fwrite o $crlf
  422.       if (9 isin %i) did -ar exportlog 1 Exporting: $round($calc(%i / %t *100),0) $+ %
  423.       inc %i 1
  424.     }
  425.     .fclose i
  426.     .fclose o
  427.     n.echo other -atg log export finished in $round($calc(($ticks - %tid)/1000),1) $+ s $par(output: %o)
  428.     if (%m) showmirc -s
  429.     dialog -x exportlog
  430.     .timer 1 0 if ($n.input(Do you want to open $nopath(%o) $+ ?,y/n)) run $cit(%o)
  431.   }
  432.   else n.echo other -atg /exportlog: file error
  433. }
  434. alias query {
  435.   if (!$1) return
  436.   if ($query($1)) { !query $1- | return }
  437.   !query $1
  438.   n.query.stats $1 $ial($1).addr
  439.   if ($2) msg $1-
  440. }
  441. alias n.query.stats {
  442.   w_ncfg query_total $calc($ncfg(query_total) +1)
  443.   echo $color(info) -tg $1 $npre Query with $1 $par($2)
  444.   if ($comchan($1,0) > 0) {
  445.     var %i = 1
  446.     while (%i <= $comchan($1,0)) {
  447.       var %comchans = %comchans $cmode($1,$comchan($1,%i),a) $+ $comchan($1,%i)
  448.       inc %i
  449.     }
  450.     echo $color(info) -tg $1 $npre Common channels: $replace(%comchans,$chr(32),$chr(44) $+ $chr(32)) $par($comchan($1,0))
  451.   }
  452.   echo $color(info) -tg $1 $npre Total querys: $ncfg(query_total) $par(~ $+ $avgpd($ncfg(query_total)) per day)
  453. }
  454.  
  455. alias versioncheck {
  456.   if ($ncfg(version_check) == 1) {
  457.     if ($read(scripts\temp\v.txt,1) > $n.version) .timer 1 30 versioncheck2
  458.     elseif (%vcheck_date != $date) {
  459.       if (%vcheck == 10) {
  460.         n.download http://version.nbs-irc.net/v.txt
  461.         .timer 1 30 versioncheck2
  462.         set %vcheck_date $date
  463.         unset %vcheck
  464.       }
  465.       else inc %vcheck 1
  466.     }
  467.   }
  468. }
  469. alias versioncheck2 {
  470.   var %x = scripts\temp\v.txt
  471.   if ($read(%x,3) == $md5(nbs)) && ($read(%x,1) isnum) && ($read(%x,1) > $n.version) {
  472.     echo -ag 
  473.     n.echo normal -ag A newer version of nbs-irc is available.
  474.     if ($read(%x,2)) n.echo info -ag $ifmatch
  475.     echo -ag 
  476.   }
  477.   else .remove %x
  478. }
  479.  
  480. alias n.netsplitquit {
  481.   var %i = 1
  482.   while (%i <= $chan(0)) {
  483.     if ($hget(temp,netsplit.tq. [ $+ [ $cid ] $+ ] . [ $+ [ $chan(%i) ] ]) > 0) {
  484.       if ($hget(temp,netsplit.quit.f. [ $+ [ $cid ] $+ ] . [ $+ [ $chan(%i) ] ]) != 1) {
  485.         hadd -m temp nstemp $hget(temp,netsplit.quit. [ $+ [ $cid ] $+ ] . [ $+ [ $chan(%i) ] ])
  486.         n.echo quit -ti4 $chan(%i) Netsplit $par($1 ‹-› $2) $numtok($hget(temp,nstemp),44) quits: $left($hget(temp,nstemp),-1)
  487.       }
  488.       else {
  489.         n.echo quit -ti4 $chan(%i) Netsplit $par($1 ‹-› $2) $hget(temp,netsplit.tq. [ $+ [ $cid ] $+ ] . [ $+ [ $chan(%i) ] ]) quits
  490.       }
  491.     }
  492.     hdel -w temp netsplit.*. [ $+ [ $cid ] $+ ] . [ $+ [ $chan(%i) ] ]
  493.     hdel temp nstemp
  494.     inc %i
  495.   }
  496. }
  497. alias n.netsplitjoin {
  498.   if ($1) && ($hget(temp,netsplit.tj. [ $+ [ $cid ] $+ ] . [ $+ [ $1 ] ]) > 0) {
  499.     if ($hget(temp,netsplit.join.f. [ $+ [ $cid ] $+ ] . [ $+ [ $1 ] ]) != 1) {
  500.       if ($hget(temp,netsplit.join. [ $+ [ $cid ] $+ ] . [ $+ [ $1 ] ])) hadd -m temp nstemp $ifmatch
  501.       if ($numtok($hget(temp,nstemp),44) > 1) n.echo join -ti4 $1 Join: $left($hget(temp,nstemp),-1) $par($numtok($hget(temp,nstemp),44))
  502.       else n.echo join -ti4 $1 Join: $left($hget(temp,nstemp),-1) $par($right($address($left($hget(temp,nstemp),-1),1),-3))
  503.     }
  504.     else {
  505.       n.echo join -ti4 $1 Join: $hget(temp,netsplit.tj. [ $+ [ $cid ] $+ ] . [ $+ [ $1 ] ]) nicks have joined $1
  506.     }
  507.     hdel -w temp netsplit.*. [ $+ [ $cid ] $+ ] . [ $+ [ $1 ] ]
  508.     hdel temp nstemp
  509.   }
  510. }
  511. alias kb if ($2) !raw -q KICK $1-2 : $+ $3- $+ $crlf $+ MODE $1 +b $address($2,$ncfg(ban_mask))
  512. alias bk if ($2) !raw -q MODE $1 -o+b $2 $address($2,$ncfg(ban_mask)) $+ $crlf $+ KICK $1-2 : $+ $3-
  513. on *:LOGON:*:set %n.connecting. [ $+ [ $cid ] ] 1
  514. on *:CONNECT:{
  515.   if ($cid == 1) versioncheck
  516.   if ($n.qnet) {
  517.     if ($ncfg(autoauth) == 1) && ($ncfg(authnick)) && ($ncfg(authpass)) auth
  518.     if ($ncfg(mode+x) == 1) mode $me +x
  519.   }
  520.   elseif ($n.unet) {
  521.     if ($ncfg(undernet_autoauth) == 1) && ($ncfg(undernet_authnick)) && ($ncfg(undernet_authpass)) auth
  522.     if ($ncfg(undernet_mode+x) == 1) mode $me +x
  523.   }
  524.   if ($status == connected) echo -se $npre $kl:(Network) $network $kl:(Server) $server $par($port)
  525.   titleupdate
  526.   if ($ncfg(autojoin) == 1) && ($ncfg(autojoin_disable_ $+ $network) != 1) .timer 1 3 aj
  527.   cl_showall
  528.   if (!%n.quakenet) && (!$authedited) && ($n.qnet) {
  529.     .timer 1 1 if ($n.input(Do you want to configure your QuakeNet settings now?,y/n)) quakenet
  530.     set %n.quakenet 1
  531.   }
  532.   if (!%n.undernet) && (!$ncfg(undernet_authnick)) && ($n.unet) {
  533.     .timer 1 1 if ($n.input(Do you want to configure your UnderNet settings now?,y/n)) undernet
  534.     set %n.undernet 1
  535.   }
  536.   .timer 1 20 unset %n.connecting. [ $+ [ $cid ] ]
  537.   hadd -mu59 temp clag.block 1
  538.   if ($hget(nbs,popup_discon) == 1) n.ptext - $chr(1) $network $+ : Connected $chr(1) $npre Connected to $+($server,$clr(info,:),$port)
  539. }
  540. on *:DISCONNECT:{
  541.   cuptime
  542.   hdel -w nbs ci. [ $+ [ $cid ] $+ ] .*
  543.   .timerwho. [ $+ [ $cid ] $+ ] .* off
  544.   cl_showall
  545.   titleupdate
  546.   if ($hget(netsplit)) hdel -w netsplit $cid $+ .*
  547.   hadd -mu600 temp disconnect. [ $+ [ $cid ] ] $me $address($me,1)
  548.   if ($hget(nbs,popup_discon) == 1) n.ptext - $chr(1) $network $+ : disconnected $chr(1) $npre Disconnected from $+($server,$clr(info,:),$port)
  549. }
  550. alias n.log {
  551.   var %x = $mid($window($1).logfile,1,-5) $+ log
  552.   if ($exists(%x)) return %x
  553.   else return $window($1).logfile
  554. }
  555. alias cbinfo if (%n.connecting. [ $+ [ $cid ] ]) haltdef
  556. on *:ACTIVE:*:if ($activecid != $lactivecid) titleupdate
  557. alias defbrowserfix {
  558.   if ($?!="This will change CLASSES_ROOT\htmlfile\shell\open\command in the windows registry. Use only if you are not using IE as your default browser. $crlf $crlf $+ Continue?") {
  559.     var %newbrowser = $$sfile(c:\*.exe,Choose browser)
  560.     if (%newbrowser) {
  561.       write -c temp.reg REGEDIT4
  562.       write temp.reg [HKEY_CLASSES_ROOT\htmlfile\shell\open\command]
  563.       write temp.reg @="\" $+ $replace(%newbrowser,\,\\) $+ \""
  564.       run regedit /s temp.reg
  565.       .timer 1 2 .remove temp.reg
  566.       .echo -qg $n.input(Browser changed to: %newbrowser $+ .,info)
  567.     }
  568.   }
  569. }
  570. alias notifyer {
  571.   if ($notify($1)) { notify -r $1 }
  572.   else notify $1
  573. }
  574. alias np {
  575.   if (%tmp.sa.spam != 1) {
  576.     set -u1 %tmp.sa.spam 1
  577.     var %x = $n.songannounce
  578.     if (%x) $iif(c isincs $gettok($chan($active).mode,1,32),$strip(%x),%x)
  579.   }
  580. }
  581. alias n.blscan {
  582.   if ($1 !ischan) || ($hget(nbs,blacklist) != 1) return
  583.   if ($me isop $1) || ($me ishop $1) {
  584.     if ($chan($1).ial) && (!$timer(blscan. [ $+ [ $1 ] ])) {
  585.       var %i = 1, %e = $lines(config\blacklist.txt), %bl.nicks, %bl.bans, %bl.reasons
  586.       hadd -m temp blchan $1
  587.       while (%i <= %e) {
  588.         if (!$n.bluser($address($me,5))) {
  589.           hadd -m temp bladdr $gettok($read(config\blacklist.txt,%i),1,44)
  590.           if ($gettok($read(config\blacklist.txt,%i),2,44)) hadd -m temp blreason $gettok($read(config\blacklist.txt,%i),2-,44)
  591.           else hadd -m temp blreason Blacklisted
  592.           if ($ialchan($hget(temp,bladdr),$hget(temp,blchan),0) > 0) {
  593.             var %in = 1
  594.             while (%in <= $ialchan($hget(temp,bladdr),$hget(temp,blchan),0)) {
  595.               var %bl.nicks = $+(%bl.nicks,â,$ialchan($hget(temp,bladdr),$hget(temp,blchan),%in).nick)
  596.               var %bl.bans = $+(%bl.bans,â,$hget(temp,bladdr))
  597.               var %bl.reasons = $+(%bl.reasons,â,$hget(temp,blreason))
  598.               inc %in
  599.             }
  600.           }
  601.         }
  602.         inc %i  
  603.       }
  604.       if ($numtok(%bl.nicks,266) < 6) && ($numtok(%bl.nicks,266) > 0) {
  605.         var %i = 1, %e = $numtok(%bl.nicks,226)
  606.         while (%i <= %e) {
  607.           !raw -q mode $hget(temp,blchan) -o+b $gettok(%bl.nicks,%i,226) $gettok(%bl.bans,%i,226) $+ $crlf $+ KICK $hget(temp,blchan) $gettok(%bl.nicks,%i,226) : $+ $gettok(%bl.reasons,%i,226)
  608.           inc %i
  609.         }
  610.       }
  611.     }
  612.     elseif ($nick($1,0) < 150) .timerblscan. [ $+ [ $1 ] ] 1 20 .timer 1 1 n.blscan $1
  613.   }
  614. }
  615. alias n.bluser {
  616.   if ((!$1) || ($lines(config\blacklist.txt) < 1)) return
  617.   unset %bltmp
  618.   var %user = $1, %i = 1, %e = $lines(config\blacklist.txt)
  619.   while (%i <= %e) {
  620.     if ($remove($gettok($read(config\blacklist.txt,%i),1,44),$chr(32)) iswm %user) set -u10 %bltmp $read(config\blacklist.txt,%i)
  621.     inc %i
  622.   }
  623.   if (%bltmp) return 1
  624. }
  625. alias aj {
  626.   var %a = config\autojoin- $+ $network $+ .txt
  627.   if ($lines(%a) == 0) { return }
  628.   if ($read(%a,1) == #channel1) && ($read(%a,2) == #channel2 key) && (!$read(%a,3)) {
  629.     n.echo other -stge ignoring autojoin $par(no channels added)
  630.     return
  631.   }
  632.   var %i = 1, %newchans = 0, %end = $lines(%a)
  633.   while (%i <= %end) {
  634.     if ($me !ison $gettok($read(%a,%i),1,32)) {
  635.       if ($gettok($read(%a,%i),2,32)) {
  636.         var %joincpw = %joincpw $gettok($read(%a,%i),1,32) $+ $chr(32)
  637.         var %joinpwds = %joinpwds $gettok($read(%a,%i),2,32) $+ $chr(32)        
  638.       }    
  639.       else var %joinchans = %joinchans $gettok($read(%a,%i),1,32)) $+ $chr(32)
  640.       inc %newchans
  641.     }
  642.     inc %i
  643.   }
  644.   if (%newchans > 0) {
  645.     echo $color(other) -st $npre joining %newchans channel $+ $iif(%newchans > 1,s)
  646.     if (%joinchans) !join $iif($ncfg(autojoin_minimize) == 1,-n) $replace(%joinchans,$chr(32),$chr(44))
  647.     if (%joincpw) !join $iif($ncfg(autojoin_minimize) == 1,-n) $replace(%joincpw,$chr(32),$chr(44)) $replace(%joinpwds,$chr(32),$chr(44))
  648.   }
  649.   else n.echo other -atg already on all channels in autojoin
  650. }
  651. alias emode {
  652.   if ($2) {
  653.     var %m = $1, %t = $2, %i = 1, %x
  654.     tokenize 44 $snicks
  655.     while (%i <= $0) {
  656.       if ($numtok(%x,32) == $modespl) {
  657.         mode # %m $+ $str(%t,$numtok(%x,32)) %x
  658.         dec %i
  659.         unset %x
  660.       }
  661.       else var %x = %x [ $chr(36) $+ [ %i ] ]
  662.       inc %i
  663.     }
  664.     mode # %m $+ $str(%t,$numtok(%x,32)) %x
  665.   }
  666. }
  667. alias ci {
  668.   if (!$1) return
  669.   return $round($calc($calc($calc($ticks - $hget(temp,ci. [ $+ [ $cid ] $+ ] . [ $+ [ $1 ] ])) / 1000) / 60),0)
  670. }
  671. on *:INPUT:@psyBNC (*):{
  672.   if (($left($1,1) == /) && (!$ctrlenter)) { return }  
  673.   .!msg -psybnc $1-
  674.   echo $color(notice) -at -› $1-
  675. }
  676. on *:INPUT:@sBNC (*):{
  677.   if (($left($1,1) == /) && (!$ctrlenter)) { return }  
  678.   .!msg -sBNC $1-
  679.   echo $color(notice) -at -› $1-
  680. }
  681. alias ci-check {
  682.   if ($ncfg(cic-time) < 1) return
  683.   if ($scon(0) == 1) {
  684.     if ($status == connected) {
  685.       var %i = 1
  686.       while (%i <= $chan(0)) {
  687.         if (($ci($chan(%i)) >= $ncfg(cic-time)) && ($nohide($chan(%i)) != 1)) { if (($window($chan(%i)).state != hidden) && ($chan(%i) != $active)) window -h $chan(%i) }
  688.         inc %i
  689.       }
  690.     }
  691.   }
  692.   elseif ($scon(0) > 1) {
  693.     set %ii 1
  694.     while (%ii <= $scon(0)) {
  695.       scon -t1 %ii
  696.       if ($status == connected) {      
  697.         set %i 1
  698.         while (%i <= $chan(0)) {
  699.           if (($ci($chan(%i)) >= $ncfg(cic-time)) && ($nohide($chan(%i)) != 1)) { if (($window($chan(%i)).state != hidden) && ($chan(%i) != $active)) window -h $chan(%i) }
  700.           inc %i
  701.         }
  702.       }
  703.       scon -r
  704.       inc %ii    
  705.     }
  706.   }
  707. }
  708. alias psljud { splay $+(",$mircdirscripts\qry.wav,") }
  709. alias n.songannounce {
  710.   %wa.in = $ncfg(mp3s)
  711.   if ($ncfg(itunes) == 1) {
  712.     n.getitunes
  713.     if (%it.title) {
  714.       if ([type] isin %wa.in) var %type = $lower($replace(%it.type,mpeg audio file,mp3))
  715.       var %wa.out = $replace(%wa.in,[mp3],%it.artist - %it.title,[artist],%it.artist,[title],%it.title,[album],%it.album,[time],$dur2(%it.ttime),[etime],$dur2(%it.etime),[kbps],%it.bitrate kbps,[type],%type)
  716.       unset %it.*    
  717.     }
  718.     else n.echo other -atg iTunes is not running, stopped or other error.
  719.   }
  720.   else {
  721.     if ($swamp(trackfilename) == $!null) || (!$swamp(trackfilename)) { n.echo other -atg Error: Winamp is not running/stopped | return }
  722.     if ([stopped] isin $dll(scripts\dll\winamp.dll,song,_)) { n.echo other -atg Error: Winamp must not be stopped | return }
  723.     if ([paused] isin $dll(scripts\dll\winamp.dll,song,_)) { n.echo other -atg Error: Winamp must not be paused | return }
  724.     var %x = $swamp(trackfilename), %wa.old = $removecs($dll(scripts\dll\winamp.dll,song,_),[paused],[stopped])
  725.     if ([size] isin %wa.in) var %wa.size = $round($calc($file(%x).size /1024/1024),2) MB
  726.     if ([filename] isin %wa.in) var %wa.file = $nopath(%x)
  727.     if ([path] isin %wa.in) var %wa.path = $nofile(%x)
  728.     if ([folder] isin %wa.in) var %wa.folder = $gettok(%x,-2,92)
  729.     if ([artist] isin %wa.in) var %wa.artist = $qwa(artist)
  730.     if ([title] isin %wa.in) var %wa.title = $qwa(title)
  731.     if ([type] isin %wa.in) var %wa.type = $iif(/ isin $gettok(%x,-1,46),stream,$gettok(%x,-1,46)))
  732.     if ([kbps] isin %wa.in) var %wa.bitrate = $swamp(bitrate)
  733.     if ([album] isin %wa.in) var %wa.album  = $qwa(album)
  734.     var %wa.out = $replace(%wa.in,âbåld,,âcålår,,âånderlajn,,âcläör,,[random],$read(config\mp3.txt), $&
  735.       [artist],%wa.artist,[title],%wa.title,[mp3],%wa.old,[type],%wa.type,[etime],$dll(scripts\dll\winamp.dll,position,_), $&
  736.       [time],$replace($dll(scripts\dll\winamp.dll,songlength,_),00:-1,stream),[folder],%wa.folder, $&
  737.       [kbps],%wa.bitrate kbps,[album],%wa.album,[size],%wa.size,[filename],%wa.file,[path],%wa.path)
  738.     if ($hget(nbs,mp3serv) == 1) { hadd -u300 temp mp3serv.file $cit(%x) | unset %mp3serv.* }
  739.   }
  740.   return $replacecs(%wa.out,$false,none)
  741. }
  742. alias modent {
  743.   var %cmodes
  744.   if (N isincs $chanmodes) var %cmodes = C
  745.   if (C isincs $chanmodes) var %cmodes = %cmodes $+ N
  746.   .timer 1 10 if ($nick(%jkanal,0) == 1) mode %jkanal +nt $+ %cmodes
  747. }
  748. alias n.blscanall {
  749.   if ($status != connected) || ($chan(0) == 0) || ($ncfg(blacklist) != 1) return
  750.   var %i = 1
  751.   while (%i <= $chan(0)) {
  752.     if (($me isop $chan(%i)) || ($me ishop $chan(%i))) && (($hget(nbs,blacklist_custom_channels) != 1) || ($istok($hget(nbs,blacklist_channels),$chan(%i),32))) { .timerbls. [ $+ [ $cid ] $+ ] . [ $+ [ $chan(%i) ] ] 1 [ %i ] n.blscan $chan(%i) }
  753.     inc %i
  754.   }
  755. }
  756. alias n.start.echo {
  757.   echo $color(info) -s - $clr(normal,$strip($n.name $n.version)) $iif($insttime > 86400,installed for $clr(normal, $+ $dur($insttime,2))) using theme $clr(normal,$tname)
  758.   echo $color(info) -s - $clr(normal,Ctrl+F1:) Commands $+ , $clr(normal,F2:) configuration
  759.   if ($lines(scripts\txt\tips.txt) > 0) {
  760.     echo -s $chr(160)
  761.     echo -s - tip: $read(scripts\txt\tips.txt)
  762.   }
  763.   titleupdate
  764. }
  765. alias leet { say $replace($1-,a,4,e,3,i,1,s,5,g,6,t,7,o,00,ä,'a',ö,'o') }
  766. alias mp3 np
  767. alias who {
  768.   set %n.whosvar 1
  769.   !who $1-
  770. }
  771. alias names {
  772.   set %show.names 1
  773.   !names $1-
  774. }
  775. alias n.getitunes {
  776.   .comopen itunes iTunes.application
  777.   if (!$comerr) {
  778.     .echo -qg $com(itunes,PlayerState,3)
  779.     if ($com(itunes).result == 1) {
  780.       .echo -qg $com(itunes,CurrentTrack,3,dispatch* itrack)
  781.       .echo -qg $com(itunes,CurrentStreamTitle,3)
  782.       .echo -qg $com(itrack,Name,3)
  783.       set %it.title $com(itrack).result
  784.       .echo -qg $com(itrack,Artist,3)
  785.       set %it.artist $com(itrack).result
  786.       .echo -qg $com(itrack,Album,3)
  787.       set %it.album $com(itrack).result
  788.       .echo -qg $com(itrack,BitRate,3)
  789.       set %it.bitrate $com(itrack).result
  790.       .echo -qg $com(itrack,Duration,3)
  791.       set %it.ttime $com(itrack).result
  792.       .echo -qg $com(itunes,PlayerPosition,3)
  793.       set %it.etime $com(itunes).result
  794.       .echo -qg $com(itrack,KindAsString,3)
  795.       set %it.type $com(itrack).result
  796.     }
  797.   }
  798.   if ($com(itrack)) .comclose itrack
  799.   if ($com(itunes)) .comclose itunes
  800. }
  801.  
  802. alias n.alarm_action {
  803.   if (%alarm.beep == 1) beep 10 100
  804.   elseif ($isfile(%alarm.sound)) splay %alarm.sound
  805.   echo $color(info) -st $npre Alarm finished $iif(%alarm.message == 1,$par($ncfg(alarm_message)))
  806.   if (%alarm.message) n.ptext - $chr(1) Alarm $chr(1) $ncfg(alarm_message)
  807.   if (%alarm.program.on == 1) run -p $ncfg(alarm_program)
  808. }
  809. alias dns {
  810.   if (!$1) { dns | return }
  811.   echo $color(other) -atq $npre Looking up $n.quote($1)
  812.   .!dns $1-
  813. }
  814. alias fasttitle {
  815.   if ($appstate == tray) !flash $strip($remove($1-,$,%,|))
  816.   else !dll scripts\dll\aircdll.dll SetMircTitle $strip($eval($1-,1))
  817.   .!timertitlebar off
  818. }
  819. alias n.history {
  820.   if ($read($1,w,$2-)) {
  821.     write -dl $+ $readn $1
  822.   }
  823.   write -il0 $1-
  824.   while ($lines($1) > 20) {
  825.     write -dl $+ $lines($1) $1
  826.   }
  827. }
  828. alias idle {
  829.   if (!$isid) && ($1) {
  830.     set -u5 %whois.idle 1
  831.     !whois $1 $1
  832.   }
  833. }
  834. alias titleupdate {
  835.   if ($appstate != minimized) && ($appstate != tray) {
  836.     if (!$timer(titlebar)) .timertitlebar -i 0 10 titleupdate
  837.     if ($status == connected) {
  838.       if (!$hget(temp,clag.block)) && ($hget(nbs,check_lag) == 1) {
  839.         hadd -mu29 temp clag.block 1
  840.         .notice $me lag437289 $ticks
  841.       }
  842.       if ($dialog(tb)) {
  843.         did -ac tb 1 $+($network,:) $+($server,:,$port)
  844.         var %lag = $iif(%lag. [ $+ [ $cid ] ],$ifmatch ms, --)
  845.         if ($away) { did -ar tb 2 connected: $dur($uptime(server,3),2) $+ $iif($hget(nbs,check_lag) == 1,$c44 lag: %lag) $+ , away: $dur($awaytime,2) ( $+ $awaymsg $+ ) }
  846.         elseif ($idle > 60) { did -ac tb 2 idle: $dur($idle,2) $+ , connected: $dur($uptime(server,3),2) $+ $iif($hget(nbs,check_lag) == 1,$c44 lag: %lag) }
  847.         else { did -ac tb 2 connected: $dur($uptime(server,3),2) $+ $iif($hget(nbs,check_lag) == 1,$c44 lag: %lag) }
  848.       }
  849.     }
  850.     elseif ($dialog(tb)) {
  851.       did -ac tb 1 nbs-irc $n.version - nbs-irc.net
  852.       did -ac tb 2 Use F2 to configure nbs-irc
  853.     }
  854.   }
  855.   .titlebar $iif($hget(nbs,titlebar_version) == 1,$version - $strip($n.name $n.version)) $iif($hget(nbs,titlebar_lag) == 1, $iif(%lag. [ $+ [ $cid ] ],- $ifmatch ms))
  856.   if ($time(H) == 23) && ($time(n) == 59) .timerdaychange -o 0:00 1 0 scon -at1 n.daychange
  857.   if ($ncfg(ci-check) == 1) {
  858.     if (%cicheck > 6) {
  859.       set %cicheck 0
  860.       ci-check
  861.     }
  862.     else inc %cicheck 1
  863.   }
  864. }
  865. alias n.daychange {
  866.   if ($ncfg(show_daychanged) == 1) {
  867.     var %i = 1, %msg = Day changed to $day $par($date(d mmm yyyy))
  868.     while (%i <= $chan(0)) {
  869.       n.echo info -t $chan(%i) %msg
  870.       inc %i
  871.     }
  872.     var %i = 1
  873.     while (%i <= $query(0)) {
  874.       n.echo info -t $query(%i) %msg
  875.       inc %i
  876.     }
  877.     n.echo info -st %msg
  878.   }
  879. }
  880. alias clag {
  881.   set %lc 1
  882.   .notice $me lag437289 $ticks
  883. }
  884. ;L
  885. alias -l n.checkscript {
  886.   if (!$script($1-)) {
  887.     if ($exists(scripts\ $+ $1-)) .load -rs scripts\ $+ $1-
  888.     else { echo 4 -atg * Script file $1- does not exist, replace file or reinstall nbs-irc. }
  889.   }
  890. }
  891. alias -l n.checkalias {
  892.   if (!$alias($1-)) {
  893.     if ($exists(scripts\ $+ $1-)) .load -a scripts\ $+ $1-
  894.     else { echo 4 -atg * Alias file $1- does not exist, replace file or reinstall nbs-irc. }
  895.   }
  896. }
  897. alias rcon_win {
  898.   if (!%rcon.port) return
  899.   if (!$window(@rcon)) dlg rcon_pass
  900.   else n.echo info -atgOnly one rcon connection supported, please close the existing rcon window.
  901. }
  902.  
  903. on *:udpread:rcon:{
  904.   if ($sockerr > 0) return
  905.   :nextread
  906.   sockread -f %rcon
  907.   if ($sockbr == 0) return
  908.   if (challenge rcon isin %rcon) {
  909.     .timerrcon off
  910.     set %rcon.id $gettok(%rcon,3,32)
  911.     window -ek0d @rcon nbs.ico
  912.     titlebar @rcon $+([,%rcon.ip,:,%rcon.port,])
  913.     echo -t @rcon $npre connected to $+(%rcon.ip,:,%rcon.port)
  914.   }
  915.   if (!%rcon) { goto end }
  916.   if ($left($remove(%rcon,ÿÿÿÿ),1) == l) var %rcon.svar = $right($remove(%rcon,ÿÿÿÿ),-1)
  917.   else var %rcon.svar = $remove(%rcon,ÿÿÿÿ)
  918.   echo -t @rcon <- %rcon.svar
  919.   :end
  920.   goto nextread
  921. }
  922. On *:INPUT:@rcon:{
  923.   echo -t @rcon -> $1-
  924.   rcon_cmd $1-
  925.   haltdef
  926. }
  927. alias rcon_cmd if ($1) sockudp -k rcon 5000 %rcon.ip %rcon.port ÿÿÿÿ $+ rcon %rcon.id %rcon.pass $1- $+ $lf
  928. On *:CLOSE:@rcon:{
  929.   sockclose rcon*
  930.   unset %rcon.*
  931. }
  932. alias awaysys {
  933.   if ($away) n.echo normal -atg you are already marked away: $awaymsg
  934.   else dlg way
  935. }
  936. alias lame power $1-
  937. alias power {
  938.   var %i = 1, %op = 0, %s = 0, %alla = 0
  939.   while (%i <= $chan(0)) {
  940.     if ($me isop $chan(%i)) {
  941.       inc %op 1
  942.       inc %s $nick($chan(%i),0)
  943.     }
  944.     inc %alla $nick($chan(%i),0)
  945.     inc %i 1
  946.   }
  947.   $iif($1 == -e,echo -agt $npre you are,me is) oped in $+(%op,/,$chan(0)) channels on $+($network,.) (in control of $+(%s,/,%alla) people)
  948. }
  949. on *:start:{
  950.   if ($version < 7) {
  951.     if ($n.input(Error: your mIRC version is $version $+ $c44 nbs-irc needs mIRC 7.0 or higher. $crlf $crlf $+ Would you like to go the mIRC download site?,y/n)) n.url http://www.mirc.com/get.html
  952.     exit
  953.   }
  954.   if ($uptime(mirc) < 500) n.checkfiles
  955.   dll scripts\dll\dcx.dll WindowProps $window(-2).hwnd +i 0 nbs.ico
  956.   .echo -qg $findfile(scripts\temp\topic\,*,0,.remove $1-)
  957.   .echo -qg $findfile(scripts\temp\,paste_*,0,.remove $1-)
  958.   .echo -qg $findfile(scripts\temp\,url_*,0,.remove $1-)
  959.   hmake temp 5
  960.   n.checkini
  961.   n.reloadconfig
  962.   n.updateevents
  963.   if ($ncfg(exttb) == 1) n.toolbar
  964.   background -ux
  965.   if ($dialog(strt)) did -a strt 1 3
  966.   if ($os == 2k) || ($os == 98) || ($os == 95) || ($os == nt) tray -i17 scripts\dll\i.dll
  967.   else tray -i18 scripts\dll\i.dll
  968.   .timertitlebar -i 0 10 titleupdate
  969.   .timestamp -f $n.timestamp
  970.   .disable #röstning
  971.   hadd temp version 2.3
  972.   hmake prot 10
  973.   hload -i prot config\config.ini protections
  974.   if ($dialog(strt)) did -a strt 1 7
  975.   if (!$tname) {
  976.     echo $color(info) -a - No theme loaded, loading default theme.
  977.     echo -a 
  978.     theme cold
  979.   }
  980.   cnicks
  981.   unset %txtload %wa.in %tedit* %n.connecting* %lag.* %temp %tmp* %ban* %oldnick.* %sbnc.* %psybnc.* %maxbans.* %topiclen.* %dns2nick* %addedit
  982.   ;if ($exists(scripts\r-own.nbs)) .load -rs1 scripts\r-own.nbs
  983.   if ($ncfg(updated) != 1) {
  984.     if ($script(misc.ini)) .unload -rs scripts\misc.ini
  985.     if ($exists(scripts\misc.ini)) .remove scripts\misc.ini
  986.     w_ncfg updated 1
  987.   }
  988.   if ($exists(fix.ini)) .timer 1 1 .remove fix.ini
  989.   if (!$insttime) dlg 1st
  990.   n.start.echo
  991.   autoconnect_connectnow
  992. }
  993. alias host2nick {
  994.   if ($1) {
  995.     set %dns2nick.host $1
  996.     echo $color(other) -atg $npre Searching for user(s) with host: %dns2nick.host
  997.     who %dns2nick.host
  998.   }
  999.   else n.echo other -atg Usage: /host2nick <hostname>
  1000. }
  1001. alias dns2nick host2nick $1-
  1002. alias ip2nick {
  1003.   if ($1) {
  1004.     set %tmp.i2n 1
  1005.     dns $1
  1006.   }
  1007.   else n.echo other -atg Usage: /ip2nick <ip>
  1008. }
  1009. alias mp3send {
  1010.   if ($1) && (http://* !iswm $swamp(trackfilename)) dc $+ $chr(99) $chr(115) $+ e $+ $chr(110) $+ d $1 $swamp(trackfilename)
  1011.   else n.echo info -atg Usage: /sendsong <nick>
  1012. }
  1013. alias n.mdx dll $cit(scripts\dll\mdx\mdx.dll) $1-
  1014. alias n.mdxv return scripts\dll\mdx\views.mdx
  1015. alias ncfg {
  1016.   if ($1) && ($hget(nbs,$1)) return $ifmatch
  1017. }
  1018. alias w_ncfg {
  1019.   if ($2) {
  1020.     hadd -m nbs $1-
  1021.     .writeini config\config.ini nbs-irc $1-
  1022.   }
  1023. }
  1024. alias ncfgc {
  1025.   if (!$readini(config\config.ini,nbs-irc,$1)) writeini config\config.ini nbs-irc $1-
  1026. }
  1027. alias n.reloadconfig {
  1028.   if ($hget(nbs)) hfree nbs
  1029.   hmake nbs 20
  1030.   hload -i nbs config\config.ini nbs-irc
  1031. }
  1032. alias n.highlight {
  1033.   if (!$1) return
  1034.   if ($ncfg(no_highlight) != off) && ($numtok($ncfg(no_highlight),44) > 0) {
  1035.     var %i = 1, %e = $numtok($ncfg(no_highlight),44)
  1036.     while (%i <= %e) {
  1037.       if ($gettok($ncfg(no_highlight),%i,44) iswm $address($nick,5)) return
  1038.       inc %i
  1039.     }
  1040.   }
  1041.   window -g2 #
  1042.   if ($hget(nbs,nickpip) == 1) && ((!%tmp.nbf) || (%tmp.nbf < 2)) {
  1043.     splay $qt($mircdirscripts\beep.wav)
  1044.     inc -u10 %tmp.nbf
  1045.   }
  1046.   if ($hget(nbs,nickwin) == 1) {
  1047.     if (!window(@highlights ( $+ $cid $+ )))  window -k0n @highlights ( $+ $cid $+ )
  1048.     var %echo = @highlights ( $+ $cid $+ )
  1049.   }
  1050.   else var %echo = -s
  1051.   echo $color(other) %echo _________________________________________________
  1052.   echo %echo $timestamp $replace($nick.style,<mode>,$cmode($nick,$chan,o),<nick>,$nick) $+  $replace($1-,$me, $+ $me $+ )
  1053.   echo %echo $kl(#) - $kl($date)
  1054.   echo $color(other) %echo ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
  1055.   if ($hget(nbs,popup_nick) == 1) n.ptext # $chr(1) Highlighted in # $chr(1) $replace($nick.style,<mode>,$cmode($nick,$chan,o),<nick>,$nick) $+  $1-
  1056. }
  1057. alias n.rejoin if ($me !ison $1) join -n $1-
  1058. alias ad { me is using $strip($n.name) $n.version (theme: $tname $+ ) - www.nbs-irc.net }
  1059. ctcp ^*:*:*:{
  1060.   if ($1 == dcc) {
  1061.     if ($hget(nbs,popup_dcc) == 1) n.ptext - $chr(1) DCC from $nick $chr(1) $npre $eval($strip($3),1) ( $+ $round($calc($6 /1024/1024),2) MB)
  1062.     .write $cit($logdir $+ -dcc.log) $date $time - Send from $nick $+ : $3 ( $+ $round($calc($6 /1024/1024),2) MB)
  1063.     if (!$appactive) && ($ncfg(dcc_sound) == 1) splay $qt($mircdirscripts\beep.wav)
  1064.   }
  1065.   elseif ($1 != sound) {
  1066.     haltdef
  1067.     if (%tmp.ctcp > 4) {
  1068.       .ignore -tu60 *!*@*
  1069.       n.echo ctcp -stge CTCP protection: ignoring CTCPs for 60 seconds
  1070.       return
  1071.     }
  1072.     inc -u15 %tmp.ctcp 1
  1073.     if ($1 == ping) {
  1074.       if ((%tmp.ctcp < 4) || (!%tmp.ctcp)) .ctcpreply $nick PING $2-
  1075.       n.echo ctcp -stme $kl(CTCP/PING) from $nick $par($address) $iif(%tmp.ctcp > 3,$par(Ignored))
  1076.       if ($hget(nbs,popup_other) == 1) n.ptext - $chr(1) CTCP $chr(1) $npre CTCP/PING) from $nick
  1077.  
  1078.     }
  1079.     elseif ($1 == version) {
  1080.       if ($nick isin %ctcp.ignore) { echo $color(ctcp) -stm $npre  $+ $kl(CTCP/VERSION) from $nick $par($address) $par(Ignored) | return }
  1081.       if ((%tmp.ctcp < 4) || (!%tmp.ctcp)) .ctcpreply $nick VERSION $strip($n.name $n.version) - $strip(www.nbs-irc.net)
  1082.       n.echo ctcp -stme $kl(CTCP/VERSION) from $nick $par($address) $iif(%tmp.ctcp > 3,$par(Ignored))
  1083.       if ($hget(nbs,popup_other) == 1) n.ptext - $chr(1) CTCP $chr(1) $npre CTCP/VERSION) from $nick
  1084.     }
  1085.     else n.echo ctcp -stme $kl(CTCP/ $+ $1 $+ ) from $nick $par($address) $iif(%tmp.ctcp > 3,$par(Ignored))
  1086.     if ($hget(nbs,popup_other) == 1) n.ptext - $chr(1) CTCP $chr(1) $npre CTCP/ $+ $eval($1,1) from $nick
  1087.   }
  1088. }
  1089. alias n.capss {
  1090.   if ($len($3-) > 9) {
  1091.     if ($calc(100- $len($removecs($strip($3-),A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,Å,Ä,Ö,Ü,Ë,É,Ø)) / $len($strip($3-)) *100) >= $hget(prot,$+($1,caps.maxpercent))) {
  1092.       kick $1-2 $iif($hget(prot,$+($1,caps.kickmsg)),$ifmatch,excess caps)
  1093.     }
  1094.   }
  1095. }
  1096. alias n.floods {
  1097.   hadd -m temp flood $dll(scripts\dll\aircdll.dll, Flood, $+($1,$chr(44),$wildsite) 1 $hget(prot,$+($1,flood.lines)) $hget(prot,$+($1,flood.seconds)))
  1098.   if (+FLOOD* iswm $hget(temp,flood)) {
  1099.     if ($hget(prot,$+($1,flood.ban)) == 1) ban $iif($hget(prot,$+($1,bantime)) isnum 1-,-u $+ $calc($ifmatch *60)) $1-2 $ncfg(ban_mask)
  1100.     kick $1-2 $iif($hget(prot,$+($1,flood.kickmsg)),$ifmatch,no flooding)
  1101.   }
  1102. }
  1103. alias n.repeats {  
  1104.   hinc -mu10 temp $+($1,$2,$strip($3-)) 1
  1105.   if ($hget(temp,$+($1,$2, $strip($3-))) >= $hget(prot,$+($1,repeat.max))) {
  1106.     hdel temp $+($1,$2,$strip($3-))
  1107.     if ($hget(prot,$+($1,repeat.ban)) == 1) ban $iif($hget(prot,$+($1,bantime)) isnum 1-,-u $+ $calc($ifmatch *60)) $1-2 $ncfg(ban_mask)
  1108.     kick $1-2 $iif($hget(prot,$+($1,repeat.kickmsg)),$ifmatch,no repeating)
  1109.   }
  1110. }
  1111. alias n.spams {
  1112.   if ($hget(prot,$+($1,advertising.type)) == 1) && (*#?* iswm $3-) {
  1113.     if ($hget(prot,$+($1,advertising.ban)) == 1) ban $iif($hget(prot,$+($1,bantime)) isnum 1-,-u $+ $calc($ifmatch *60)) $1-2 $ncfg(ban_mask)
  1114.     kick $1-2 $iif($hget(prot,$+($1,advertising.kickmsg)),$ifmatch,no advertising)
  1115.   }
  1116.   elseif ($hget(prot,$+($1,advertising.type)) == 1) && (*join*#?* iswm $3-) || */j*#?* iswm $3-) {
  1117.     if ($hget(prot,$+($1,advertising.ban)) == 1) ban $iif($hget(prot,$+($1,bantime)) isnum 1-,-u $+ $calc($ifmatch *60)) $1-2 $ncfg(ban_mask)
  1118.     kick $1-2 $iif($hget(prot,$+($1,advertising.kickmsg)),$ifmatch,no advertising)
  1119.   }
  1120. }
  1121. alias clonescan {
  1122.   if (!$1) var %ch = $active
  1123.   else var %ch = $1
  1124.   if (%ch !ischan) { echo $color(info) -atg $npre Usage: /clonescan [#channel] | return }
  1125.   if ($me !ison %ch) return
  1126.   var %i = 1, %w, %b
  1127.   if (!$chan(%ch).ial) {
  1128.     if ($nick(%ch,0) > 350) {
  1129.       var %b = $n.input(This is a very large channel $+ $c44 scanning it might result in being disconnected. Do you want to scan it anyway?,y/n)
  1130.       if (%b) {
  1131.         echo $color(info) -agt $npre updating ial for %ch $+ , please wait.
  1132.         set %csial %ch
  1133.         !who %ch
  1134.         return
  1135.       }
  1136.     }
  1137.     else {
  1138.       echo $color(info) -agt $npre updating ial for %ch $+ , please wait.
  1139.       set %csial %ch
  1140.       !who %ch
  1141.       return
  1142.     }
  1143.   }
  1144.   if ($hget(clones)) hfree clones
  1145.   hmake clones 1
  1146.   var %antal = $nick(%ch,0), %antalk
  1147.   while (%i <= %antal) {
  1148.     var %w = $address($nick(%ch,%i),2)
  1149.     if ($nick(%ch,%i)) hadd clones %w $hget(clones,%w) $clr(inf,$cmode($nick(%ch,%i),%ch,a)) $+ $nick(%ch,%i)
  1150.     inc %i
  1151.   }
  1152.   window -nk0 @clones
  1153.   echo @clones $chr(160)  
  1154.   echo @clones $chr(160)
  1155.   echo @clones Clones in %ch $+ :
  1156.   echo @clones $chr(160)
  1157.   var %i = 1
  1158.   while (%i <= %antal) {
  1159.     var %k = 1
  1160.     if ($numtok($hget(clones,%i).data,32) > 1) {
  1161.       var %k = $ifmatch, %w = $hget(clones,%i).data
  1162.       echo -i2 @clones $kl($hget(clones,%i).item)
  1163.       echo -i2 @clones $chr(160) %k $+ : $replace(%w,$chr(32),$str($chr(160),3))
  1164.       echo @clones $chr(160)
  1165.       inc %antalk %k
  1166.     }
  1167.     inc %i
  1168.   }
  1169.   var %unik = $calc(%antal - %antalk)
  1170.   echo @clones $npre Unique hosts: %unik $+ / $+ %antal $par($perc(%unik,%antal))
  1171.   window -a @clones
  1172.   hfree clones
  1173.   unset %csial
  1174. }
  1175. alias vote {
  1176.   if (%vote) { n.echo info -atg there is already an vote in progress | return }
  1177.   if (!$server) { n.echo -atg info not connected | return }
  1178.   if ($active !ischan) { n.echo info -atg not on a channel | return }
  1179.   set %vchan #
  1180.   set %vote $n.input(Enter topic (yes/no))
  1181.   set %ja 0
  1182.   set %nej 0
  1183.   msg %vchan %vote (vote with !yes or !no)
  1184.   .enable #röstning
  1185. }
  1186. alias voteoff {
  1187.   .disable #röstning
  1188.   msg %vchan result: %vote (yes: %ja - no: %nej $+ )
  1189.   if (%r.nicks) msg %vchan voted: $ifmatch
  1190.   unset %vote %ja %nej %röstat %r.nicks
  1191. }
  1192. #röstning off
  1193. ON *:TEXT:!yes:#: {
  1194.   if (# == %vchan) && ($address($nick,1) !isin %röstat) {
  1195.     set %röstat %röstat $address($nick,1)
  1196.     set %r.nicks %r.nicks $nick (y)
  1197.     inc %ja 1
  1198.   }
  1199. }
  1200. ON *:TEXT:!no:#: {
  1201.   if (# == %vchan) && ($address($nick,1) !isin %röstat) {
  1202.     set %röstat %röstat $address($nick,1)
  1203.     set %r.nicks %r.nicks $nick (n)
  1204.     inc %nej 1
  1205.   }
  1206. }
  1207. #röstning end
  1208. on ^*:HOTLINK:*.*.*.*:*:{ if ((www isin $1) || (/ isin $1) || ($chr(35) isin $1)) { halt } }
  1209. on *:HOTLINK:*.*.*.*:*:{
  1210.   set %hlip $remove($1,],[,$chr(40),$chr(41),@,/,\)
  1211.   if (*:?* !iswm %hlip) {
  1212.     if ($ncfg(defgame) == hl) set %hlip %hlip $+ :27015
  1213.     if ($ncfg(defgame) == bf) set %hlip %hlip $+ :14567
  1214.   }
  1215.   set %autoscan 1  
  1216.   g-join
  1217. }
  1218.  
  1219. alias dlg {
  1220.   if (!$1) return
  1221.   if (!$dialog($1)) dialog -m $1 $1
  1222. }
  1223. alias theme {
  1224.   if ($1) {
  1225.     if ($1 == -r) {
  1226.       set %poaksdfopka 1
  1227.       byt-tema $left($nopath($isalias(tname).fname),-4)
  1228.     }
  1229.     else byt-tema $1-
  1230.   }
  1231.   else dlg tema
  1232. }
  1233. alias g-join {
  1234.   if ($1) set %hlip $1
  1235.   dlg gl
  1236. }
  1237. alias sendcb {
  1238.   if (!$1) { n.echo info -atg Usage /sendcb <nick> [filename] | return }
  1239.   if (!$cb) { n.echo info -atg No text in clipboard | return }
  1240.   if (!$2) { var %c = 1, %r = $r(a,z) $+ $r(a,z) $+ $r(a,z) $+ $r(a,z) $+ $r(a,z)
  1241.     while (%c <= $cb(0)) {
  1242.       write clip- $+ %r $+ .txt $cb(%c)
  1243.       inc %c
  1244.     }
  1245.     dcc send $1 clip- $+ %r $+ .txt
  1246.     .timer 1 60 .remove clips- $+ %r $+ .txt
  1247.   }
  1248.   if ($2) {
  1249.     var %c = 1
  1250.     while (%c <= $cb(0)) {
  1251.       write $2 $+ .txt $cb(%c)
  1252.       inc %c
  1253.     }
  1254.     dcc send $1 $2 $+ .txt
  1255.     .timer 1 60 .remove $2 $+ .txt
  1256.   }
  1257. }
  1258. alias n.bnc {
  1259.   if (!$window($bncwin($1,$cid))) {
  1260.     window -k0ne $bncwin($1,$cid)
  1261.     echo -te $bncwin($1,$cid) $npre $1 window, right click for options.
  1262.   }
  1263.   else window -g1 $bncwin($1,$cid)
  1264.   if ($2) {
  1265.     .!msg - $+ $1-
  1266.     echo $color(notice) -t $bncwin($1,$cid) -› $2-
  1267.   }
  1268. }
  1269. alias nickserv_ghost {
  1270.   if ($lines(config\nickserv- $+ $network $+ .txt) > 0) {
  1271.     var %a = $read(config\nickserv- $+ $network $+ .txt), %k = $calc($len($gettok(%a,2-,44)) +1), %i = 1
  1272.     while (%k > 1) {
  1273.       var %k = $calc(%k -3), %r = %r $+ $chr($calc($mid($gettok(%a,2-,44),%k,3) + %i))
  1274.       inc %i 1
  1275.     }
  1276.     set %tmp.ghost $gettok(%a,1,44)
  1277.     nickserv ghost $gettok(%a,1,44) %r
  1278.   }
  1279. }
  1280. on ^*:snotice:*:{
  1281.   haltdef
  1282.   if ($nick == irc.psychoid.net) {
  1283.     n.bnc psyBNC
  1284.     echo -tm $bncwin(psyBNC,$cid) ‹- $1-
  1285.   }
  1286.   elseif ($nick == shroudbnc.info) set %sbnc. [ $+ [ $cid ] ] 1
  1287.   else echo $color(notice) -stq $npre $par($nick) $1-
  1288. }
  1289.  
  1290. on ^*:notice:*:*:{
  1291.   haltdef
  1292.   if ($target ischan) {
  1293.     echo $color(notice) -tgm $target $pre $par($+($cmode($nick,$target),:,$target)) $1-
  1294.     if ($chr(1) $+ # isin $hget(prot,chans)) && ($me isop $target) || ($me ishop $target) {
  1295.       if (($nick isop #) || ($nick ishop #)) && (!$hget(prot,$+(#,punishops))) return
  1296.       if ($hget(prot,$+(#,caps)) == 1) n.capss $target $nick $1-
  1297.       if ($hget(prot,$+(#,repeat)) == 1) n.repeats $target $nick $1-
  1298.       if ($hget(prot,$+(#,flood)) == 1) n.floods $target $nick $1-
  1299.       if ($hget(prot,$+(#,advertising)) == 1) n.spams $target $nick $1-
  1300.     }
  1301.   }
  1302.   elseif ($address === psyBNC@lam3rz.de) && ($nick === Welcome) || ($nick === Wilkommen) set %psybnc. [ $+ [ $cid ] ] 1
  1303.   elseif ($nick == -psyBNC) {
  1304.     n.bnc psyBNC
  1305.     echo -tmi4 $bncwin(psybnc,$cid) ‹- $1-
  1306.   }
  1307.   elseif ($nick == -sBNC) {  
  1308.     n.bnc sBNC
  1309.     echo -tmi4 $bncwin(sBNC,$cid) ‹- $1-
  1310.   }
  1311.   elseif ($nick == $me) && ($1 == lag437289) {
  1312.     set %lag. $+ $cid $calc($ticks - $2)
  1313.     if (%lc == 1) n.echo other -atg latency to $server $+ : %lag. [ $+ [ $cid ] ] ms
  1314.     unset %lc
  1315.     titleupdate
  1316.   }
  1317.   elseif ($n.qnet) && ($len($nick) == 1) {
  1318.     if ($dialog(botctrl)) && (%bc.getmode) {
  1319.       if ($1-7 == chanlev is only available to authed users.) {
  1320.         did -ar botctrl 99 You are not authed
  1321.         did -b botctrl 98,8
  1322.       }
  1323.       if ($1-2 == Can't find) || ($3- ==  is not authed.) {
  1324.         did -ar botctrl 99 (not authed)
  1325.         did -b botctrl 98,8
  1326.       }
  1327.       elseif ($1-6 == user %bc.nick is not known on) did -ar botctrl 99 (none)
  1328.       elseif (flags for %bc.nick on isin $1-) did -ar botctrl 99 $6
  1329.       elseif (!$3) && ($2) did -ar botctrl 99 + $+ $2
  1330.       did -c botctrl 99 1
  1331.     }
  1332.     elseif ($1 == CHALLENGE) && ($nick === Q) {
  1333.       if (LEGACY-MD5 isin $3-) {
  1334.         var %k = $calc($len($ncfg(authpass)) +1), %i = 1
  1335.         while (%k > 1) {
  1336.           var %k = $calc(%k -3), %r = %r $+ $chr($calc($mid($ncfg(authpass),%k,3) + %i))
  1337.           inc %i 1
  1338.         }
  1339.         n.echo notice -agqt received key, sending auth.
  1340.         .msg q@cserve.quakenet.org challengeauth $ncfg(authnick) $md5($left(%r,10) $2) LEGACY-MD5
  1341.       }
  1342.       else n.echo info -atg Error: LEGACY-MD5 seems to be removed, disable challengeauth to auth.
  1343.     }
  1344.     elseif ($mid($1,2,-1) ischan) n.echo notice -t $mid($1,2,-1) $kl($nick) $1-
  1345.     else n.echo notice -atgi4 $kl:($nick) $1-
  1346.   }
  1347.   elseif ($n.unet) && ($nick == x) {
  1348.     if ($mid($1,2,-1) ischan) n.echo notice -t $mid($1,2,-1) $kl($nick) $1-
  1349.     else n.echo notice -atgi4 $kl:($nick) $1-
  1350.   }
  1351.   elseif ($nick === ChanServ) && ($mid($1,2,-1) ischan) n.echo notice -t $mid($1,2,-1) $kl($nick) $1-
  1352.   elseif ($1-2 === DCC Send) && ($3) {
  1353.     n.echo notice -seti4 $kl:(DCC Send from $nick) $deltok($3-,-1,32) $par($mid($gettok($3-,-1,32),2,-1))
  1354.   }
  1355.   else {
  1356.     n.echo notice -atmi4 $kl:(notice from $nick) $1-
  1357.   }
  1358.   if ($nick === NickServ) && ($ncfg(nickserv_on) == 1) {
  1359.     if (nickname is registered isin $1-) && ($exists(config\nickserv- $+ $network $+ .txt)) {
  1360.       var %a = $read(config\nickserv- $+ $network $+ .txt)
  1361.       if ($me == $gettok(%a,1,44)) {
  1362.         var %k = $calc($len($gettok(%a,2-,44)) +1), %i = 1
  1363.         while (%k > 1) {
  1364.           var %k = $calc(%k -3), %r = %r $+ $chr($calc($mid($gettok(%a,2-,44),%k,3) + %i))
  1365.           inc %i 1
  1366.         }
  1367.         $ncfg(nickserv_prefix) %r
  1368.       }
  1369.     }
  1370.     elseif (ghost with your nick has been killed isin $1-) nick %tmp.ghost
  1371.   }
  1372. }
  1373. alias back if ($away) dlg back
  1374. on *:APPACTIVE:titleupdate
  1375. on ^*:CLOSE:@psyBNC (*):if ($window(-psybnc)) close -m -psyBNC
  1376. on ^*:CLOSE:@sBNC (*):if ($window(-sbnc)) close -m -sBNC
  1377. alias echoall {
  1378.   if (!$1) { return }
  1379.   var %i = 1  
  1380.   while (%i <= $chan(0)) {
  1381.     echo -g $chan(%i) $1-
  1382.     inc %i
  1383.   }
  1384.   unset %i
  1385. }
  1386. alias topicall {
  1387.   var %i = 1
  1388.   while (%i <= $chan(0)) {
  1389.     if ($chan(%i).topic) echo $color(topic) -tgi4 $chan(%i) - Topic: $chan(%i).topic
  1390.     inc %i
  1391.   }
  1392.   unset %i
  1393. }
  1394. alias whochan {
  1395.   if (!$1) return
  1396.   var %c = $1
  1397.   if (!%whos) || (%whos > 180) set -u120 %whos 5
  1398.   else inc %whos 10
  1399.   if ($nick(%c,0) < 150) && ($nick(%c,0) > 1) && (!$chan(%c).ial) .timerwho. [ $+ [ $cid ] $+ ] . [ $+ [ %c ] ] 1 [ %whos ] !who %c
  1400. }
  1401. alias topicchan {
  1402.   if (!$1) return
  1403.   if ($chan($1).topic) .write -il1 $+(scripts\temp\topic\,$md5($1),â,$cid) $chan($1).topic
  1404. }
  1405. alias ehide { return $istok($hget(temp,$1),$2,44) }
  1406. alias hideshow.event {
  1407.   if ($2) {
  1408.     if ($ehide($2,$1)) hadd -m temp $2 $remtok($hget(temp,$2),$1,44)
  1409.     else hadd -m temp $2 $addtok($hget(temp,$2),$1,44)
  1410.     if ($hget(temp,$2)) w_ncfg hide_ $+ $2 $hget(temp,$2)
  1411.     else w_ncfg hide_ $+ $2 o
  1412.   }
  1413. }
  1414. alias n.saveconfig {
  1415.   hsave -i nbs config\config.ini nbs-irc
  1416. }
  1417. alias n.updateevents {
  1418.   hadd -m temp joins $ncfg(hide_joins)
  1419.   hadd -m temp parts $ncfg(hide_parts)
  1420.   hadd -m temp quits $ncfg(hide_quits)
  1421.   hadd -m temp nicks $ncfg(hide_nicks)
  1422. }
  1423. alias n.checkini {
  1424.   if ($isdir(txt)) && (!$isdir(config)) .rename txt config
  1425.   if (!$isdir(config)) .mkdir config
  1426.   if (!$isdir(logs)) .mkdir logs
  1427.   if (!$isdir(download)) .mkdir download
  1428.   if (!$isdir(scripts\temp)) .mkdir scripts\temp
  1429.   if (!$isdir(scripts\temp\topic)) .mkdir scripts\temp\topic
  1430.   if (!$exists(config\slaps.txt)) write config\slaps.txt slaps [nick] around a bit with a large trout
  1431.   if (!$exists(config\kor.txt)) write config\kor.txt $+(cmd,$crlf,notepad,$crlf,calc,$crlf,regedit,$crlf,www.nbs-irc.net,$crlf,www.nbs-irc.net/forum,$crlf,www.google.com)
  1432.   if ($exists(config\autojoin.txt)) .rename config\autojoin.txt config\autojoin-QuakeNet.txt
  1433.   if (!$exists(config\autojoin-quakenet.txt)) { write -c config\autojoin-QuakeNet.txt }
  1434.   if (!$exists(config\hl-servers.txt)) { write config\hl-servers.txt 130.243.72.27:27015 }
  1435.   if (!$exists(config\kicks.txt)) { write config\kicks.txt bye }
  1436.   if (!$exists(config\quits.txt)) { write -c config\quits.txt }
  1437.   if (!$exists(config\mp3.txt)) write config\mp3.txt winamp » [mp3] :: [time] $crlf $+ np: [mp3] :: [time]
  1438.   if (!$exists(config\games.txt)) {
  1439.     write config\games.txt CS 1.6 $chr(124) c:\program\steam\steam.exe -applaunch 10 +connect [adr] +password [pass]
  1440.     write config\games.txt CS:Source $chr(124) c:\program\steam\steam.exe -applaunch 240 +connect [adr] +password [pass]
  1441.     write config\games.txt UT2004 $chr(124) C:\UT2004\system\ut2004.exe [adr] [pass]
  1442.     write config\games.txt Call of Duty 2 $chr(124) c:\program\activision\call of duty 2\cod2mp_s.exe +password [pass] +connect [adr]
  1443.   }
  1444.   if (!$exists(config\awaymsg.txt)) write -c config\awaymsg.txt away
  1445.   if (!$exists(config\awaynick.txt)) write -c config\awaynick.txt [nick]\away
  1446.   if (!$exists(scripts\a-own.nbs)) {
  1447.     .write scripts\a-own.nbs $chr(59) you can put your own alises here, this file will not be overwritten when updating nbs-irc
  1448.     .load -a scripts\a-own.nbs
  1449.   }
  1450.   if (!$exists(scripts\r-own.nbs)) {
  1451.     .write scripts\r-own.nbs $chr(59) you can put your own remote scripts here, this file will not be overwritten when updating nbs-irc
  1452.     .load -rs1 scripts\r-own.nbs
  1453.   }
  1454.   ncfgc installtime $ctime
  1455.   ncfgc whois @whois
  1456.   ncfgc whois_inside 1
  1457.   ncfgc query_show_online 1
  1458.   ncfgc modeprefix 1
  1459.   ncfgc highlight_nick_color 8
  1460.   ncfgc nickwin 1
  1461.   ncfgc ar_time 3
  1462.   ncfgc newcc 1
  1463.   ncfgc exttb 1
  1464.   ncfgc smsg say
  1465.   ncfgc skanaler #chan1 #chan2 (# = all channels)
  1466.   ncfgc mp3s say winamp » [mp3] :: [time]
  1467.   ncfgc mp3getcmd !get $+ $r(1,9)
  1468.   ncfgc authnick nick
  1469.   ncfgc authpass pass
  1470.   ncfgc nickserv_on 1
  1471.   ncfgc nickserv_prefix nickserv identify
  1472.   ncfgc awaynick [nick]\away
  1473.   ncfgc awaymed away
  1474.   ncfgc wapath c:\program\winamp\winamp.exe
  1475.   ncfgc nickpip 1
  1476.   ncfgc nickbar 1
  1477.   ncfgc privpip 1
  1478.   ncfgc privljud psljud
  1479.   ncfgc autojoin_minimize 1
  1480.   ncfgc autorejoin 1
  1481.   ncfgc cic-time 10
  1482.   ncfgc blacklist 1
  1483.   ncfgc dcc_sound 1
  1484.   ncfgc ban_mask 1
  1485.   ncfgc quakenet_bot_autojoin 1
  1486.   ncfgc undernet_bot_autojoin 1
  1487.   ncfgc titlebar_version 1
  1488.   ncfgc reclaim_nick 1
  1489.   ncfgc nicklist_use_themed_colors 1
  1490.   ncfgc use_theme_fonts 1
  1491.   ncfgc version_check 1
  1492.   ncfgc check_lag 1
  1493.   ncfgc no_highlight off
  1494.   ncfgc show_daychanged 1
  1495.   ncfgc fkey_f1 /help  
  1496.   ncfgc fkey_f3 /awaysys
  1497.   ncfgc fkey_f4 /back
  1498.   ncfgc fkey_f5 /lastpop
  1499.   ncfgc fkey_f7 /topic $eval(#,0)
  1500.   ncfgc fkey_f8 /np
  1501.   ncfgc fkey_f9 /logviewer
  1502.   ncfgc fkey_f10 /g-join
  1503.   ncfgc fkey_f11 /blist
  1504.   ncfgc fkey_f12 /aboutnbs
  1505.   ncfgc tb_skin nbs.png
  1506.   ncfgc popup_query_always o
  1507.   ncfgc popup_nick 1
  1508.   ncfgc popup_query 1
  1509.   ncfgc popup_discon 1
  1510.   ncfgc popup_dcc 1
  1511.   ncfgc popup_other 1
  1512.   ncfgc popup_mode 2
  1513.   ncfgc popup_timeout 6
  1514.   ncfgc popup_posx -7
  1515.   ncfgc popup_posy -75
  1516.   ncfgc popup_centerx o
  1517.   ncfgc popup_centery o
  1518.   ncfgc popup_away o
  1519.   ncfgc auto_connect_1_server irc.example.org (Example)
  1520. }
  1521.  
  1522. ; dialogs
  1523.  
  1524. dialog paste {
  1525.   title "Paste"
  1526.   size -1 -1 219 155
  1527.   option dbu
  1528.   icon scripts\dll\i.dll, 17
  1529.   text "", 1, 2 2 166 8
  1530.   edit "", 2, 2 11 215 130, multi return autohs vsbar
  1531.   check "Delay lines (seconds):", 3, 3 143 63 10
  1532.   edit "1", 7, 66 143 19 11, autohs
  1533.   button "Paste", 4, 142 143 37 11, ok
  1534.   button "Cancel", 5, 180 143 37 11, cancel
  1535. }
  1536. on *:dialog:paste:init:0:{
  1537.   did -a paste 1 Are you sure you want to paste $cb(0) lines of text into this window?
  1538.   dialog -t paste Paste to %paste.target
  1539.   var %i = 1
  1540.   while (%i <= $cb(0)) {
  1541.     did -a paste 2 $cb(%i) $+ $crlf
  1542.     inc %i
  1543.   }
  1544.   if ($cb(7)) did -c paste 3
  1545.   if ($cb(12)) did -ar paste 7 2
  1546.   if ($cb(20)) did -ar paste 7 3
  1547.   did -f paste 4
  1548. }
  1549. on *:dialog:paste:sclick:4:{
  1550.   if (%paste.target) {
  1551.     var %x = scripts\temp\paste_ $+ $r(a,z) $+ $r(a,z) $+ $r(a,z) $+ $r(a,z)
  1552.     savebuf -o paste 2 %x
  1553.     if ($did(paste,2,1) isnum) .write -il1 %x $crlf
  1554.     if ($did(paste,3).state == 1) && ($did(paste,7) isnum 1-) .play -a pastemsg %paste.target %x $did(paste,7) $+ 000
  1555.     else .play -a pastemsg %paste.target %x 0
  1556.   }
  1557.   unset %paste.target
  1558.   .timer 1 600 .remove %x
  1559. }
  1560.  
  1561. dialog strt {
  1562.   title ""
  1563.   size -1 -1 66 3
  1564.   option dbu
  1565.   text "", 1, 3 3 60 6
  1566. }
  1567. on *:dialog:strt:init:0:{
  1568.   n.mdx SetMircVersion $version
  1569.   n.mdx MarkDialog $dname
  1570.   n.mdx SetDialog $dname style dlgframe
  1571.   n.mdx SetControlMDX $dname 1 progressbar smooth > scripts\dll\mdx\ctl_gen.mdx
  1572.   did -a strt 1 0 0 10
  1573. }
  1574.  
  1575. dialog cp {
  1576.   title "Control Panel (/setup)"
  1577.   size -1 -1 244 191
  1578.   option dbu
  1579.   icon scripts\dll\i.dll, 17
  1580.   list 1, -1 -1 246 176, size extsel
  1581.   button "Close", 2, 205 178 37 11, ok
  1582.   text "", 100, 3 180 165 8
  1583. }
  1584. on *:dialog:cp:sclick:2:dialog -x cp
  1585. on *:dialog:cp:init:0:{
  1586.   n.mdx SetMircVersion $version
  1587.   n.mdx MarkDialog $dname
  1588.   n.mdx SetControlMDX cp 1 ListView icon sortascending > scripts\dll\mdx\views.mdx
  1589.   did -i cp 1 1 iconsize 32 32
  1590.   did -i cp 1 1 seticon list 2, $+ $scriptdirdll\i.dll
  1591.   did -a cp 1 0 1 Misc settings
  1592.   did -i cp 1 1 seticon list 0, $+ $scriptdirdll\i.dll
  1593.   did -a cp 1 0 2 Theme/font
  1594.   did -i cp 1 1 seticon list 5, $+ $scriptdirdll\i.dll
  1595.   did -a cp 1 0 3 Sound/highlight
  1596.   did -i cp 1 1 seticon list 6, $+ $scriptdirdll\i.dll
  1597.   did -a cp 1 0 4 Song announce
  1598.   did -i cp 1 1 seticon list 9, $+ $scriptdirdll\i.dll
  1599.   did -a cp 1 0 5 Protections
  1600.   did -i cp 1 1 seticon list 12, $+ $scriptdirdll\i.dll
  1601.   did -a cp 1 0 6 Auto connect
  1602.   did -i cp 1 1 seticon list 19, $+ $scriptdirdll\i.dll
  1603.   did -a cp 1 0 7 Autojoin
  1604.   did -i cp 1 1 seticon list 8, $+ $scriptdirdll\i.dll
  1605.   did -a cp 1 0 8 QuakeNet
  1606.   did -i cp 1 1 seticon list 23, $+ $scriptdirdll\i.dll
  1607.   did -a cp 1 0 9 UnderNet
  1608.   did -i cp 1 1 seticon list 20, $+ $scriptdirdll\i.dll
  1609.   did -a cp 1 0 10 NickServ
  1610.   did -i cp 1 1 seticon list 18, $+ $scriptdirdll\i.dll
  1611.   did -a cp 1 0 11 Notifications
  1612.   did -i cp 1 1 seticon list 11, $+ $scriptdirdll\i.dll
  1613.   did -a cp 1 0 12 F-key bindings
  1614.   did -i cp 1 1 seticon list 3, $+ $scriptdirdll\i.dll
  1615.   did -a cp 1 0 13 Logviewer
  1616.   did -i cp 1 1 seticon list 1, $+ $scriptdirdll\i.dll
  1617.   did -a cp 1 0 14 Game launcher
  1618.   did -i cp 1 1 seticon list 15, $+ $scriptdirdll\i.dll
  1619.   did -a cp 1 0 15 Blacklist
  1620.   did -i cp 1 1 seticon list 21, $+ $scriptdirdll\i.dll
  1621.   did -a cp 1 0 16 Alarm timer
  1622.   did -i cp 1 1 seticon list 10, $+ $scriptdirdll\i.dll
  1623.   did -a cp 1 0 17 Commands
  1624.   did -i cp 1 1 seticon list 0, $+ $mircdirnbs.ico
  1625.   did -a cp 1 0 18 About
  1626.   ;n.showversion 100
  1627. }
  1628. on *:dialog:cp:dclick:1:{
  1629.   var %a = $gettok($did($dname,1).seltext,6-,32)
  1630.   if (mi isin %a) misc
  1631.   elseif (th isin %a) theme
  1632.   elseif (sou isin %a) nq
  1633.   elseif (son isin %a) mp3say
  1634.   elseif (pr isin %a) prot
  1635.   elseif (auto c isin %a) autocon
  1636.   elseif (autoj isin %a) caj
  1637.   elseif (qu isin %a) quakenet
  1638.   elseif (und isin %a) undernet
  1639.   elseif (ni isin %a) cns
  1640.   elseif (no isin %a) popups
  1641.   elseif (f- isin %a) fkeys
  1642.   elseif (lo isin %a) logviewer
  1643.   elseif (ga isin %a) g-join
  1644.   elseif (bl isin %a) blist
  1645.   elseif (al isin %a) alarm
  1646.   elseif (co isin %a) cf1
  1647.   elseif (ab isin %a) aboutnbs
  1648. }
  1649. alias botcontrol {
  1650.   unset %bc.*
  1651.   if ($2) set %bc.nick $2
  1652.   if ($1) set %bc.chan $1
  1653.   elseif ($active ischan) set %bc.chan $active
  1654.   if (q ison %bc.chan) set %bc.bot Q
  1655.   elseif (l ison %bc.chan) set %bc.bot L
  1656.   if (%bc.chan) && (%bc.bot) && (%bc.nick) dlg botctrl
  1657. }
  1658. dialog botctrl {
  1659.   title "-"
  1660.   size -1 -1 94 42
  1661.   option dbu
  1662.   icon $scriptdirdll\i.dll, 17
  1663.   text "Set:", 2, 2 14 13 8
  1664.   text "Current:", 150, 2 3 23 8
  1665.   button "Set", 8, 25 29 33 11, default ok
  1666.   button "Cancel", 9, 59 29 33 11, cancel
  1667.   combo 98, 30 13 62 91, edit drop
  1668.   text "", 99, 35 3 56 8, right
  1669. }
  1670. on *:dialog:botctrl:init:0:{
  1671.   did -f botctrl 98
  1672.   if (%bc.chan) && (%bc.bot) && (%bc.nick) {
  1673.     dialog -t botctrl Chanlev: %bc.nick
  1674.     set %bc.getmode 1
  1675.     .msg %bc.bot chanlev %bc.chan %bc.nick
  1676.     did -a botctrl 99 getting...
  1677.     did -c botctrl 99 1
  1678.     did -a botctrl 98 +gv (auto-voice)
  1679.     did -a botctrl 98 -gv
  1680.     did -a botctrl 98 $chr(32)
  1681.     did -a botctrl 98 +ao (auto-op)
  1682.     did -a botctrl 98 -ao
  1683.     did -a botctrl 98 $chr(32)
  1684.     did -a botctrl 98 +k (known)
  1685.     did -a botctrl 98 -k
  1686.     did -a botctrl 98 $chr(32)  
  1687.     did -a botctrl 98 +p (protect)
  1688.     did -a botctrl 98 -p
  1689.     did -a botctrl 98 $chr(32)  
  1690.     did -a botctrl 98 +m (master)
  1691.     did -a botctrl 98 -m
  1692.     did -a botctrl 98 $chr(32)
  1693.     did -a botctrl 98 +d (prevent op)
  1694.     did -a botctrl 98 -d
  1695.     did -a botctrl 98 $chr(32)
  1696.     did -a botctrl 98 +q (prevent voice)
  1697.     did -a botctrl 98 -q
  1698.     did -a botctrl 98 $chr(32)
  1699.     did -a botctrl 98 +j (auto invite)
  1700.     did -a botctrl 98 -j
  1701.   }
  1702. }
  1703.  
  1704. on *:dialog:botctrl:sclick:8:{
  1705.   if (%bc.chan) && (%bc.bot) && (%bc.nick) {
  1706.     if ($did(botctrl,98)) msg %bc.bot chanlev %bc.chan %bc.nick $gettok($ifmatch,1,32)
  1707.     else msg %bc.bot removeuser %bc.chan %bc.nick
  1708.   }
  1709. }
  1710.  
  1711.  
  1712. dialog popups {
  1713.   title "Notification popups (/popups)"
  1714.   size -1 -1 138 189
  1715.   option dbu
  1716.   icon $scriptdirdll\i.dll, 17
  1717.   tab "General", 15, 3 1 131 170
  1718.   box "Show notification popups:", 50, 9 18 119 64, tab 15
  1719.   box "Show notification popups for these events:", 51, 9 86 119 79, tab 15
  1720.   radio "When mIRC is not the active window", 6, 14 27 103 10, tab 15 group
  1721.   radio "Always show notifications", 7, 14 36 100 10, tab 15
  1722.   radio "Disable notifications", 8, 14 45 57 10, tab 15
  1723.   check "Don't show notifications while away", 4, 15 56 100 10, tab 15
  1724.   edit "", 9, 47 67 14 11, tab 15 autohs center
  1725.   text "seconds", 5, 63 69 25 8, tab 15
  1726.   text "Display time:", 1, 15 69 32 8, tab 15
  1727.   check "Highlights", 10, 16 95 50 11, tab 15
  1728.   check "Querys", 11, 16 104 50 11, tab 15
  1729.   radio "Only on first message", 2, 19 114 82 10, group tab 15
  1730.   radio "Always", 3, 19 123 36 10, tab 15
  1731.   check "DCCs", 12, 16 133 50 11, tab 15
  1732.   check "Connects/disconnects", 13, 16 142 70 11, tab 15
  1733.   check "Other events", 14, 16 151 56 11, tab 15
  1734.   tab "Positioning", 16
  1735.   combo 17, 17 29 104 100, tab 16 drop
  1736.   text "Width (x):", 304, 24 64 26 8, tab 16
  1737.   edit "", 40, 51 62 25 11, tab 16 center
  1738.   edit "", 41, 51 74 25 11, tab 16 center
  1739.   check "Center", 250, 81 63 30 10, tab 16
  1740.   check "Center", 251, 81 75 29 10, tab 16
  1741.   text "Negative value for right side of the screen. Positive value for left side of the screen.", 302, 14 107 110 15, tab 16
  1742.   text "Height (y):", 305, 22 76 28 7, tab 16
  1743.   button "Preview", 206, 92 131 37 11, tab 16
  1744.   box "Position:", 18, 8 50 121 43, tab 16
  1745.   box "Usage:", 53, 8 97 121 31, tab 16
  1746.   box "Presets:", 52, 8 19 121 27, tab 16
  1747.   button "OK", 100, 60 175 37 11, default ok
  1748.   button "Cancel", 101, 98 175 37 11, cancel
  1749. }
  1750. on *:dialog:popups:init:0:{
  1751.   if ($ncfg(popup_nick) == 1) did -c popups 10
  1752.   if ($ncfg(popup_query) == 1) did -c popups 11
  1753.   if ($ncfg(popup_dcc) == 1) did -c popups 12
  1754.   if ($ncfg(popup_discon) == 1) did -c popups 13
  1755.   if ($ncfg(popup_other) == 1) did -c popups 14
  1756.   if ($ncfg(popup_query_always) == 1) did -c popups 3
  1757.   else did -c popups 2
  1758.   if (!$ncfg(popup_query_always)) {
  1759.     w_ncfg popup_query_always 1
  1760.     did -c popups 2
  1761.   }
  1762.   if (!$ncfg(popup_mode)) {
  1763.     w_ncfg popup_mode 2
  1764.     did -c popups 6
  1765.   }
  1766.   elseif ($ncfg(popup_mode) == 2) did -c popups 6
  1767.   elseif ($ncfg(popup_mode) == 3) did -c popups 7
  1768.   elseif ($ncfg(popup_mode) == 4) did -c popups 8
  1769.   if ($ncfg(popup_timeout) !isnum 1-60) w_ncfg popup_timeout 7
  1770.   else did -a popups 9 $ncfg(popup_timeout)
  1771.   if (!$ncfg(popup_posx)) w_ncfg popup_posx -2
  1772.   else did -a popups 40 $ncfg(popup_posx)
  1773.   if (!$ncfg(popup_posy)) w_ncfg popup_posy -120
  1774.   else did -a popups 41 $ncfg(popup_posy)
  1775.   if (!$ncfg(popup_centerx)) w_ncfg popup_centerx o
  1776.   if (!$ncfg(popup_centery)) w_ncfg popup_centery o
  1777.   if ($ncfg(popup_centerx) == 1) { did -b popups 40 | did -c popups 250 }
  1778.   if ($ncfg(popup_centery) == 1) { did -b popups 41 | did -c popups 251 }
  1779.   did -a popups 17 Bottom left
  1780.   did -a popups 17 Bottom right (default)
  1781.   did -a popups 17 Top left
  1782.   did -a popups 17 Top right
  1783. }
  1784. on *:dialog:popups:sclick:100:{
  1785.   if ($did(popups,10).state == 1) w_ncfg popup_nick 1
  1786.   else w_ncfg popup_nick o
  1787.   if ($did(popups,11).state == 1) w_ncfg popup_query 1
  1788.   else w_ncfg popup_query o
  1789.   if ($did(popups,12).state == 1) w_ncfg popup_dcc 1
  1790.   else w_ncfg popup_dcc o
  1791.   if ($did(popups,13).state == 1) w_ncfg popup_discon 1
  1792.   else w_ncfg popup_discon o
  1793.   if ($did(popups,14).state == 1) w_ncfg popup_other 1
  1794.   else w_ncfg popup_other o
  1795.   if ($did(popups,3).state == 1) w_ncfg popup_query_always 1
  1796.   else w_ncfg popup_query_always o
  1797.   if ($did(popups,6).state == 1) w_ncfg popup_mode 2
  1798.   elseif ($did(popups,7).state == 1) w_ncfg popup_mode 3
  1799.   elseif ($did(popups,8).state == 1) w_ncfg popup_mode 4
  1800.   if ($did(popups,4).state == 1) w_ncfg popup_away 1
  1801.   else w_ncfg popup_away o
  1802.   if ($did(popups,9) !isnum 1-60) { .echo -qg $n.input(Enter a valid number between 1 and 60.,info) | did -f popups 9 | halt }
  1803.   w_ncfg popup_timeout $did(popups,9)
  1804.   if ($did(popups,250).state == 1) w_ncfg popup_centerx 1
  1805.   else w_ncfg popup_centerx o
  1806.   if ($did(popups,251).state == 1) w_ncfg popup_centery 1
  1807.   else w_ncfg popup_centery o
  1808.   if ($remove($did(popups,40),$chr(45),$chr(32)) !isnum) && ($did(popups,250).state != 1) { .echo -qg $n.input(Please enter a valid number value.,info) | did -f popups 40 | halt }
  1809.   if ($remove($did(popups,41),$chr(45),$chr(32)) !isnum) && ($did(popups,251).state != 1) { .echo -qg $n.input(Please enter a valid number value.,info) | did -f popups 41 | halt }
  1810.   elseif ($remove($did(popups,40),$chr(45),$chr(32)) !isnum) return
  1811.   elseif ($remove($did(popups,41),$chr(45),$chr(32)) !isnum) return
  1812.   w_ncfg popup_posx $remove($did(popups,40),$chr(32))
  1813.   w_ncfg popup_posy $remove($did(popups,41),$chr(32))
  1814.  
  1815. }
  1816. on *:dialog:popups:sclick:17:{
  1817.   if (bottom r isin $did(popups,17).seltext) {
  1818.     did -ra popups 40 -7
  1819.     did -ra popups 41 -75
  1820.     did -eeuu popups 40,41,250,251
  1821.   }
  1822.   elseif (top r isin $did(popups,17).seltext) {
  1823.     did -ra popups 40 -7
  1824.     did -ra popups 41 7
  1825.     did -eeuu popups 40,41,250,251
  1826.   }
  1827.   elseif (bottom l isin $did(popups,17).seltext) {
  1828.     did -ra popups 40 7
  1829.     did -ra popups 41 -75
  1830.   }
  1831.   elseif (top l isin $did(popups,17).seltext) {
  1832.     did -ra popups 40 7
  1833.     did -ra popups 41 7
  1834.   }
  1835. }
  1836. on *:dialog:popups:sclick:206:{
  1837.   var %text = Preview notification at $iif($did(popups,250).state == 1,(center),$did(popups,40)) $+ x $+ $iif($did(popups,251).state == 1,(center),$did(popups,41))
  1838.   var %h = $calc($height(l,$window(status window).font,$window(status window).fontsize) +25), %w = 250
  1839.   if ($window(@n.popup)) close -@ @n.popup
  1840.   if ($chr(45) isin $did(popups,40)) && ($did(popups,250).state == 0) { var %x = $calc($window(-1).w - (%w + $remove($did(popups,40),-))) }
  1841.   elseif ($chr(45) !isin $did(popups,40)) && ($did(popups,250).state == 0) { var %x = $did(popups,40) }
  1842.   elseif ($did(popups,250).state == 1) { var %x = $calc($window(-1).w / 2 - (%w /2)) }
  1843.   if ($chr(45) isin $did(popups,41)) && ($did(popups,251).state == 0)  { var %y = $calc($window(-1).h - $remove($did(popups,41),-) ) }
  1844.   elseif ($chr(45) !isin $did(popups,41)) && ($did(popups,251).state == 0) { var %y = $did(popups,41) }
  1845.   elseif ($did(popups,251).state == 1) { var %y = $calc($window(-1).h / 2 - (25+ %h)) }
  1846.   window -hdfonp +dL @n.popup %x %y %w %h
  1847.   window -o @n.popup
  1848.   drawfill @n.popup $color(background) 0 1 1
  1849.   drawtext -o @n.popup $color(highlight) tahoma 10 4 2 Preview
  1850.   drawtext -o @n.popup $color(info) tahoma 10 $calc(%w -51) 2 $time
  1851.   drawtext @n.popup $color(normal) $window(status window).font $window(status window).fontsize 4 20 %text
  1852.   drawrect @n.popup $color(normal) 0 0 0 %w %h
  1853.   if ($timerncpopup) .timerncpopup off
  1854.   .timerncpopup -oi 1 $iif($ncfg(popup_timeout),$ifmatch,6) close -@ @n.popup
  1855. }
  1856. on *:dialog:popups:sclick:250:{
  1857.   if ($did(popups,250).state == 1) did -b popups 40
  1858.   else did -e popups 40
  1859. }
  1860. on *:dialog:popups:sclick:251:{
  1861.   if ($did(popups,251).state == 1) did -b popups 41
  1862.   else did -e popups 41
  1863. }
  1864.  
  1865. dialog rcon_pass {
  1866.   title "Rcon"
  1867.   size -1 -1 83 43
  1868.   option dbu
  1869.   button "OK", 1, 52 32 30 10, default ok
  1870.   edit "", 2, 0 10 82 11, pass
  1871.   check "Save", 3, 1 22 25 10
  1872.   text "Password:", 4, 1 2 31 7
  1873. }
  1874. on *:dialog:rcon_pass:init:0:{
  1875.   if ($ncfg(rcon_password_save) == 1) {
  1876.     did -c rcon_pass 3
  1877.     if ($ncfg(rcon_password)) did -a rcon_pass 2 $ifmatch
  1878.   }
  1879.   did -f rcon_pass 2
  1880. }
  1881. on *:dialog:rcon_pass:sclick:1:{
  1882.   if ($did(rcon_pass,2).text) {
  1883.     set %rcon.pass $ifmatch
  1884.     if ($did(rcon_pass,3).state == 1) {
  1885.       w_ncfg rcon_password %rcon.pass
  1886.       w_ncfg rcon_password_save 1
  1887.     }
  1888.     else {
  1889.       w_ncfg rcon_password_save o
  1890.       w_ncfg rcon_password å
  1891.     }
  1892.     if (%rcon.pass) {
  1893.       sockudp -k rcon 5000 %rcon.ip %rcon.port ÿÿÿÿ $+ challenge rcon $+ $lf
  1894.       .timerrcon 1 1 sockclose rcon*
  1895.     }
  1896.   }
  1897. }
  1898.  
  1899.  
  1900. dialog exportlog {
  1901.   title "Saving log..."
  1902.   icon $scriptdiri.dll,18
  1903.   size -1 -1 50 10
  1904.   option dbu
  1905.   text "", 1, 1 6 50 7, center
  1906.   button "-", 2, 300 300 30 10, disable ok
  1907. }
  1908. On *:DIALOG:exportlog:init:0:{
  1909.   n.mdx SetMircVersion $version
  1910.   n.mdx MarkDialog $dname
  1911.   n.mdx SetDialog $dname style dlgframe
  1912. }
  1913. dialog tsettings {
  1914.   title "Theme settings"
  1915.   size -1 -1 89 37
  1916.   option dbu
  1917.   icon $scriptdirdll\i.dll, 22
  1918.   check "Apply theme colors for nick list", 1, 2 2 84 10,
  1919.   check "Apply theme fonts", 2, 2 12 62 10,
  1920.   button "OK", 100, 51 25 37 11, ok
  1921. }
  1922. on *:dialog:tsettings:init:0:{
  1923.   n.ds cr 1 nicklist_use_themed_colors
  1924.   n.ds cr 2 use_theme_fonts
  1925. }
  1926. on *:dialog:tsettings:sclick:1:n.ds cw 1 nicklist_use_themed_colors
  1927. on *:dialog:tsettings:sclick:2:n.ds cw 2 use_theme_fonts
  1928. dialog tedit {
  1929.   title "tedit"
  1930.   size -1 -1 169 228
  1931.   option dbu
  1932.   icon $scriptdirdll\i.dll,16
  1933.   box "Colors", 76, 3 25 163 129
  1934.   box "Style", 75, 3 155 163 58
  1935.   box "Basics", 77, 3 1 163 22
  1936.   edit "", 1, 24 8 50 11, autohs
  1937.   edit "", 2, 93 8 67 11, autohs
  1938.   edit "", 3, 7 43 155 95, multi return autovs vsbar
  1939.   button "Get current colors", 6, 87 139 75 11
  1940.   edit "", 4, 8 178 153 11, autohs
  1941.   text "Name:", 12, 7 10 17 8
  1942.   text "Info:", 13, 79 10 13 8
  1943.   combo 5, 71 163 90 60, drop
  1944.   text "Select item:", 7, 7 165 31 8
  1945.   text "", 8, 9 192 152 17
  1946.   button "Save as", 11, 91 216 37 11
  1947.   button "Cancel", 10, 129 216 37 11, cancel
  1948.   text "Tip: setup colors using mIRC's color dialog (Alt+k)", 9, 8 34 143 8
  1949. }
  1950. on *:dialog:tedit:init:0:{
  1951.   var %x = $+(",$scriptdirtema\,%tedit,.tem,"), %i = 3, %r
  1952.   if ($exists(%x)) {
  1953.     dialog -t tedit Theme editor: %tedit
  1954.     did -a tedit 1 $gettok($read(%x,nw,alias tname*),4,32)
  1955.     did -a tedit 2 $right($read(%x,1),-1)
  1956.     while (%r != $chr(125) && (%i < 100)) {
  1957.       var %r = $read(%x,n,%i)
  1958.       did -a tedit 3 %r $+ $crlf
  1959.       inc %i
  1960.     }
  1961.     did -d tedit 3 $calc($did(tedit,3).lines -1)
  1962.     did -a tedit 5 - Theme style:
  1963.     did -a tedit 5 Me style
  1964.     did -a tedit 5 Nick style
  1965.     did -a tedit 5 Bracket style 1
  1966.     did -a tedit 5 Bracket style 2
  1967.     did -a tedit 5 Quote style
  1968.     did -a tedit 5 Prefix
  1969.     did -a tedit 5 Timestamp
  1970.     did -a tedit 5 Font
  1971.     did -a tedit 5 - Nicklist colors:
  1972.     did -a tedit 5 Me color
  1973.     did -a tedit 5 Op color
  1974.     did -a tedit 5 Voice color
  1975.     did -a tedit 5 Regular color
  1976.     set %tedit.me.style $gettok($read(%x,nw,*me.style*),4-,32)
  1977.     set %tedit.nick.style $gettok($read(%x,nw,*nick.style*),4-,32)
  1978.     set %tedit.par.style $gettok($read(%x,nw,*par.style*),4-,32)
  1979.     set %tedit.bracket.style $gettok($read(%x,nw,*bracket.style*),4-,32)
  1980.     set %tedit.pre $gettok($read(%x,nw,*pre*),4-,32)
  1981.     set %tedit.quote.style $gettok($read(%x,nw,*quote.style*),4-,32)
  1982.     set %tedit.ttimestamp $gettok($read(%x,nw,*ttimestamp*),4-,32)
  1983.     set %tedit.tfont $gettok($read(%x,nw,*tfont*),4-,32)
  1984.     set %tedit.me.clr $gettok($read(%x,nw,*me.clr*),4-,32)
  1985.     set %tedit.op.clr $gettok($read(%x,nw,*op.clr*),4-,32)
  1986.     set %tedit.voice.clr $gettok($read(%x,nw,*voice.clr*),4-,32)
  1987.     set %tedit.normal.clr $gettok($read(%x,nw,*normal.clr*),4-,32)
  1988.   }
  1989. }
  1990. on *:dialog:tedit:sclick:5:{
  1991.   if ($did(tedit,5)) {
  1992.     var %x = $replace($replace($did(tedit,5),bracket style 1,par.style,bracket style 2,bracket.style,prefix,pre,timestamp,ttimestamp,font,tfont,me color,me.clr,op color,op.clr,voice color,voice.clr,regular color,normal.clr),$chr(32),.)
  1993.     var %f = $+($scriptdirtema\,%tedit,.tem)
  1994.     did -ar tedit 4 %tedit. [ $+ [ %x ] ]
  1995.     did -ar tedit 8 $gettok($read($scriptdirtxt\tedit.txt,nw,%x $+ *),2-,44)
  1996.   }
  1997. }
  1998. on *:dialog:tedit:edit:4:{
  1999.   if ($did(tedit,4)) && (- !isin $did(tedit,5)) && (- !isin $did(tedit,5)) {
  2000.     var %x = $replace($replace($did(tedit,5),bracket style 1,par.style,bracket style 2,bracket.style,prefix,pre,timestamp,ttimestamp,font,tfont,me color,me.clr,op color,op.clr,voice color,voice.clr,regular color,normal.clr),$chr(32),.)
  2001.     set %tedit. [ $+ [ %x ] ] $did(tedit,4)
  2002.   }
  2003. }
  2004. on *:dialog:tedit:sclick:6:{
  2005.   did -r tedit 3
  2006.   color_gen
  2007. }
  2008. on *:dialog:tedit:sclick:11:{
  2009.   if (!$did(tedit,1)) return
  2010.   var %x = $n.input(Enter theme filename:,$replace($did(tedit,1),/,-) $+ .tem)
  2011.   if (%x) {
  2012.     var %x = $qt($scriptdirtema\ $+ %x $+ $iif($right(%x,4) != .tem,.tem)), %i = 1
  2013.     if ($exists(%x)) && (!$n.input(Overwrite $nopath(%x) $+ ?,y/n)) return
  2014.     write -c %x $chr(59) $+ $did(tedit,2)
  2015.     write %x alias tclr $chr(123)
  2016.     while (%i <= $did(tedit,3).lines) {
  2017.       write %x $did(tedit,3,%i)
  2018.       inc %i
  2019.     }
  2020.     write %x $chr(125)
  2021.     write %x alias tname return $did(tedit,1)
  2022.     write %x alias nick.style return %tedit.nick.style
  2023.     write %x alias me.style return %tedit.me.style
  2024.     write %x alias par.style return %tedit.par.style
  2025.     write %x alias bracket.style return %tedit.bracket.style
  2026.     if (%tedit.quote.style) write %x alias quote.style return %tedit.quote.style
  2027.     write %x alias pre return %tedit.pre
  2028.     write %x alias ttimestamp return %tedit.ttimestamp
  2029.     if (%tedit.tfont) write %x alias tfont return %tedit.tfont
  2030.     write %x alias me.clr return $replace(%tedit.me.clr,z,$chr(48))
  2031.     write %x alias op.clr return $replace(%tedit.op.clr,z,$chr(48))
  2032.     write %x alias voice.clr return $replace(%tedit.voice.clr,z,$chr(48))
  2033.     write %x alias normal.clr return $replace(%tedit.normal.clr,z,$chr(48))
  2034.     if ($n.input(Theme saved as $nopath(%x) $+ . $crlf $crlf $+ Do you want to $iif($nopath($isalias(tname).fname) == $nopath(%x),reload,load) the theme now?,y/n)) {
  2035.       set %generatepreview 1
  2036.       if ($nopath(%x) == $nopath($isalias(tname).fname)) theme -r
  2037.       else theme $left($nopath(%x),-4)
  2038.       if ($dialog(tema)) dialog -x tema
  2039.     }
  2040.     dialog -x tedit
  2041.   }
  2042. }
  2043. dialog tema {
  2044.   title "Theme (/theme)"
  2045.   size -1 -1 197 151
  2046.   option dbu
  2047.   icon $scriptdirdll\i.dll, 17
  2048.   icon 2, 1 22 193 105,  $scriptdirtema\blank.png, 0
  2049.   combo 4, 1 9 83 117, sort size drop
  2050.   button "Change", 3, 164 8 30 11
  2051.   button "Edit theme", 12, 1 139 45 11
  2052.   button "Settings", 11, 82 139 37 11
  2053.   button "OK", 5, 120 139 37 11, ok
  2054.   button "Close", 6, 158 139 37 11, cancel
  2055.   text "Theme:", 9, 1 1 25 8
  2056.   text "Font:", 10, 165 1 25 7
  2057.   text "", 13, 2 129 139 9
  2058.   text "", 1, 148 129 45 9, right
  2059. }
  2060. on *:dialog:tema:init:0:{
  2061.   did -ar tema 13 $findfile($scriptdirtema,*.tem,0,1,did -a tema 4 $replace($left($nopath($1-),-4),-,: $chr(32))  ) themes available
  2062.   var %x = $left($nopath($isalias(tname).fname),-4)
  2063.   did -c tema 4 $n.cbgn(tema,4,$replace(%x,-,: $+ $chr(32)))
  2064.   if ($exists($+(",$scriptdirtema\,%x,.bmp,"))) did -g tema 2 $+(",$mircdirscripts\tema\,%x,.bmp,")
  2065.   elseif ($exists($+(",$scriptdirtema\,%x,.png,"))) did -g tema 2 $+(",$mircdirscripts\tema\,%x,.png,")
  2066.   did -a tema 1 $round($calc($file($qt($mircdirscripts\tema\ $+ %x $+ .tem)).size /1024),2) KB
  2067. }
  2068. on *:dialog:tema:sclick:11:dlg tsettings
  2069. on *:dialog:tema:sclick:12:tedit $replace($did(tema,4).seltext,: $+ $chr(32),-)
  2070. on *:dialog:tema:sclick:4:{
  2071.   var %x = $replace($did(tema,4).seltext,: $+ $chr(32),-)
  2072.   if ($exists($+(",$mircdirscripts\tema\,%x,.bmp,"))) did -g tema 2 $+(",$scriptdirtema\,%x,.bmp,")
  2073.   elseif ($exists($+(",$scriptdirtema\,%x,.png,"))) did -g tema 2 $+(",$scriptdirtema\,%x,.png,")
  2074.   else did -g tema 2 $qt($scriptdirtema\blank.png)
  2075.   did -a tema 13 $right($read($qt($scriptdirtema\ $+ %x $+ .tem),1),-1)
  2076.   did -a tema 1 $round($calc($file($qt($scriptdirtema\ $+ %x $+ .tem)).size /1024),2) KB
  2077. }
  2078. on *:dialog:tema:sclick:5:{
  2079.   if ($did(tema,4).seltext) .timer -m 1 300 byt-tema $replace($did(tema,4).seltext,: $+ $chr(32),-)
  2080. }
  2081. on *:dialog:tema:sclick:3:fc
  2082. dialog font {
  2083.   title "Font settings (/fc)"
  2084.   size -1 -1 103 91
  2085.   option dbu
  2086.   icon $scriptdirdll\i.dll,16
  2087.   text "Font:", 2, 2 2 14 8
  2088.   text "Size:", 3, 65 2 23 8
  2089.   combo 1, 1 10 61 68, edit
  2090.   combo 4, 65 10 24 54, edit
  2091.   check "Bold", 7, 65 64 24 11, push
  2092.   button "?", 8, 90 10 12 11
  2093.   button "Set", 5, 41 79 30 11, ok
  2094.   button "Cancel", 6, 72 79 30 11, cancel
  2095.   button "Default", 9, 1 79 31 11
  2096. }
  2097. on *:dialog:font:init:0:{
  2098.   if ($window(status window).font) did -a font 1 $ifmatch
  2099.   if ($window(status window).fontbold) did -c font 7
  2100.   if ($window(status window).fontsize) did -a font 4 $ifmatch
  2101.   did -c font 4 1
  2102.   did -c font 1 1
  2103.   did -a font 1 Verdana
  2104.   did -a font 1 Fixedsys
  2105.   did -a font 1 Tahoma
  2106.   did -a font 1 Arial
  2107.   did -a font 1 Courier New
  2108.   did -a font 1 Trebuchet MS
  2109.   did -a font 1 Terminal
  2110.   did -a font 4 9
  2111.   did -a font 4 10
  2112.   did -a font 4 11
  2113.   did -a font 4 12
  2114.   did -a font 4 -8
  2115. }
  2116. on *:dialog:font:sclick:9:{
  2117.   did -c font 1 4
  2118.   did -c font 4 4
  2119. }
  2120. on *:dialog:font:sclick:8:.echo -qg $n.input(Use negative size values (eg: -8) to match default font sizes (pt) instead of px.,info)
  2121. on *:dialog:font:sclick:5:{
  2122.   if ($did(font,7).state == 1) var %p = -zb
  2123.   else var %p = -z
  2124.   font %p $did(4).text $did(1).text
  2125. }
  2126. alias fc {
  2127.   if ($2) {
  2128.     font -z $1-
  2129.   }
  2130.   else dlg font font
  2131. }
  2132.  
  2133. dialog np {
  2134.   title "Sound/highlight settings (/nq)"
  2135.   size -1 -1 149 119
  2136.   option dbu
  2137.   icon $scriptdirdll\i.dll, 22
  2138.   box "On nick", 1, 2 2 145 36
  2139.   check "Enable 'beep' sound", 3, 8 11 61 10
  2140.   check "Highlight nick matches with color:", 2, 8 23 89 10
  2141.   combo 9, 99 22 21 110, limit 2 drop
  2142.   button "Show", 14, 122 22 20 11
  2143.   box "On query/msg", 4, 2 40 145 64
  2144.   check "Enable Sound", 5, 8 48 49 10
  2145.   radio "Default", 6, 12 58 35 10
  2146.   radio "Internal mIRC beep", 7, 12 69 63 10
  2147.   radio "Custom:", 8, 12 80 30 10
  2148.   edit "", 10, 43 79 100 11, read autohs
  2149.   button "...", 11, 117 91 25 10
  2150.   check "Only play sound when query opens", 13, 8 92 101 10
  2151.   button "Exclude...", 15, 72 107 37 11
  2152.   button "OK", 12, 110 107 37 11, ok
  2153. }
  2154. On *:DIALOG:np:init:0:{
  2155.   if ($ncfg(query_sound_onopen) == 1) { did -c np 13 }
  2156.   if ($ncfg(nickpip) == 1) { did -c np 3 }
  2157.   if ($ncfg(nickbar) == 1) { did -c np 2 }
  2158.   if ($ncfg(privpip) == 1) { did -c np 5 }
  2159.   if ($ncfg(highlight_nick_color)) { did -a np 9 $ncfg(highlight_nick_color) }  
  2160.   if ($ncfg(privljud) == beep) { did -c np 7 }
  2161.   elseif ($ncfg(privljud) == psljud) { did -c np 6 }
  2162.   else { did -c np 8 }
  2163.   did -a np 10 $right($ncfg(privljud),-6)
  2164.   did -a np 9 -
  2165.   var %i = 0
  2166.   while (%i < 16) {
  2167.     did -a np 9 %i
  2168.     inc %i
  2169.   }
  2170.   did -c np 9 1
  2171. }
  2172. on *:dialog:np:sclick:14:n.preview np 1,0 0 0,1 1 0,2 2 0,3 3 0,4 4 0,5 5 0,6 6 0,7 7 1,8 8 1,9 9 0,10 10 1,11 11 0,12 12 0,13 13 0,14 14 1,15 15 $+ $chr(160)
  2173. on *:dialog:np:sclick:15:{
  2174.   if ($n.input(Disable highlight for these addresses/nicks $+ $c44 separate with comma ( $+ $c44 $+ ) (type off to disable): $crlf $crlf $+ Example: *bot.com $+ $c44 *!*@address.net $+ $c44 nick!*,$ncfg(no_highlight))) w_ncfg no_highlight $ifmatch
  2175. }
  2176. on *:dialog:np:sclick:12:{
  2177.   if ($did(np,3).state == 1) w_ncfg nickpip 1
  2178.   else { w_ncfg nickpip o }
  2179.   if ($did(np,2).state == 1) w_ncfg nickbar 1
  2180.   else { w_ncfg nickbar o }
  2181.   if ($did(np,13).state == 1) w_ncfg query_sound_onopen 1
  2182.   else { w_ncfg query_sound_onopen o }
  2183.   if ($did(np,5).state == 1) w_ncfg privpip 1
  2184.   else { w_ncfg privpip o }
  2185.   if ($did(np,6).state == 1) w_ncfg privljud psljud
  2186.   if ($did(np,7).state == 1) w_ncfg privljud beep
  2187.   if ($did(np,9).text isnum 0-16) w_ncfg highlight_nick_color $did(np,9).text
  2188.  
  2189. }
  2190. On *:DIALOG:np:sclick:11:{
  2191.   if ($sfile(*.wav,Select sound file)) {
  2192.     w_ncfg privljud splay $ifmatch
  2193.     did -c np 8
  2194.     did -u np 6,7
  2195.     did -ar np 10 $remove($ncfg(privljud),splay)
  2196.   }
  2197. }
  2198. dialog way {
  2199.   title "Away"
  2200.   size -1 -1 115 53
  2201.   option dbu
  2202.   icon $scriptdirdll\i.dll, 17
  2203.   text "Msg:", 1, 1 17 11 8
  2204.   text "Nick:", 5, 1 5 12 8
  2205.   combo 10, 15 3 70 100, edit drop
  2206.   button "?", 3, 87 3 13 10
  2207.   button ">", 4, 102 3 12 10
  2208.   combo 11, 15 15 85 100, edit drop
  2209.   button ">", 6, 102 15 12 10
  2210.   check "Set away on all servers", 12, 3 27 71 11,
  2211.   check "Change nick", 2, 74 27 40 11,
  2212.   button "Set away", 100, 39 41 37 11, ok
  2213.   button "Close", 101, 77 41 37 11, cancel
  2214.  
  2215. }
  2216. On *:DIALOG:way:init:0:{
  2217.   if ($ncfg(awaynbyte) == 1) { did -c way 2 }
  2218.   if ($scon(0) < 2) { did -b way 12 }
  2219.   if ($ncfg(awayallanets) == 1) { did -c way 12 }
  2220.   loadbuf -o way 10 config\awaynick.txt
  2221.   loadbuf -o way 11 config\awaymsg.txt
  2222.   did -c way 10 1
  2223.   did -c way 11 1
  2224. }
  2225. On *:DIALOG:way:sclick:3:.echo -qg $n.input(If you use [nick] it will be replaced with your nickname when going away. $crlf $crlf $+ eg: [nick]|away would result in $me $+ |away,info)
  2226. On *:DIALOG:way:sclick:4:{ txt config\awaynick.txt | set %txtload loadbuf -o way 10 config\awaynick.txt }
  2227. On *:DIALOG:way:sclick:6:{ txt config\awaymsg.txt | set %txtload loadbuf -o way 11 config\awaymsg.txt }
  2228. On *:DIALOG:way:sclick:100:{
  2229.   if ($did(way,2).state == 1) {
  2230.     w_ncfg awaynbyte 1
  2231.     var %x = n
  2232.   }
  2233.   else {
  2234.     var %x = x
  2235.     w_ncfg awaynbyte o
  2236.   }
  2237.   if ($did(way,12).state == 1) {
  2238.     w_ncfg awayallanets 1
  2239.     var %c = scon -at1 _away
  2240.   }
  2241.   else {
  2242.     w_ncfg awayallanets o
  2243.     var %c = _away
  2244.   }
  2245.   if ($did(way,10).text) {
  2246.     n.history config\awaynick.txt $did(way,10).text
  2247.     var %nick = $replace($did(way,10).text,[nick],$me)
  2248.   }
  2249.   if ($did(way,11).text) {
  2250.     n.history config\awaymsg.txt $did(way,11).text
  2251.     var %msg = $did(way,11).text
  2252.   }
  2253.   %c %x %nick %msg
  2254. }
  2255. alias _away {
  2256.   if (!$2) return
  2257.   if ($1 == n) {
  2258.     set %oldnick. [ $+ [ $cid ] ] $me
  2259.     tnick $2
  2260.   }
  2261.   if ($3) away $3-
  2262. }
  2263. alias _back {
  2264.   if (%oldnick. [ $+ [ $cid ] ] ) tnick %oldnick. [ $+ [ $cid ] ]
  2265.   unset %oldnick. [ $+ [ $cid ] ]
  2266.   away
  2267. }
  2268. dialog back {
  2269.   title "Back"
  2270.   size -1 -1 77 45
  2271.   option dbu
  2272.   icon $scriptdirdll\i.dll, 17
  2273.   check "Don't change nick", 1, 2 1 90 10,
  2274.   check "All networks", 5, 2 11 47 10,
  2275.   button "Back", 3, 1 33 37 11, ok
  2276.   button "Cancel", 4, 39 33 37 11, cancel
  2277. }
  2278. on *:DIALOG:back:init:0:{
  2279.   if ($ncfg(awaynbyte) == 1) {
  2280.     if ($awaynet < 2) if (%oldnick. [ $+ [ $cid ] ] ) did -a back 1 Don't change nick to %oldnick. [ $+ [ $cid ] ]
  2281.     else did -a back 1 Don't change nicks
  2282.   }
  2283.   else did -b back 1
  2284.   if ($ncfg(awayallanets) == 1) did -c back 5
  2285. }
  2286. on *:DIALOG:back:sclick:3:{
  2287.   if ($did(back,1).state == 1) unset %oldnick.*
  2288.   $iif($did(back,5).state == 1,scon -at1) _back
  2289. }
  2290. dialog 1st {
  2291.   title "Minimize"
  2292.   size -1 -1 125 67
  2293.   option dbu
  2294.   icon $scriptdirdll\i.dll, 17
  2295.   radio "Taskbar:", 2, 7 15 31 10,
  2296.   radio "Tray:", 3, 7 34 27 10,
  2297.   icon 4, 40 12 78 16,  $scriptdirimg\taskbar.png, 0, noborder
  2298.   icon 5, 40 31 78 16,  $scriptdirimg\tray.png, 0, noborder
  2299.   button "OK", 6, 85 54 37 11, ok
  2300.   box "Minimize mIRC/nbs-irc to:", 7, 3 2 119 49
  2301. }
  2302. On *:dialog:1st:init:0:did -c 1st 2
  2303. On *:dialog:1st:sclick:6:{
  2304.   if ($did(1st,2).state == 1) tray -t0
  2305.   else tray -t1
  2306. }
  2307. dialog unet {
  2308.   title "UnderNet setup (/undernet)"
  2309.   size -1 -1 107 81
  2310.   option dbu
  2311.   icon $scriptdirdll\i.dll, 17
  2312.   box "X Auth (/auth)", 1, 2 2 103 65
  2313.   edit "", 5, 36 10 64 11, autohs
  2314.   edit "", 6, 36 22 64 11, pass autohs
  2315.   check "Auth automatically on connect", 4, 6 36 88 9,
  2316.   check "Hide host (mode +x)", 11, 6 45 67 10,
  2317.   check "Auto join channel if invited by X", 15, 6 54 92 10,
  2318.   text "Auth nick:", 7, 6 12 28 8
  2319.   text "Password:", 9, 6 23 27 8
  2320.   button "Auth now", 10, 29 69 37 11
  2321.   button "OK", 3, 68 69 37 11, ok
  2322. }
  2323. On *:dialog:unet:init:0:{
  2324.   var %q = $ncfg(undernet_authpass), %k = $calc($len(%q) +1), %x = 1, %r
  2325.   while (%k > 1) {
  2326.     var %k = $calc(%k -3), %r = %r $+ $chr($calc($mid(%q,%k,3) + %x))
  2327.     inc %x 1
  2328.   }
  2329.   n.ds cr 15 undernet_bot_autojoin
  2330.   if ($ncfg(undernet_authnick)) did -a unet 5 $ifmatch
  2331.   if ($ncfg(undernet_authpass)) did -a unet 6 %r
  2332.   n.ds cr 4 undernet_autoauth
  2333.   n.ds cr 11 undernet_mode+x
  2334. }
  2335. On *:dialog:unet:sclick:10:if (($did(unet,5).text) && ($did(unet,6).text)) { .msg x@channels.undernet.org login $did(unet,5).text $did(unet,6).text | n.echo normal -atg sending auth $par($did(unet,5).text) }
  2336. On *:dialog:unet:sclick:3:{
  2337.   if ($did(unet,5).text) w_ncfg undernet_authnick $ifmatch
  2338.   if ($did(unet,6).text) w_ncfg undernet_authpass $bfe($ifmatch)
  2339.   n.ds cw 4 undernet_autoauth
  2340.   n.ds cw 11 undernet_mode+x 1
  2341.   n.ds cw 15 undernet_bot_autojoin
  2342. }
  2343.  
  2344. dialog qnet {
  2345.   title "QuakeNet setup (/quakenet)"
  2346.   size -1 -1 107 90
  2347.   option dbu
  2348.   icon $scriptdirdll\i.dll, 17
  2349.   box "Q Auth (/auth)", 1, 2 2 103 74
  2350.   edit "", 5, 36 10 64 11, autohs
  2351.   edit "", 6, 36 22 64 11, pass autohs
  2352.   check "Auth automatically on connect", 4, 6 36 88 9,
  2353.   check "Hide host (mode +x)", 11, 6 45 67 10,
  2354.   check "Use challenge auth (more secure)", 14, 6 54 94 10,
  2355.   check "Auto join channel if invited by Q/L", 15, 6 63 94 10,
  2356.   text "Auth nick:", 7, 6 12 28 8
  2357.   text "Password:", 9, 6 23 27 8
  2358.   button "Auth now", 10, 29 78 37 11
  2359.   button "OK", 3, 68 78 37 11, ok
  2360. }
  2361. On *:dialog:qnet:init:0:{
  2362.   var %q = $ncfg(authpass), %k = $calc($len(%q) +1), %x = 1, %r
  2363.   while (%k > 1) {
  2364.     var %k = $calc(%k -3), %r = %r $+ $chr($calc($mid(%q,%k,3) + %x))
  2365.     inc %x 1
  2366.   }
  2367.   n.ds cr 14 use_challengeauth
  2368.   n.ds cr 15 quakenet_bot_autojoin
  2369.   if ($ncfg(authnick)) did -a qnet 5 $ifmatch
  2370.   if ($ncfg(authpass)) did -a qnet 6 %r
  2371.   n.ds cr 4 autoauth
  2372.   n.ds cr 11 mode+x
  2373. }
  2374. On *:dialog:qnet:sclick:10:if (($did(qnet,5).text) && ($did(qnet,6).text)) { .msg Q@CServe.quakenet.org auth $did(qnet,5).text $did(qnet,6).text | n.echo normal -atg sending auth $par($did(qnet,5).text) }
  2375. On *:dialog:qnet:sclick:3:{
  2376.   if ($did(qnet,5).text) { w_ncfg authnick $ifmatch }
  2377.   if ($did(qnet,6).text) { w_ncfg authpass $bfe($ifmatch) }
  2378.   if ($did(qnet,4).state == 1) { w_ncfg autoauth 1 }
  2379.   else { w_ncfg  autoauth o }
  2380.   if ($did(qnet,11).state == 1) { w_ncfg mode+x 1 }
  2381.   else { w_ncfg mode+x o }
  2382.   n.ds cw 14 use_challengeauth
  2383.   n.ds cw 15 quakenet_bot_autojoin
  2384. }
  2385. dialog misc {
  2386.   title "Miscellaneous settings (/misc)"
  2387.   size -1 -1 232 154
  2388.   option dbu
  2389.   icon $scriptdirdll\i.dll, 22
  2390.   box "Titlebar", 22, 3 119 110 21
  2391.   box "Ban mask", 19, 116 42 114 35
  2392.   box "Minimize", 13, 116 110 114 30
  2393.   box "Functionality", 27, 3 42 110 75
  2394.   box "When kicked", 28, 116 1 114 39
  2395.   box "Edit messages", 6, 116 78 114 30
  2396.   box "General", 16, 3 1 110 39
  2397.   check "Always show mode prefix (@%+ etc)", 15, 7 9 100 10
  2398.   check "Reclaim nick after dis/reconnect", 12, 7 18 102 10
  2399.   check "Check for new versions", 25, 7 27 100 10
  2400.   check "Use own window for whois replys", 18, 7 50 99 10
  2401.   check "Open whois window inside mIRC", 17, 7 59 99 10
  2402.   check "Use own window for highlights", 21, 7 68 97 10
  2403.   check "Enable extended toolbar", 5, 7 77 79 10
  2404.   check "Enable extended channel central", 8, 7 86 99 10
  2405.   check "Enable automatic lag check", 29, 7 95 97 10
  2406.   check "Show 'day changed' at 0:00", 30, 7 104 82 10
  2407.   check "Show version", 23, 7 127 54 10
  2408.   check "Show lag", 24, 67 127 36 10
  2409.   check "Auto whois the 'kicker'", 26, 121 9 92 10
  2410.   check "Auto rejoin channel, wait", 1, 121 18 90 10
  2411.   edit "", 9, 129 28 15 10, autohs
  2412.   text "seconds", 10, 145 29 23 8
  2413.   button "?", 11, 214 26 13 11
  2414.   combo 20, 122 61 102 83, drop
  2415.   button "Quit msgs", 2, 120 89 34 11
  2416.   button "Kick msgs", 4, 156 89 34 11
  2417.   button "Slaps", 3, 192 89 34 11
  2418.   button "Change minimize settings", 14, 120 122 106 11
  2419.   button "OK", 7, 193 142 37 11, ok
  2420.   text "Use this mask when banning:", 31, 121 52 76 8
  2421. }
  2422. on *:dialog:misc:init:0:{
  2423.   if ($ncfg(ar_time) isnum) did -a misc 9 $ncfg(ar_time)
  2424.   if ($ncfg(whois) == @whois) did -c misc 18
  2425.   did -a misc 20 *!ident@host.com $str( ,99) z
  2426.   did -a misc 20 *!*ident@host.com (default) $str( ,99) 1
  2427.   did -a misc 20 *!*@host.com $str( ,99) 2
  2428.   did -a misc 20 *!*ident@*.com $str( ,99) 3
  2429.   did -a misc 20 *!*@*.com $str( ,99) 4
  2430.   did -a misc 20 nick!ident@host.com $str( ,99) 5
  2431.   did -a misc 20 nick!*ident@host.com $str( ,99) 6
  2432.   did -a misc 20 nick!*@host.com $str( ,99) 7
  2433.   did -a misc 20 nick!*ident@*.com $str( ,99) 8
  2434.   did -a misc 20 nick!*@*.com $str( ,99) 9
  2435.   if ($ncfg(ban_mask) isnum) did -c misc 20 $calc($ifmatch +1)
  2436.   elseif ($ncfg(ban_mask) == z) did -c misc 20 1
  2437.   n.ds cr 26 whois_on_kick
  2438.   n.ds cr 1 autorejoin
  2439.   n.ds cr 21 nickwin
  2440.   n.ds cr 8 newcc
  2441.   n.ds cr 5 exttb
  2442.   n.ds cr 15 modeprefix
  2443.   n.ds cr 17 whois_inside
  2444.   n.ds cr 23 titlebar_version
  2445.   n.ds cr 24 titlebar_lag
  2446.   n.ds cr 12 reclaim_nick
  2447.   n.ds cr 25 version_check
  2448.   n.ds cr 29 check_lag
  2449.   n.ds cr 30 show_daychanged
  2450.   if ($group(#url) == on) did -c misc 32
  2451. }
  2452. On *:dialog:misc:sclick:14:dlg 1st
  2453. On *:dialog:misc:sclick:11:var %x = $n.input(mIRC's built in auto-rejoin must be disabled for this to work properly: $crlf $crlf $+ Options (Alt+o) -> IRC -> uncheck "Rejoin channel when kicked",info)
  2454. On *:dialog:misc:sclick:33:var %x = $n.input(Enable this if URLs don't load in your default browser. $crlf $crlf $+ Note: this may not work with URLs containing international characters $+ $c44 eg: å ä ö.,info)
  2455. On *:dialog:misc:sclick:2:unset %txtload | txt config\quits.txt
  2456. On *:dialog:misc:sclick:3:unset %txtload | txt config\slaps.txt
  2457. On *:dialog:misc:sclick:4:unset %txtload | txt config\kicks.txt
  2458. On *:dialog:misc:sclick:7:{
  2459.   n.ds cw 1 autorejoin
  2460.   n.ds cw 8 newcc
  2461.   n.ds cw 15 modeprefix
  2462.   n.ds cw 17 whois_inside
  2463.   n.ds cw 21 nickwin
  2464.   n.ds cw 23 titlebar_version
  2465.   n.ds cw 24 titlebar_lag
  2466.   n.ds cw 12 reclaim_nick
  2467.   n.ds cw 25 version_check
  2468.   n.ds cw 26 whois_on_kick
  2469.   n.ds cw 29 check_lag
  2470.   n.ds cw 30 show_daychanged
  2471.   if ($did(misc,29).state == 0) unset %lag.*
  2472.   if ($gettok($did(misc,20),-1,160)) w_ncfg ban_mask $ifmatch
  2473.   if ($did(misc,9).text isnum) w_ncfg ar_time $did(misc,9).text
  2474.   if ($did(misc,18).state == 1) w_ncfg whois @whois
  2475.   else w_ncfg whois -a
  2476.   titleupdate
  2477. }
  2478. on *:dialog:misc:sclick:5:{
  2479.   if ($did(misc,5).state == 1) {
  2480.     w_ncfg exttb 1
  2481.     n.toolbar
  2482.   }
  2483.   else {
  2484.     w_ncfg exttb o
  2485.     toolbar -r
  2486.     if ($dialog(tb)) dialog -x tb
  2487.   }
  2488. }
  2489. dialog mp3s {
  2490.   title "Song announce (/sa, /np)"
  2491.   size -1 -1 203 165
  2492.   option dbu
  2493.   icon $scriptdirdll\i.dll, 17
  2494.   tab "Winamp/MM", 20, 3 0 197 150
  2495.   box "Serving (max 3 sends)", 12, 8 97 188 32, tab 20
  2496.   box "Usage", 7, 8 51 188 45, tab 20
  2497.   text "", 6, 13 59 79 34, tab 20
  2498.   text "", 10, 94 59 100 34, tab 20
  2499.   check "Send file on request (5 min timeout)", 13, 13 105 98 10, tab 20
  2500.   edit "", 14, 151 105 42 11, tab 20 autohs
  2501.   edit "", 17, 151 116 42 11, tab 20 autohs
  2502.   text "Trigger:", 15, 130 106 21 9, tab 20 right
  2503.   text "Limit upload speed (KB/s, 0 = unlimited): ~", 16, 37 117 114 8, tab 20 right
  2504.   text "* Uses wa_link.dll wich may crash mIRC on some systems", 18, 10 132 145 8, tab 20
  2505.   text "** Does not work with MediaMonkey", 25, 10 140 141 8, tab 20
  2506.   tab "iTunes", 21
  2507.   box "Usage", 19, 8 51 188 39, tab 21
  2508.   text "", 23, 13 59 79 28, tab 21
  2509.   text "", 24, 94 59 100 28, tab 21
  2510.   check "Enable iTunes support instead of Winamp", 22, 9 93 150 10, tab 21
  2511.   button "OK", 3, 163 153 37 11, ok
  2512.   radio "/say", 5, 14 37 24 10
  2513.   radio "/me", 4, 38 37 23 10
  2514.   edit "", 1, 12 24 181 11, autohs
  2515.   button "Edit random", 11, 87 37 37 11
  2516.   button "Default", 9, 125 37 33 11
  2517.   button "Preview", 8, 159 37 33 11
  2518.   box "Display", 2, 8 16 188 35
  2519. }
  2520. On *:dialog:mp3s:init:0:{
  2521.   if ($ncfg(mp3s)) {
  2522.     if ($gettOK($ncfg(mp3s),1,32) == say) {
  2523.       did -c mp3s 5
  2524.       did -a mp3s 1 $replace($right($ncfg(mp3s),-3),âbåld,,âcålår,,âånderlajn,,âcläör,)
  2525.     }
  2526.     else {
  2527.       did -c mp3s 4
  2528.       did -a mp3s 1 $replace($right($ncfg(mp3s),-2),âbåld,,âcålår,,âånderlajn,,âcläör,)
  2529.     }    
  2530.   }
  2531.   if ($ncfg(mp3getcmd)) did -ar mp3s 14 $ifmatch
  2532.   if ($ncfg(mp3maxcps)) did -ar mp3s 17 $replace($ifmatch,o,0)
  2533.   n.ds cr 13 mp3serv
  2534.   n.ds cr 22 itunes
  2535.   did -a mp3s 6 [artist]*, [title]* and [album]* $crlf $+ [etime] (elapsed time) $crlf $+ [time] (total time) $crlf $+ [kbps] (bitrate, eg: 192 kbps) $crlf $+ [size] (eg: 4.7 MB)
  2536.   did -a mp3s 10 [random] (random line, edit above) $crlf $+ [type] (filetype, eg: mp3) $crlf $+ [filename] (eg: asd.mp3) $crlf $+ [path]/[folder] (eg: c:\music\) $crlf $+ [mp3]** (as shown on winamp's titlebar)
  2537.   did -a mp3s 23 [artist], [title] and [album] $crlf $+ [etime] (elapsed time) $crlf $+ [time] (total time) $crlf $+ [kbps] (bitrate, eg: 192 kbps)
  2538.   did -a mp3s 24 [random] (random line, edit above) $crlf $+ [type] (filetype, eg: mp3) $crlf $+ [mp3] (artist - title)
  2539.   if ($ncfg(itunes) == 1) .timer -m 1 10 did -f mp3s 21
  2540. }
  2541. On *:dialog:mp3s:sclick:11:txt config\mp3.txt
  2542. On *:dialog:mp3s:sclick:9:{
  2543.   did -ar mp3s 1 $iif($ncfg(itunes) == 1,iTunes,winamp) » [mp3] :: [time]
  2544.   did -c mp3s 5
  2545.   did -u mp3s 4
  2546. }
  2547. On *:dialog:mp3s:sclick,edit:8,1:{
  2548.   if ($did(mp3s,1).text) {
  2549.     var %temp = $did(mp3s,1).text
  2550.     n.preview mp3s $replace(%temp,[mp3],Artist - Song title,[type],mp3,[artist],Artist,[title],Song title,[album],Album,[time],3:12,[etime],1:54,[kbps],192 kbps,[size],4.7MB,[filename],04-artist-the_song.mp3,[path],$mircdir,[folder],folder name,[random],random line)
  2551.   }
  2552. }
  2553. On *:dialog:mp3s:sclick:22:{
  2554.   n.ds cw 22 itunes
  2555.   if ($did(mp3s,22).state == 1) did -ar mp3s 1 $replace($did(mp3s,1),winamp,iTunes)
  2556.   else did -ar mp3s 1 $replace($did(mp3s,1),iTunes,winamp)
  2557. }
  2558. On *:dialog:mp3s:sclick:3:{
  2559.   if ($did(mp3s,13).state == 1) w_ncfg mp3serv 1
  2560.   else w_ncfg mp3serv o
  2561.   if ($did(mp3s,17).text) { w_ncfg mp3maxcps $ifmatch | .dcc maxcps $calc($iif($ncfg(mp3maxcps) == o,0,$ncfg(mp3maxcps)) * 1024) }
  2562.   else w_ncfg mp3maxcps o
  2563.   if ($did(mp3s,14).text) w_ncfg mp3getcmd $ifmatch
  2564.   else w_ncfg mp3getcmd none
  2565.   if ($did(mp3s,5).state == 1) var %temp = say
  2566.   else var %temp = me
  2567.   if ($did(mp3s,1).text) var %temp2 = $ifmatch
  2568.   w_ncfg mp3s %temp $replace(%temp2,,âbåld,,âcålår,,âånderlajn,,âcläör)
  2569.  
  2570. }
  2571. dialog hevent {
  2572.   title "Hide events"
  2573.   size -1 -1 77 47
  2574.   option dbu
  2575.   icon $scriptdirdll\i.dll, 17
  2576.   check "Joins", 1, 3 11 26 10,
  2577.   check "Parts", 2, 3 20 26 10,
  2578.   check "Quits", 3, 31 11 26 10,
  2579.   check "Nick changes", 4, 31 20 45 10,
  2580.   text "Hide these events:", 5, 2 2 54 8
  2581.   button "OK", 6, 38 35 37 11, ok
  2582. }
  2583. on *:dialog:hevent:init:0:{
  2584.   if ($ehide(joins,%he.chan)) did -c hevent 1
  2585.   if ($ehide(parts,%he.chan)) did -c hevent 2
  2586.   if ($ehide(quits,%he.chan)) did -c hevent 3
  2587.   if ($ehide(nicks,%he.chan)) did -c hevent 4
  2588.   dialog -t hevent %he.chan
  2589. }
  2590. on *:dialog:hevent:sclick:*:{
  2591.   if ($did isnum 1-4) {
  2592.     var %x = $replace($did,1,joins,2,parts,3,quits,4,nicks)
  2593.     hideshow.event %he.chan %x
  2594.     if ($ehide(%x,%he.chan)) did -c hevent $did
  2595.     else did -u hevent $did
  2596.   }
  2597.   elseif ($did == 6) unset %he.chan
  2598. }
  2599. dialog input {
  2600.   title "nbs-irc"
  2601.   size -1 -1 129 65
  2602.   option dbu
  2603.   icon $scriptdirdll\i.dll, 17
  2604.   edit "", 1, 2 39 125 11, result autohs
  2605.   box "", 2, 2 0 125 36
  2606.   box "", 6, 2 0 125 50
  2607.   button "OK", 3, 53 53 37 11, ok
  2608.   button "Cancel", 5, 91 53 37 11, cancel
  2609.   text "", 4, 5 6 119 27
  2610.   text "", 10, 5 6 119 41
  2611. }
  2612. on *:dialog:input:init:0:{
  2613.   did -a input 1 %n.input2
  2614.   if (%n.input2 == y/n) {
  2615.     did -ar input 3 Yes
  2616.     did -ar input 5 No
  2617.     did -h input 1,2
  2618.     did -a input 10 %n.input1
  2619.   }
  2620.   elseif (%n.input2 == info) {
  2621.     did -ar input 5 OK
  2622.     did -h input 1,2,3
  2623.     did -a input 10 %n.input1
  2624.   }
  2625.   else {
  2626.     did -h input 6,10
  2627.     did -a input 4 %n.input1
  2628.     did -c input 1 1 1 999
  2629.   }
  2630.   unset %n.input?
  2631. }
  2632. dialog tb {
  2633.   title "tåålbar"
  2634.   size 1 1 700 0
  2635.   option pixels
  2636.   button "", 1, 235 0 500 14
  2637.   button "", 2, 235 13 500 14
  2638.   combo 3, 0 2 183 290, size edit drop
  2639.   icon 4, 187 4 16 16, $scriptdirdll\i.dll, 13, noborder
  2640.   icon 5, 207 4 16 16, $scriptdirdll\i.dll, 14, noborder
  2641.   button "", 6, 226 18 5 5, hide ok
  2642. }
  2643. on *:dialog:tb:init:0:{
  2644.   n.mdx SetMircVersion $version
  2645.   n.mdx MarkDialog $dname
  2646.   n.mdx SetDialog $dname style
  2647.   dll $cit(scripts\dll\mdock61.dll) DockToolbar $dialog(tb).hwnd
  2648.   dialog -s tb $iif($ncfg(toolbar_disable_winamp) == 1,361,439) 0 700 0
  2649.   n.mdx SetControlMDX tb 1 Text noPrefix > scripts\dll\mdx\ctl_gen.mdx
  2650.   n.mdx SetControlMDX tb 2 Text noPrefix > scripts\dll\mdx\ctl_gen.mdx
  2651.   n.mdx SetFont tb 1 11 400 tahoma
  2652.   n.mdx SetFont tb 2 11 400 tahoma
  2653.   titleupdate
  2654.   loadbuf -o tb 3 config\kor.txt
  2655. }
  2656. on *:dialog:tb:sclick:3,4,6:{
  2657.   n.tb.enter
  2658.   haltdef
  2659. }
  2660. alias n.tb.enter {
  2661.   if ($did(tb,3)) {
  2662.     if ($exists($did(tb,3)) || $isfile($did(tb,3) $+ .exe) || (*.exe iswm $did(tb,3)) || ($read($scriptdirtxt\runex.txt,w, * $+ $did(tb,3) $+ *))) run -p $did(tb,3)
  2663.     else n.url $did(tb,3)
  2664.     n.history config\kor.txt $did(tb,3)
  2665.     loadbuf -ro tb 3 config\kor.txt
  2666.   }
  2667.   did -c tb 3 0
  2668. }
  2669. on *:dialog:tb:close:0:.timer -m 1 0 dlg tb
  2670. on *:dialog:tb:sclick:5:{
  2671.   set %txtload loadbuf -o tb 3 config\kor.txt
  2672.   set -u10 %tmp.txtfile 1
  2673.   txt config\kor.txt
  2674. }
  2675. dialog skydd {
  2676.   title "Protections (/prot)"
  2677.   size -1 -1 203 117
  2678.   option dbu
  2679.   icon $scriptdirdll\i.dll, 22
  2680.   tab "Channel", 5, 2 -1 198 103
  2681.   combo 1, 50 16 83 66, tab 5 size drop
  2682.   text "Channel:", 2, 8 18 25 8, tab 5
  2683.   button "Add", 29, 135 16 30 10, tab 5
  2684.   button "Remove", 30, 166 16 30 10, tab 5
  2685.   check "Flood:", 8, 8 32 27 10, tab 5
  2686.   edit "", 9, 62 31 14 11, tab 5
  2687.   edit "", 11, 100 31 13 11, tab 5
  2688.   check "Ban", 22, 141 32 21 10, tab 5
  2689.   button "Kick msg", 40, 166 31 30 11, tab 5
  2690.   check "Repeat:", 14, 8 45 32 10, tab 5
  2691.   edit "", 16, 62 44 14 11, tab 5
  2692.   check "Ban", 23, 141 45 24 10, tab 5
  2693.   button "Kick msg", 41, 166 44 30 11, tab 5
  2694.   check "Caps:", 24, 8 59 34 9, tab 5
  2695.   edit "", 25, 62 58 14 11, tab 5
  2696.   button "Kick msg", 42, 166 57 30 11, tab 5
  2697.   check "Advertising:", 28, 8 72 40 10, tab 5
  2698.   radio "#text", 34, 50 72 26 11, tab 5
  2699.   radio "/j #text, join #text", 35, 77 72 58 11, tab 5
  2700.   check "Ban", 32, 141 72 24 10, tab 5
  2701.   button "Kick msg", 43, 166 70 30 11, tab 5
  2702.   check "Punish ops/half-ops", 20, 8 87 66 11, tab 5
  2703.   edit "", 37, 113 87 17 11, tab 5
  2704.   text "lines in", 10, 78 33 21 8, tab 5
  2705.   text "seconds", 12, 115 33 20 8, tab 5
  2706.   text "max", 13, 50 33 12 8, tab 5
  2707.   text "max", 15, 50 46 12 8, tab 5
  2708.   text "repeats in 10 seconds", 17, 78 46 62 8, tab 5
  2709.   text "% caps (minimum 10 chars)", 26, 77 60 79 8, tab 5
  2710.   text "max", 27, 50 60 12 8, tab 5
  2711.   text "Ban for", 36, 94 89 19 8, tab 5
  2712.   text "minutes (0 = permanent)", 33, 132 89 63 8, tab 5
  2713.   tab "Personal", 7
  2714.   check "Enable ban protection", 3, 7 17 66 10, tab 7
  2715.   edit "", 4, 56 27 100 11, tab 7 autohs
  2716.   text "Kick message:", 21, 17 28 37 8, tab 7
  2717.   text "Note: CTCP and highlight/query sound flood protection is always enabled.", 31, 7 48 94 14, tab 7
  2718.   text "", 99, 200 200 1 1
  2719.   button "OK", 6, 163 105 37 11, ok
  2720. }
  2721. On *:dialog:skydd:init:0:{
  2722.   prot.chanlist
  2723.   n.ds cr 3 banskydd
  2724.   if ($ncfg(bsmed)) did -a skydd 4 $ifmatch
  2725. }
  2726. On *:dialog:skydd:sclick:40-43:{
  2727.   var %x = $replace($did,40,flood,41,repeat,42,caps,43,advertising)
  2728.   hadd prot $did(skydd,99) $+ %x $+ .kickmsg $$n.input(Enter kick message for %x violation:,$hget(prot,$+($did(skydd,99),%x,.kickmsg)))
  2729. }
  2730. On *:dialog:skydd:sclick:29:{
  2731.   var %x = $n.input(Enter channel to add:,$iif($active ischan,$active,$chr(35)))
  2732.   if ($chr(35) isin %x) || ($chr(38) isin %x) {
  2733.     prot.save
  2734.     did -ar skydd 99 %x
  2735.     did -i skydd 1 1 %x
  2736.     hadd -m prot chans $hget(prot,chans) $chr(1) $+ %x
  2737.     did -c skydd 1 1
  2738.     did -e skydd 8,14,24,28,9,11,22,16,23,25,32,34,35,37,20,40-43
  2739.     did -ar skydd 9 10
  2740.     did -ar skydd 11 5
  2741.     did -ar skydd 16 3
  2742.     did -ar skydd 25 70
  2743.     did -ar skydd 37 15
  2744.     did -c skydd 34
  2745.     did -u skydd 8,14,24,28,22,23,32,34,35,20
  2746.   }
  2747.   elseif (!%x) return
  2748.   else .echo -qg $n.input(Error: enter a valid channel.,info)
  2749. }
  2750. On *:dialog:skydd:sclick:30:{
  2751.   if ($did(skydd,1)) && ($n.input(Do you want to remove all settings for $did(skydd,1).seltext $+ ?,y/n)) {
  2752.     did -r skydd 99
  2753.     if ($numtok($hget(prot,chans),32) == 1) hdel prot chans
  2754.     hadd -m prot chans $remove($hget(prot,chans),$chr(1) $+ $did(skydd,1))
  2755.     hdel -w prot $did(skydd,1) $+ *
  2756.     prot.chanlist
  2757.   }
  2758. }
  2759.  
  2760. On *:dialog:skydd:sclick:1:{
  2761.   if ($did(skydd,1)) {
  2762.     prot.save
  2763.     var %x = $did(skydd,1)
  2764.     did -ar skydd 99 $did(skydd,1)
  2765.     did -e skydd 8,14,24,28,9,11,22,16,23,25,32,34,35,37,20,40-43
  2766.     did -r skydd 9,11,16,25,37
  2767.     did -u skydd 8,14,24,28,22,23,32,34,35,20
  2768.     if ($hget(prot,$+(%x,flood)) == 1) did -c skydd 8
  2769.     if ($hget(prot,$+(%x,flood.lines)) isnum) did -ar skydd 9 $ifmatch
  2770.     if ($hget(prot,$+(%x,flood.seconds)) isnum) did -ar skydd 11 $ifmatch
  2771.     if ($hget(prot,$+(%x,flood.ban)) == 1) did -c skydd 22
  2772.     if ($hget(prot,$+(%x,repeat)) == 1) did -c skydd 14
  2773.     if ($hget(prot,$+(%x,repeat.max)) isnum) did -ar skydd 16 $ifmatch
  2774.     if ($hget(prot,$+(%x,repeat.ban)) == 1) did -c skydd 23
  2775.     if ($hget(prot,$+(%x,caps)) == 1) did -c skydd 24
  2776.     if ($hget(prot,$+(%x,caps.maxpercent)) isnum) did -ar skydd 25 $ifmatch
  2777.     if ($hget(prot,$+(%x,advertising)) == 1) did -c skydd 28
  2778.     if ($hget(prot,$+(%x,advertising.type)) == 1) did -c skydd 34
  2779.     else did -c skydd 35
  2780.     if ($hget(prot,$+(%x,advertising.ban)) == 1) did -c skydd 32
  2781.     if ($hget(prot,$+(%x,punishops)) == 1) did -c skydd 20
  2782.     if ($hget(prot,$+(%x,bantime)) isnum) did -ar skydd 37 $ifmatch
  2783.   }
  2784. }
  2785. alias -l prot.save {
  2786.   if ($did(skydd,99)) {
  2787.     var %x = $ifmatch
  2788.     if ($did(skydd,8).state == 1) hadd prot $+(%x,flood) 1
  2789.     else hdel prot $+(%x,flood)
  2790.     if ($did(skydd,9).text isnum) hadd prot $+(%x,flood.lines) $ifmatch
  2791.     else hdel prot $+(%x,flood.lines)
  2792.     if ($did(skydd,11).text isnum) hadd prot $+(%x,flood.seconds) $ifmatch
  2793.     else hdel prot $+(%x,flood.seconds)
  2794.     if ($did(skydd,22).state == 1) hadd prot $+(%x,flood.ban) 1
  2795.     else hdel prot $+(%x,flood.ban)
  2796.     if ($did(skydd,14).state == 1) hadd prot $+(%x,repeat) 1
  2797.     else hdel prot $+(%x,repeat)
  2798.     if ($did(skydd,16).text isnum) hadd prot $+(%x,repeat.max) $ifmatch
  2799.     else hdel prot $+(%x,repeat.max)
  2800.     if ($did(skydd,23).state == 1) hadd prot $+(%x,repeat.ban) 1
  2801.     else hdel prot $+(%x,repeat.ban)
  2802.     if ($did(skydd,24).state == 1) hadd prot $+(%x,caps) 1
  2803.     else hdel prot $+(%x,caps)
  2804.     if ($did(skydd,25).text isnum) hadd prot $+(%x,caps.maxpercent) $ifmatch
  2805.     else hdel prot $+(%x,caps.maxpercent)
  2806.     if ($did(skydd,28).state == 1) hadd prot $+(%x,advertising) 1
  2807.     else hdel prot $+(%x,advertising)
  2808.     if ($did(skydd,34).state == 1) hadd prot $+(%x,advertising.type) 1
  2809.     else hadd prot $+(%x,advertising.type) 2
  2810.     if ($did(skydd,32).state == 1) hadd prot $+(%x,advertising.ban) 1
  2811.     else hdel prot $+(%x,advertising.ban)
  2812.     if ($did(skydd,20).state == 1) hadd prot $+(%x,punishops) 1
  2813.     else hdel prot $+(%x,punishops)
  2814.     if ($did(skydd,37).text isnum) hadd prot $+(%x,bantime) $ifmatch
  2815.     else hdel prot $+(%x,bantime)
  2816.   }
  2817. }
  2818. alias -l prot.chanlist {
  2819.   did -b skydd 8,14,24,28,9,11,22,16,23,25,32,34,35,37,20,40-43
  2820.   did -r skydd 1
  2821.   if ($hget(prot,chans)) {
  2822.     tokenize 1 $ifmatch
  2823.     var %i = 1
  2824.     while (%i <= $0) {
  2825.       did -a skydd 1 [ $chr(36) $+ [ %i ] ]
  2826.       inc %i
  2827.     }
  2828.   }
  2829. }
  2830.  
  2831. on *:dialog:skydd:sclick:6:{
  2832.   prot.save
  2833.   hsave -i prot config\config.ini protections
  2834.   if ($did(skydd,4)) w_ncfg bsmed $did(skydd,4).text
  2835.   n.ds cw 3 banskydd 1
  2836.  
  2837. }
  2838.  
  2839.  
  2840.  
  2841.  
  2842.  
  2843. dialog pcw {
  2844.   title "Seek cw/pcw"
  2845.   size -1 -1 207 36
  2846.   option dbu
  2847.   combo 2, 30 11 30 50, size edit drop
  2848.   combo 3, 2 11 25 50, size edit drop
  2849.   combo 5, 64 11 43 50, size edit drop
  2850.   button "Close", 7, 176 25 30 10, ok
  2851.   combo 8, 110 11 70 50, size edit drop
  2852.   button "Seek", 9, 145 25 30 10
  2853.   text "players:", 10, 35 2 22 8
  2854.   text "pcw/cb:", 11, 2 2 19 8
  2855.   text "server:", 13, 65 2 20 8
  2856.   text "other:", 14, 111 2 25 8
  2857.   text "seperator:", 15, 176 2 27 8
  2858.   combo 16, 186 11 20 50, size edit drop
  2859.   radio "say", 20, 68 26 20 10,
  2860.   radio "amsg", 21, 89 26 24 10,
  2861.   ;radio "amsg2", 1, 115 26 28 10,
  2862. }
  2863.  
  2864. On *:dialog:pcw:init:0:{
  2865.   did -a pcw 2 5on5
  2866.   did -a pcw 2 4on4
  2867.   did -a pcw 2 3on3  
  2868.   did -a pcw 2 2on2
  2869.   did -c pcw 2 1
  2870.   did -a pcw 3 pcw
  2871.   did -a pcw 3 cb
  2872.   did -c pcw 3 1
  2873.   did -a pcw 5 our server
  2874.   did -a pcw 5 your server  
  2875.   did -a pcw 5 vår server
  2876.   did -a pcw 5 er server
  2877.   did -c pcw 5 1
  2878.   did -a pcw 8 1 map
  2879.   did -a pcw 8 /msg $me
  2880.   did -a pcw 8 time:
  2881.   did -a pcw 8 points:
  2882.   did -a pcw 16 .
  2883.   did -a pcw 16 -
  2884.   did -a pcw 16 _
  2885.   did -a pcw 16 $chr(124)
  2886.   did -c pcw 16 1
  2887.   if ($ncfg(smsg) == amsg) { w_ncfg smsg amsg | did -c pcw 21 }
  2888.   else { w_ncfg smsg say | did -c pcw 20 }
  2889. }
  2890. On *:dialog:pcw:sclick:9:{
  2891.   $ncfg(smsg) $did(pcw,3).text $did(pcw,16).text $did(pcw,2).text $did(pcw,16).text $did(pcw,5).text $iif($did(pcw,8).text,$did(pcw,16).text) $did(pcw,8).text
  2892. }
  2893. on *:dialog:pcw:sclick:21:{
  2894.   if ($did(pcw,21).state == 1) { w_ncfg smsg amsg }
  2895.   else { w_ncfg smsg say }
  2896. }
  2897. on *:dialog:pcw:sclick:20:{
  2898.   if ($did(pcw,20).state == 1) { w_ncfg smsg say }
  2899.   else { w_ncfg smsg amsg }
  2900. }
  2901.  
  2902. dialog om {
  2903.   title "About"
  2904.   size -1 -1 149 116
  2905.   option dbu
  2906.   icon nbs.ico, 0
  2907.   text "", 20, 10 15 89 16
  2908.   text "", 30, 10 47 98 16
  2909.   icon 4, 125 9 16 16,  nbs.ico, 0, noborder
  2910.   link "nbs-irc.net", 2, 6 81 35 8
  2911.   link "nbs-irc.net/forum", 3, 6 88 51 8
  2912.   link "#nbs-irc on QuakeNet", 5, 6 70 59 8
  2913.   button "Close", 1, 110 103 37 11, ok
  2914.   text "", 10, 7 7 80 8
  2915.   text "Thanks to:", 7, 7 39 75 8
  2916.   text "", 100, 6 105 99 8
  2917. }
  2918. on *:dialog:om:init:0:{
  2919.   set -u1 %tmp.aboutblock 1
  2920.   did -a om 10 nbs-irc $n.version for mIRC 7+
  2921.   did -a om 20 Created and maintained by Dibbe with some help from haxninja
  2922.   did -a om 30 Annorax, Maverick, Specter2, Leech, slanne and uK
  2923.   n.showversion 100
  2924.   did -f om 10
  2925. }
  2926.  
  2927. alias n.showversion {
  2928.   did -a $dname $1  Version: $n.version $iif($n.version.date, –  $ifmatch)
  2929. }
  2930.  
  2931. on *:dialog:om:sclick:2:if (!%tmp.aboutblock) n.url http://nbs-irc.net
  2932. on *:dialog:om:sclick:3:if (!%tmp.aboutblock) n.url http://nbs-irc.net/forum
  2933. on *:dialog:om:sclick:4:{
  2934.   set %about.icon 16
  2935.   .timer -m 20 70 about.iconchanger
  2936. }
  2937. alias about.iconchanger {
  2938.   if ($dialog(om)) did -g om 4 %about.icon scripts\dll\i.dll
  2939.   inc %about.icon
  2940.   if (%about.icon == 18) set %about.icon 16
  2941. }
  2942. on *:dialog:om:sclick:5:{
  2943.   if (!%tmp.aboutblock) {
  2944.     if ($n.qnet) {
  2945.       if ($n.input(join #nbs-irc now?,y/n)) join #nbs-irc
  2946.     }
  2947.     elseif ($n.input(Connect to irc.quakenet.org and join #nbs-irc now? $crlf $crlf $+ Note: this will open a new server window.,y/n)) server -m irc.quakenet.org -j #nbs-irc
  2948.   }
  2949. }
  2950.  
  2951. dialog autocon {
  2952.   title "Auto connect"
  2953.   size -1 -1 146 138
  2954.   option dbu
  2955.   icon $scriptdirdll\i.dll, 17
  2956.   combo 2, 6 10 99 100, drop
  2957.   check "Enabled", 17, 109 10 33 10, disable
  2958.   edit "", 7, 44 38 96 11, disable autohs
  2959.   edit "", 8, 44 50 96 11, disable pass autohs
  2960.   text "Nickname:", 1, 6 64 25 8
  2961.   edit "", 9, 44 62 96 11, disable autohs
  2962.   text "Alt. nickname:", 32, 6 75 34 8
  2963.   edit "", 10, 44 74 96 11, disable autohs
  2964.   text "Ident/mail:", 25, 6 87 31 8
  2965.   edit "", 11, 44 86 96 11, disable autohs
  2966.   text "Name:", 23, 6 99 25 8
  2967.   edit "", 12, 44 98 96 11, disable autohs
  2968.   text "Password:", 15, 6 52 33 8
  2969.   box "Server", 4, 2 1 142 25
  2970.   box "Connect using:", 14, 2 29 142 95
  2971.   text "", 99, 200 200 1 1
  2972.   text "Server(:port):", 6, 6 39 35 8
  2973.   button "Clear", 5, 110 110 30 11, disable
  2974.   text "(leave blank for default values)", 3, 6 112 80 8
  2975.   button "Connect", 16, 2 126 37 11, disable
  2976.   button "?", 18, 39 126 10 11
  2977.   button "Connect to all", 13, 60 126 46 11
  2978.   button "OK", 100, 107 126 37 11, ok
  2979. }
  2980. On *:dialog:autocon:init:0:{
  2981.   var %i = 1
  2982.   while (%i < 11) {
  2983.     var %a = $ncfg(auto_connect_ [ $+ [ %i  ] $+ ] _server)
  2984.     if (%a) && (%a != ânoneâ) did -a autocon 2 %i $+ : %a
  2985.     else did -a autocon 2 %i $+ : (none)
  2986.     inc %i 1
  2987.   }
  2988. }
  2989. on *:dialog:autocon:sclick:18:.echo -qg $n.input(Connects to the currently selected server. $crlf $crlf $+ Note: This will automatically create a new server window if the current one is in use.,info)
  2990. on *:dialog:autocon:sclick:5:{
  2991.   if ($n.input(Do you want to remove all settings for $did(autocon,2).seltext $+ ?,y/n)) {
  2992.     did -r autocon 7-12
  2993.     did -u autocon 17
  2994.   }
  2995. }
  2996. on *:dialog:autocon:sclick:2:{
  2997.   auto_connect_save
  2998.   if ($did(autocon,2).seltext) did -e autocon 7-12,17,5,16
  2999.   did -r autocon 7-12
  3000.   did -u autocon 17
  3001.   var %a = auto_connect_ $+ $gettok($did(autocon,2),1,58)
  3002.   did -ar autocon 99 $gettok($did(autocon,2),1,58)
  3003.   if ($ncfg( %a $+ _pass)) && ($ifmatch != ânoneâ) {
  3004.     var %q = $ifmatch, %k = $calc($len(%q) +1), %x = 1, %r
  3005.     while (%k > 1) {
  3006.       var %k = $calc(%k -3), %r = %r $+ $chr($calc($mid(%q,%k,3) + %x))
  3007.       inc %x 1
  3008.     }
  3009.     did -a autocon 8 %r
  3010.   }
  3011.   if ($ncfg( %a $+ _server)) && ($ifmatch != ânoneâ) did -a autocon 7 $ifmatch
  3012.   if ($ncfg( %a $+ _nick)) && ($ifmatch != ânoneâ) did -a autocon 9 $ifmatch
  3013.   if ($ncfg( %a $+ _anick)) && ($ifmatch != ânoneâ) did -a autocon 10 $ifmatch
  3014.   if ($ncfg( %a $+ _ident)) && ($ifmatch != ânoneâ) did -a autocon 11 $ifmatch
  3015.   if ($ncfg( %a $+ _name)) && ($ifmatch != ânoneâ) did -a autocon 12 $ifmatch
  3016.   n.ds cr 17 %a $+ _on
  3017.   did -r autocon 2
  3018.   var %i = 1
  3019.   while (%i < 11) {
  3020.     var %a = $ncfg(auto_connect_ [ $+ [ %i  ] $+ ] _server)
  3021.     if (%a) && (%a != ânoneâ) did -a autocon 2 %i $+ : %a
  3022.     else did -a autocon 2 %i $+ : (none)
  3023.     inc %i 1
  3024.   }
  3025.   did -c autocon 2 $did(autocon,99)
  3026. }
  3027. on *:dialog:autocon:sclick:100:auto_connect_save
  3028. alias -l auto_connect_save {
  3029.   if ($did(autocon,99)) {
  3030.     var %a = auto_connect_ $+ $did(autocon,99)
  3031.     if ($did(autocon,7)) w_ncfg %a $+ _server $ifmatch
  3032.     else w_ncfg %a $+ _server ânoneâ    
  3033.     if ($did(autocon,8)) w_ncfg %a $+ _pass $bfe($ifmatch)
  3034.     else w_ncfg %a $+ _pass ânoneâ
  3035.     if ($did(autocon,9)) w_ncfg %a $+ _nick $ifmatch
  3036.     else w_ncfg %a $+ _nick ânoneâ
  3037.     if ($did(autocon,10)) w_ncfg %a $+ _anick $ifmatch
  3038.     else w_ncfg %a $+ _anick ânoneâ
  3039.     if ($did(autocon,11)) w_ncfg %a $+ _ident $ifmatch
  3040.     else w_ncfg %a $+ _ident ânoneâ
  3041.     if ($did(autocon,12)) w_ncfg %a $+ _name $ifmatch
  3042.     else w_ncfg %a $+ _name ânoneâ
  3043.     n.ds cw 17 %a $+ _on
  3044.   }
  3045. }
  3046. on *:dialog:autocon:sclick:13:{
  3047.   auto_connect_save
  3048.   autoconnect_connectnow
  3049. }
  3050. on *:dialog:autocon:sclick:16:{
  3051.   if ($did(autocon,7)) {
  3052.     if ($did(autocon,9)) var %nick = $ifmatch
  3053.     else var %nick = $readini(mirc.ini,mirc,nick)
  3054.     if ($did(autocon,10)) var %anick = $ifmatch
  3055.     else var %anick = $readini(mirc.ini,mirc,anick)
  3056.     if ($did(autocon,11)) var %ident = $ifmatch
  3057.     else var %ident = $readini(mirc.ini,mirc,email)
  3058.     if ($did(autocon,12)) var %name = $ifmatch
  3059.     else var %name = $readini(mirc.ini,mirc,user)
  3060.     server $iif(connect* iswm $status,-m) $gettok($did(autocon,7),1,32) $did(autocon,8) -i %nick %anick %ident %name
  3061.   }
  3062. }
  3063. alias autoconnect_connectnow {
  3064.   var %i = 1
  3065.   while (%i < 11) {
  3066.     if ($ncfg(auto_connect_ [ $+ [ %i ] $+ ] _on) == 1) {
  3067.       var %r
  3068.       if ($ncfg(auto_connect_ [ $+ [ %i ] $+ ] _pass)) && ($ifmatch != ânoneâ) {
  3069.         var %q = $ifmatch, %k = $calc($len(%q) +1), %x = 1, %r
  3070.         while (%k > 1) {
  3071.           var %k = $calc(%k -3), %r = %r $+ $chr($calc($mid(%q,%k,3) + %x))
  3072.           inc %x 1
  3073.         }
  3074.       }
  3075.       if ($ncfg(auto_connect_ [ $+ [ %i ] $+ ] _nick)) && ($ifmatch != ânoneâ) var %nick = $ifmatch
  3076.       else var %nick = $readini(mirc.ini,mirc,nick)
  3077.       if ($ncfg(auto_connect_ [ $+ [ %i ] $+ ] _anick)) && ($ifmatch != ânoneâ) var %anick = $ifmatch
  3078.       else var %anick = $readini(mirc.ini,mirc,anick)
  3079.       if ($ncfg(auto_connect_ [ $+ [ %i ] $+ ] _ident)) && ($ifmatch != ânoneâ) var %ident = $ifmatch
  3080.       else var %ident = $readini(mirc.ini,mirc,email)
  3081.       if ($ncfg(auto_connect_ [ $+ [ %i ] $+ ] _name)) && ($ifmatch != ânoneâ) var %name = $ifmatch
  3082.       else var %name = $readini(mirc.ini,mirc,user)
  3083.       if ($ncfg(auto_connect_ [ $+ [ %i ] $+ ] _server)) && ($ifmatch != ânoneâ) server $iif(connect* iswm $status,-m) $gettok($ncfg(auto_connect_ [ $+ [ %i ] $+ ] _server),1,32) [ %r ] -i %nick %anick %ident %name
  3084.     }    
  3085.     inc %i 1
  3086.   }
  3087. }
  3088. dialog as {
  3089.   title "AuthServ (/cas)"
  3090.   icon $scriptdirdll\i.dll, 22
  3091.   size -1 -1 145 121
  3092.   option dbu
  3093.   box "Options", 15, 2 68 141 39
  3094.   combo 2, 6 10 70 100, drop
  3095.   button "Add", 5, 78 10 30 11
  3096.   button "Remove", 6, 109 10 30 11
  3097.   edit "", 8, 44 37 95 11
  3098.   text "Nickname:", 1, 6 38 25 8
  3099.   edit "", 9, 44 49 95 11, pass
  3100.   text "Password:", 11, 6 50 25 8
  3101.   check "Automatically identify on request", 7, 6 75 97 10
  3102.   check "Use ghost command if nick is in use", 3, 6 85 102 10
  3103.   check "On authorized, set nick to +x", 16, 6 95 102 8
  3104.   box "Network", 4, 2 1 141 24
  3105.   box "Identify", 14, 2 28 141 36
  3106.   button "OK", 10, 105 108 37 11, ok
  3107.   text "", 99, 200 200 1 1
  3108. }
  3109. On *:dialog:as:init:0:{
  3110.   var %a = $findfile(config\,authserv-*.txt,0,1,did -a as 2 $mid($nopath($1-),10,-4))
  3111.   n.ds cr 7 authserv_on
  3112.   n.ds cr 3 authserv_ghost
  3113.   n.ds cr 16 authserv_hidemask
  3114. }
  3115. on *:dialog:as:sclick:7:n.ds cw 7 authserv_on
  3116. on *:dialog:as:sclick:3:n.ds cw 3 authserv_ghost
  3117. on *:dialog:as:sclick:16:n.ds cw 16 authserv_hidemask
  3118. on *:dialog:as:sclick:2:{
  3119.   authserv_save
  3120.   did -ar as 99 $did(as,2)
  3121.   var %a = config\authserv- $+ $did(as,2) $+ .txt
  3122.   if ($exists(%a)) {
  3123.     var %a = $read(config\authserv- $+ $did(as,2) $+ .txt), %k = $calc($len($gettok(%a,2-,44)) +1), %i = 1
  3124.     while (%k > 1) {
  3125.       var %k = $calc(%k -3), %r = %r $+ $chr($calc($mid($gettok(%a,2-,44),%k,3) + %i))
  3126.       inc %i 1
  3127.     }
  3128.     did -ar as 8 $gettok(%a,1,44)
  3129.     did -ar as 9 %r
  3130.   }
  3131. }
  3132. on *:dialog:as:sclick:5:{
  3133.   var %t = $n.input(Enter network name:,$network)
  3134.   if (%t) {
  3135.     authserv_save
  3136.     did -ar as 99 %t
  3137.     write -c config\authserv- $+ %t $+ .txt
  3138.     did -i as 2 1 %t
  3139.     did -c as 2 1
  3140.     did -r as 8,9
  3141.   }
  3142. }
  3143. on *:dialog:as:sclick:6:{
  3144.   if ($?!="Remove settings for $did(as,2) $+ ?") {
  3145.     var %n = config\authserv- $+ $did(as,2) $+ .txt
  3146.     if ($exists(%n)) .remove %n
  3147.     did -r as 8,9,2
  3148.     var %a = $findfile(config\,authserv-*.txt,0,1,did -a as 2 $mid($nopath($1-),10,-4))
  3149.   }
  3150. }
  3151. on *:dialog:as:sclick:10:{
  3152.   authserv_save
  3153. }
  3154. alias -l authserv_save {
  3155.   if ($did(as,99)) {
  3156.     var %n = config\authserv- $+ $did(as,99) $+ .txt
  3157.     if ($did(as,8)) && ($did(as,9)) write -c %n $did(as,8) $+ , $+ $bfe($did(as,9))
  3158.   }
  3159. }
  3160. alias authserv_connect {
  3161.   if ($lines(config\authserv- $+ $network $+ .txt) > 0) {
  3162.     var %a = $read(config\authserv- $+ $network $+ .txt), %k = $calc($len($gettok(%a,2-,44)) +1), %i = 1
  3163.     while (%k > 1) {
  3164.       var %k = $calc(%k -3), %r = %r $+ $chr($calc($mid($gettok(%a,2-,44),%k,3) + %i))
  3165.       inc %i 1
  3166.     }
  3167.     as auth $gettok(%a,1,44) %r
  3168.     if ($ncfg(authserv_hidemask) == 1) mode $me +x
  3169.   }
  3170. }
  3171. alias authserv_ghost {
  3172.   if ($lines(config\authserv- $+ $network $+ .txt) > 0) {
  3173.     var %a = $read(config\authserv- $+ $network $+ .txt), %k = $calc($len($gettok(%a,2-,44)) +1), %i = 1
  3174.     while (%k > 1) {
  3175.       var %k = $calc(%k -3), %r = %r $+ $chr($calc($mid($gettok(%a,2-,44),%k,3) + %i))
  3176.       inc %i 1
  3177.     }
  3178.     set %tmp.ghost $gettok(%a,1,44)
  3179.     authserv ghost $gettok(%a,1,44) %r
  3180.   }
  3181. }
  3182. dialog ns {
  3183.   title "NickServ (/cns)"
  3184.   size -1 -1 145 126
  3185.   option dbu
  3186.   icon nbs.ico, 0
  3187.   combo 2, 6 10 70 100, drop
  3188.   button "Add", 5, 78 10 30 11
  3189.   button "Remove", 6, 109 10 30 11
  3190.   edit "", 8, 44 37 95 11, autohs
  3191.   text "Nickname:", 1, 6 38 25 8
  3192.   edit "", 9, 44 49 95 11, pass autohs
  3193.   text "Password:", 11, 6 50 25 8
  3194.   text "Identify with:", 12, 6 79 36 8
  3195.   edit "", 13, 44 77 95 11, autohs
  3196.   check "Automatically identify on request", 7, 6 90 97 10,  
  3197.   check "Use ghost command if nick is in use", 3, 6 100 102 10,
  3198.   box "Network", 4, 2 1 141 24
  3199.   box "Identify", 14, 2 28 141 36
  3200.   box "Options", 15, 2 68 141 44
  3201.   button "OK", 10, 106 114 37 11, ok
  3202.   text "", 99, 200 200 1 1
  3203. }
  3204. On *:dialog:ns:init:0:{
  3205.   var %a = $findfile(config\,nickserv-*.txt,0,1,did -a ns 2 $mid($nopath($1-),10,-4))
  3206.   n.ds cr 7 nickserv_on
  3207.   n.ds cr 3 nickserv_ghost
  3208.   if ($ncfg(nickserv_prefix)) did -ar ns 13 $ifmatch
  3209. }
  3210. on *:dialog:ns:sclick:7:n.ds cw 7 nickserv_on
  3211. on *:dialog:ns:sclick:3:n.ds cw 3 nickserv_ghost
  3212. on *:dialog:ns:sclick:2:{
  3213.   nickserv_save
  3214.   did -ar ns 99 $did(ns,2)
  3215.   var %a = config\nickserv- $+ $did(ns,2) $+ .txt
  3216.   if ($exists(%a)) {
  3217.     var %a = $read(config\nickserv- $+ $did(ns,2) $+ .txt), %k = $calc($len($gettok(%a,2-,44)) +1), %i = 1
  3218.     while (%k > 1) {
  3219.       var %k = $calc(%k -3), %r = %r $+ $chr($calc($mid($gettok(%a,2-,44),%k,3) + %i))
  3220.       inc %i 1
  3221.     }
  3222.     did -ar ns 8 $gettok(%a,1,44)
  3223.     did -ar ns 9 %r
  3224.   }
  3225. }
  3226. on *:dialog:ns:sclick:5:{
  3227.   var %t = $n.input(Enter network name:,$network)
  3228.   if (%t) {
  3229.     nickserv_save
  3230.     did -ar ns 99 %t
  3231.     write -c config\nickserv- $+ %t $+ .txt
  3232.     did -i ns 2 1 %t
  3233.     did -c ns 2 1
  3234.     did -r ns 8,9
  3235.   }
  3236. }
  3237. on *:dialog:ns:sclick:6:{
  3238.   if ($?!="Remove settings for $did(ns,2) $+ ?") {
  3239.     var %n = config\nickserv- $+ $did(ns,2) $+ .txt
  3240.     if ($exists(%n)) .remove %n
  3241.     did -r ns 8,9,2
  3242.     var %a = $findfile(config\,nickserv-*.txt,0,1,did -a ns 2 $mid($nopath($1-),10,-4))
  3243.   }
  3244. }
  3245. on *:dialog:ns:sclick:10:{
  3246.   if ($did(ns,13)) w_ncfg nickserv_prefix $ifmatch
  3247.   nickserv_save
  3248. }
  3249. alias -l nickserv_save {
  3250.   if ($did(ns,99)) {
  3251.     var %n = config\nickserv- $+ $did(ns,99) $+ .txt
  3252.     if ($did(ns,8)) && ($did(ns,9)) write -c %n $did(ns,8) $+ , $+ $bfe($did(ns,9))
  3253.   }
  3254. }
  3255.  
  3256. dialog aj {
  3257.   title "Autojoin (/caj)"
  3258.   size -1 -1 191 173
  3259.   option dbu
  3260.   icon $scriptdirdll\i.dll, 17
  3261.   combo 2, 28 2 97 100, drop
  3262.   button "Add", 5, 128 2 30 11
  3263.   button "Remove", 6, 159 2 30 11
  3264.   edit "", 1, 1 14 189 135, multi return hsbar vsbar
  3265.   check "Enable autojoin", 8, 2 150 50 10,
  3266.   check "", 9, 93 150 96 10,
  3267.   check "Minimize channels on autojoin", 7, 2 160 85 10,
  3268.   button "Join now", 3, 115 161 37 11
  3269.   button "OK", 10, 153 161 37 11, ok
  3270.   text "Network:", 4, 3 4 25 8
  3271.   text "", 99, 200 200 1 1
  3272. }
  3273. On *:dialog:aj:init:0:{
  3274.   var %a = $findfile(config\,autojoin-*.txt,0,1,did -a aj 2 $mid($nopath($1-),10,-4))
  3275.   n.ds cr 7 autojoin_minimize
  3276.   n.ds cr 8 autojoin
  3277.   if (%n.caj) {
  3278.     did -ar aj 99 %n.caj
  3279.     var %n = config\autojoin- $+ %n.caj $+ .txt
  3280.     if ($exists(%n)) loadbuf -o aj 1 %n
  3281.     did -c aj 2 $n.cbgn(aj,2,%n.caj)
  3282.   }
  3283.   unset %n.caj
  3284.   did -a aj 9 Disable autojoin for $did(aj,2)
  3285.   n.ds cr 9 autojoin_disable_ $+ $did(aj,2)
  3286. }
  3287. on *:dialog:aj:sclick:3:{
  3288.   autojoin_save
  3289.   aj
  3290. }
  3291. on *:dialog:aj:sclick:7:n.ds cw 7 autojoin_minimize
  3292. on *:dialog:aj:sclick:8:n.ds cw 8 autojoin
  3293. on *:dialog:aj:sclick:9:n.ds cw 9 autojoin_disable_ $+ $did(aj,2)
  3294. on *:dialog:aj:sclick:2:{
  3295.   autojoin_save
  3296.   did -r aj 1
  3297.   did -ar aj 99 $did(aj,2)
  3298.   var %n = config\autojoin- $+ $did(aj,2) $+ .txt
  3299.   if ($exists(%n)) loadbuf -o aj 1 %n
  3300.   did -a aj 9 Disable autojoin for $did(aj,2)
  3301.   n.ds cr 9 autojoin_disable_ $+ $did(aj,2)
  3302. }
  3303. on *:dialog:aj:sclick:5:{
  3304.   var %t = $n.input(Enter network name:,$network)
  3305.   if (%t) {
  3306.     autojoin_save
  3307.     did -ar aj 99 %t
  3308.     write -c config\autojoin- $+ %t $+ .txt
  3309.     did -i aj 2 1 %t
  3310.     did -c aj 2 1
  3311.     did -r aj 1
  3312.   }
  3313. }
  3314. on *:dialog:aj:sclick:6:{
  3315.   if ($n.input(Do you want to remove autojoin for $did(aj,2) $+ ?,y/n)) {
  3316.     var %n = config\autojoin- $+ $did(aj,2) $+ .txt
  3317.     if ($exists(%n)) .remove %n
  3318.     did -ar aj 1 Autojoin for $did(aj,2) removed.
  3319.     did -r aj 2,99
  3320.     var %a = $findfile(config\,autojoin-*.txt,0,1,did -a aj 2 $mid($nopath($1-),10,-4))
  3321.   }
  3322. }
  3323. on *:dialog:aj:sclick:10:autojoin_save
  3324. alias -l autojoin_save {
  3325.   if (!$did(aj,99)) || (!$did(aj,1).lines) return
  3326.   var %n = config\autojoin- $+ $did(aj,99) $+ .txt
  3327.   write -c %n
  3328.   var %i = 1, %e = $did(aj,1).lines
  3329.   while (%i <= %e) {
  3330.     write %n $did(aj,1,%i)
  3331.     inc %i 1
  3332.   }
  3333. }
  3334. dialog txt {
  3335.   title "nbs-irc"
  3336.   size -1 -1 298 228
  3337.   option dbu
  3338.   icon $scriptdirdll\i.dll, 17
  3339.   edit "", 1, 1 2 296 212, multi return hsbar vsbar
  3340.   button "Save", 10, 221 216 37 11, ok
  3341.   button "Cancel", 3, 259 216 37 11, cancel
  3342.   button "Add shortcut", 20, 1 216 44 11
  3343. }
  3344. On *:dialog:txt:init:0:{
  3345.   n.mdx SetMircVersion $version
  3346.   n.mdx MarkDialog $dname
  3347.   n.mdx SetFont txt 1 15 400 Courier New
  3348.   if (!%tmp.txtfile) did -h txt 20
  3349.   unset %tmp.txtfile
  3350.   if (!$exists(%txt)) return
  3351.   loadbuf -o txt 1 %txt
  3352.   dialog -t txt %txt
  3353. }
  3354. on *:dialog:txt:sclick:20:{
  3355.   var %x = $$sfile(*.*,Select target file)
  3356.   if ($did(txt,1,$did(txt,1).lines)) did -a txt 1 $crlf
  3357.   did -a txt 1 %x
  3358.   did -f txt 1
  3359. }
  3360. on *:dialog:txt:sclick:10:{
  3361.   write -c %txt  
  3362.   if ($did(txt,1)) savebuf -o txt 1 %txt
  3363.   if (%txtload) {
  3364.     if (loadbuf isin %txtload) did -r $right(%txtload,-10)
  3365.     %txtload
  3366.   }
  3367.   unset %txtload
  3368. }
  3369.  
  3370.  
  3371. alias cl_hideall {
  3372.   if ($chan(0) < 1) return    
  3373.   var %i = 1
  3374.   while (%i <= $chan(0)) {
  3375.     if ($window($chan(%i)).state != hidden) window -h $chan(%i)
  3376.     inc %i
  3377.   }
  3378. }
  3379. alias cl_showall {
  3380.   if ($chan(0) < 1) return  
  3381.   var %i = 1
  3382.   while (%i <= $chan(0)) {
  3383.     if ($window($chan(%i)).state == hidden) window -w $chan(%i)
  3384.     hadd -m temp ci. [ $+ [ $cid ] $+ ] . [ $+ [ $chan(%i) ] ] $ticks
  3385.     inc %i
  3386.   }
  3387. }
  3388. alias cl_lc {
  3389.   if (!$dialog(cl)) return
  3390.   did -r cl 1  
  3391.   var %i = 1
  3392.   while (%i <= $chan(0)) {
  3393.     if ($window($chan(%i)).state == hidden) did -a cl 1 $chan(%i) $chr(9) $+ $dur($calc($ci($chan(%i)) * 60),2) $chr(9) $+ •
  3394.     else did -a cl 1 $chan(%i) $chr(9) $+ $dur($calc($ci($chan(%i)) * 60),2)
  3395.     inc %i
  3396.   }
  3397. }
  3398. dialog cl {
  3399.   title "Channel list"
  3400.   size -1 -1 251 341
  3401.   option pixels
  3402.   icon $scriptdirdll\i.dll,4  
  3403.   list 1, 2 18 246 238, size extsel
  3404.   button "Close", 2, 189 319 60 20, ok
  3405.   text "Double click to hide/show channel:", 3, 2 2 178 16
  3406.   button "Hide all", 4, 64 319 60 20
  3407.   check "Show hidden channels on activity (say)", 6, 2 280 217 19,
  3408.   button "Show all", 7, 2 319 60 20
  3409.   check "Autohide channels after ", 5, 2 298 136 20,
  3410.   edit "", 8, 138 298 28 20, autohs limit 2 center
  3411.   text "m of inactivity", 9, 168 300 76 16
  3412.   edit "", 10, 2 259 219 21, autohs
  3413.   button "?", 11, 223 260 24 18
  3414. }
  3415. On *:dialog:cl:init:0:{
  3416.   n.mdx SetMircVersion $version
  3417.   n.mdx MarkDialog $dname
  3418.   n.mdx SetControlMDX cl 1 ListView report single rowselect > scripts\dll\mdx\views.mdx  
  3419.   did -i cl 1 1 headerdims 130:1 70:2 20:3
  3420.   did -i cl 1 1 headertext Channel $chr(9) $+ Idle $chr(9) $+ H
  3421.   if ($network) dialog -t cl Chanlist $+([,$network,])
  3422.   if ($ncfg(win_ashow == 1)) did -c cl 6
  3423.   if ($ncfg(ci-check == 1)) did -c cl 5
  3424.   if ($ncfg(cic-time)) did -a cl 8 $ncfg(cic-time)
  3425.   if ($ncfg(nohide)) did -a cl 10 $ncfg(nohide)  
  3426.   cl_lc
  3427. }
  3428. On *:dialog:cl:sclick:2:{
  3429.   if ($did(cl,6).state == 1) { w_ncfg win_ashow 1 }
  3430.   else { w_ncfg win_ashow o }
  3431.   if ($did(cl,5).state == 1) { w_ncfg ci-check 1 }
  3432.   else { w_ncfg ci-check o }
  3433.   if ($did(cl,8).text isnum 1-240) w_ncfg cic-time $did(cl,8).text
  3434.   if ($did(cl,10).text) w_ncfg nohide $did(cl,10).text
  3435. }
  3436. On *:dialog:cl:sclick:4:{
  3437.   cl_hideall
  3438.   cl_lc
  3439. }
  3440. On *:dialog:cl:sclick:7:{
  3441.   cl_showall
  3442.   cl_lc
  3443. }
  3444. On *:dialog:cl:dclick:1:{
  3445.   tokenize 32 $did(cl,1).seltext
  3446.   if ($window($6).state == hidden) {
  3447.     window -w $6
  3448.     hadd -m temp ci. [ $+ [ $cid ] $+ ] . [ $+ [ $6 ] ] $ticks
  3449.   }
  3450.   else window -h $6
  3451.   cl_lc
  3452. }
  3453. On *:dialog:cl:sclick:11:var %. = $n.input(Always show these channels $+ $c44 $crlf $+ seperate with space.,info)
  3454. dialog cc {
  3455.   title "cc"
  3456.   size -1 -1 272 207
  3457.   option dbu
  3458.   icon $scriptdirdll\i.dll, 7
  3459.   text "Topic", 3, 2 1 66 8
  3460.   text "Bans", 4, 2 22 65 8
  3461.   combo 1, 2 9 268 100, edit drop
  3462.   check "Set with Q", 16, 232 20 37 10
  3463.   list 2, 1 30 269 98, size extsel
  3464.   button "Bans", 18, 2 129 33 11
  3465.   button "Excepts", 19, 36 129 33 11
  3466.   button "Invites", 20, 70 129 33 11
  3467.   button "Select all", 15, 168 129 33 11
  3468.   button "Edit", 100, 202 129 33 11
  3469.   button "Remove", 101, 236 129 33 11
  3470.   check "Only ops set topic (+t)", 5, 3 143 67 10
  3471.   check "No external messages (+n)", 6, 3 153 78 10
  3472.   check "Invite only (+i)", 7, 3 163 51 10
  3473.   check "Moderated (+m)", 8, 3 173 51 10
  3474.   check "Private (+p)", 14, 3 183 43 10
  3475.   check "Secret (+s)", 10, 3 193 59 10
  3476.   check "Key (+k):", 30, 83 143 33 10
  3477.   edit "", 32, 117 143 50 10, autohs
  3478.   check "Limit (+l):", 31, 83 153 34 10
  3479.   edit "", 33, 117 153 25 10, autohs
  3480.   check "Only authed/registered users (+r)", 11, 83 163 96 10
  3481.   check "No channel notices (+N)", 12, 83 173 84 10
  3482.   check "No channel CTCPs (+C)", 13, 83 183 83 10
  3483.   check "No colors (+c)", 9, 83 193 50 10
  3484.   text "Custom:", 21, 182 144 22 8
  3485.   edit "", 23, 206 143 63 10, autohs
  3486.   text "Available:", 24, 182 164 25 8
  3487.   text "", 25, 208 164 60 8, right
  3488.   text "Current:", 26, 182 155 25 8
  3489.   text "", 27, 208 155 60 8, right
  3490.   button "OK", 17, 196 195 37 11, default ok
  3491.   button "Cancel", 22, 234 195 37 11, cancel
  3492. }
  3493. alias cc {
  3494.   if ($status == connected) && ($1 ischan) && ($me ison $1) && (!$dialog(editban)) && (!$dialog(cc)) {
  3495.     set %ccc $1
  3496.     dlg cc
  3497.     dialog -t cc $1 - $strip($right($n.chanstats($1),-6))
  3498.   }
  3499. }
  3500. on *:dialog:cc:init:0:{
  3501.   n.mdx SetMircVersion $version
  3502.   n.mdx MarkDialog $dname
  3503.   n.mdx SetControlMDX cc 2 listview report showsel > scripts\dll\mdx\views.mdx
  3504.   did -i cc 2 1 headerdims 306:1 110:2 100:3
  3505.   did -i cc 2 1 headertext Address $chr(9) $+ Set by $chr(9) $+ Set on
  3506.   unset %unban %ccc.*
  3507.   var %x = $+(",$scriptdirtemp\topic\,$md5(%ccc),â,$cid,")
  3508.   if ($exists(%x)) loadbuf -o cc 1 $qt(%x)
  3509.   else did -a cc 1 $chan(%ccc).topic
  3510.   did -ar cc 3 Topic ( $+ $len($chan(%ccc).topic) $+ / $+ $n.topiclen $+ )
  3511.   did -b cc 16,32,33 $+ $iif(e !isincs $chanmodes,$chr(44) $+ 19) $+ $iif(I !isincs $chanmodes,$chr(44) $+ 20)
  3512.   if (!$n.qnet) did -h cc 16
  3513.   if ($chan(%ccc).topic) {
  3514.     var %x = $ifmatch
  3515.     set %ccc.topic $iif($left(%x,1) == $chr(32),$right(%x,-1),%x)
  3516.     did -c cc 1 1
  3517.   }
  3518.   var %i = 5
  3519.   while (%i < 15) {
  3520.     if ($cm(%i) isincs $gettok($chan(%ccc).mode,1,32)) did -c cc %i
  3521.     inc %i
  3522.   }
  3523.   if (k isincs $gettok($chan(%ccc).mode,1,32)) && ($chankey(%ccc)) { did -c cc 30 | did -e cc 32 | did -a cc 32 $chankey(%ccc) | set %ccc.key $chankey(%ccc) }
  3524.   if (l isincs $gettok($chan(%ccc).mode,1,32)) { did -c cc 31 | did -e cc 33 | did -a cc 33 $chan(%ccc).limit | set %ccc.limit $chan(%ccc).limit }
  3525.   did -a cc 25 $iif($chanmodes,$ifmatch,unknown)
  3526.   did -a cc 27 $iif($chan(%ccc).mode,$ifmatch,none)
  3527.   mode %ccc +b
  3528.   set -u20 %ccc.banget 1
  3529.   set %ccc.list b
  3530.   did -ar cc 4 Bans (retrieving)
  3531.   did -f cc 3
  3532.   if (q ison %ccc) && ($n.qnet) did -e cc 16
  3533. }
  3534. on *:dialog:cc:sclick:30,31:{
  3535.   if ($did(cc,$did).state == 1) did -e cc $calc($did +2)
  3536.   else did -b cc $calc($did +2)
  3537. }
  3538. on *:dialog:cc:sclick:18,19,20:{
  3539.   var %x = $replace($did,18,b,19,e,20,I)
  3540.   if (%ccc.list != %x) {
  3541.     did -ar cc 4 $replace($did,18,Bans,19,Excepts,20,Invites)    
  3542.     did -r cc 2
  3543.     set -u10 %ccc.banget 1
  3544.     set %ccc.list %x
  3545.     mode %ccc + $+ %x
  3546.   }
  3547. }
  3548. on *:dialog:cc:close:0:{
  3549.   if ($dialog(editban)) dialog -x editban
  3550.   if ($window(@topic)) close -@ @topic*
  3551.   unset %oldmode
  3552. }
  3553. on *:dialog:cc:sclick:100:{
  3554.   if ($did(cc,2).seltext) n.editmode $gettok($did(cc,2).seltext,6,32)
  3555. }
  3556. on *:dialog:cc:dclick:2:{
  3557.   if ($did(cc,2).seltext) n.editmode $gettok($did(cc,2).seltext,6,32)
  3558. }
  3559. on *:dialog:cc:edit:1:{
  3560.   did -ar cc 3 Topic ( $+ $len($did(cc,1,0)) $+ / $+ $n.topiclen $+ )
  3561.   if ($len($did(cc,1,0)) > $n.topiclen) n.mdx SetColor 3 textbg 255
  3562.   else n.mdx SetColor 3 textbg reset
  3563.   n.preview cc $did(cc,1,0)
  3564. }
  3565. on *:dialog:cc:sclick:1:{
  3566.   did -ar cc 3 Topic ( $+ $len($did(cc,1,0)) $+ / $+ $n.topiclen $+ )
  3567.   n.mdx SetColor 3 textbg reset
  3568.   n.preview cc $did(cc,1,0)
  3569. }
  3570. on *:dialog:cc:sclick:101:{
  3571.   if (!%ccc.list) return
  3572.   .write -c $qt($scriptdirtemp\unban)
  3573.   var %i = 2
  3574.   while (%i <= $did(cc,2).lines) {
  3575.     if (s isin $gettok($did(cc,2,%i).text,2,32)) .write $qt($scriptdirtemp\unban) $gettok($did(cc,2,%i).text,6,32)
  3576.     inc %i
  3577.   }
  3578.   if ($read($scriptdirtemp\unban)) {
  3579.     did -r cc 2
  3580.     var %x, %i = 1, %e = $lines($scriptdirtemp\unban)
  3581.     while (%i <= %e) {
  3582.       if ($numtok(%x,32) == $modespl) {
  3583.         mode %ccc - $+ $str(%ccc.list,$numtok(%x,32)) %x
  3584.         dec %i
  3585.         unset %x
  3586.       }
  3587.       else var %x = %x $read($scriptdirtemp\unban,%i)
  3588.       inc %i
  3589.     }
  3590.     mode %ccc - $+ $str(%ccc.list,$numtok(%x,32)) %x
  3591.     set -u20 %ccc.banget 1      
  3592.     mode %ccc + $+ %ccc.list
  3593.   }
  3594. }
  3595. on *:dialog:cc:sclick:15:{
  3596.   var %i = 2
  3597.   while (%i <= $did(cc,2).lines) {
  3598.     did -o cc 2 %i 0 $replace($gettok($did(cc,2,%i).text,2,32),+,+s) $gettok($did(cc,2,%i).text,3-,32)
  3599.     inc %i
  3600.   }
  3601.   did -f cc 2
  3602. }
  3603. on *:dialog:cc:sclick:17:{
  3604.   if (!$did(cc,1,0)) && (%ccc.topic) !raw -q topic %ccc :
  3605.   elseif ($did(cc,1,0) === %ccc.topic) .echo -qgs a
  3606.   else {
  3607.     if ($did(cc,16).state == 1) && ($n.qnet) && (q ison %ccc) !raw -q PRIVMSG Q :settopic %ccc $did(cc,1,0)
  3608.     else topic %ccc $did(cc,1,0)
  3609.   }
  3610.   var %i = 5, %+modes, %-modes, %+key, %-key, %cmodes = $did(cc,23)
  3611.   while (%i < 15) {
  3612.     if (($did(cc,%i).state == 1) && ($cm(%i) !isincs $gettok($chan(%ccc).mode,1,32))) var %+modes = %+modes $+ $cm(%i)
  3613.     elseif (($did(cc,%i).state == 0) && ($cm(%i) isincs $gettok($chan(%ccc).mode,1,32))) var %-modes = %-modes $+ $cm(%i)
  3614.     inc %i
  3615.   }
  3616.   if (($did(cc,30).state == 1) && ($did(cc,32).text) && (k !isincs $gettok($chan(%ccc).mode,1,32))) var %+key = +k $did(cc,32).text
  3617.   elseif (($did(cc,30).state == 1) && ($did(cc,32).text) && ($did(cc,32).text != %ccc.key) && (k isincs $gettok($chan(%ccc).mode,1,32))) { var %+key = +k $did(cc,32).text | var %-key = -k %ccc.key }
  3618.   elseif (($did(cc,30).state == 0) && (k isincs $gettok($chan(%ccc).mode,1,32))) var %-key = -k $chan(%ccc).key
  3619.   if (($did(cc,31).state == 1) && ($did(cc,33).text isnum) && ($did(cc,33).text != %ccc.limit)) var %+modes = %+modes l $did(cc,33).text
  3620.   elseif (($did(cc,31).state == 0) && (l isincs $gettok($chan(%ccc).mode,1,32))) var %-modes = %-modes $+ l
  3621.   if (%+modes) || (%-modes) mode %ccc $iif(%+modes,$+(+,$v1)) $iif(%-modes,$+(-,$v1))
  3622.   if (%cmodes) mode %ccc %cmodes
  3623.   if (%-key) mode %ccc %-key
  3624.   if (%+key) {
  3625.     mode %ccc %+key
  3626.     set %pw. [ $+ [ %ccc ] ] $gettok(%+key,2-,32)
  3627.   }
  3628. }
  3629. alias n.editmode {
  3630.   if (!$1) return
  3631.   unset %oldmode
  3632.   set %oldmode $1-
  3633.   dlg editban
  3634. }
  3635. dialog editban {
  3636.   title "Edit"
  3637.   size -1 -1 153 35
  3638.   option dbu
  3639.   icon $scriptdirdll\i.dll, 7
  3640.   edit "", 1, 2 10 150 11, autohs
  3641.   text "Address:", 2, 2 2 74 8
  3642.   button "OK", 3, 77 23 37 11, ok
  3643.   button "Cancel", 4, 115 23 37 11, cancel
  3644. }
  3645. On *:dialog:editban:init:0:did -a editban 1 %oldmode
  3646. On *:dialog:editban:sclick:3:{
  3647.   if (%oldmode != $did(editban,1).text) {
  3648.     mode %ccc $+(-,%ccc.list,+,%ccc.list) %oldmode $did(editban,1).text
  3649.     if ($dialog(cc)) {
  3650.       did -r cc 2
  3651.       mode %ccc + $+ %ccc.list
  3652.     }
  3653.   }
  3654.   unset %oldmode
  3655. }
  3656.  
  3657.  
  3658. dialog cmds {
  3659.   title "Commands (/cmds)"
  3660.   size -1 -1 295 221
  3661.   option dbu
  3662.   icon nbs.ico, 0
  3663.   button "Close", 100, 256 208 37 11, cancel
  3664.  
  3665.   tab "Setup", 11, 2 0 290 202
  3666.   list 1, 5 16 283 183, tab 11 size extsel
  3667.   tab "IRC", 12
  3668.   list 2, 5 16 283 183, tab 12 size extsel
  3669.   tab "Extended", 13
  3670.   list 3, 5 16 283 183, tab 13 size extsel
  3671.   tab "System info", 14
  3672.   list 4, 5 16 283 183, tab 14 size extsel
  3673.   tab "Other", 15
  3674.   list 5, 5 16 283 183, tab 15 size extsel
  3675.  
  3676.   text "Double-click on any command to run it now", 200, 6 209 127 8
  3677. }
  3678.  
  3679. on *:dialog:cmds:init:0:{
  3680.   n.mdx SetMircVersion $version
  3681.   n.mdx MarkDialog $dname
  3682.   var %i = 1
  3683.   while (%i < 6) {
  3684.     n.mdx SetControlMDX cmds %i listview report rowselect > scripts\dll\mdx\views.mdx
  3685.     did -i cmds %i 1 headerdims 110:1 430:2
  3686.     did -i cmds %i 1 headertext Command $chr(9) $+ Action $chr(160) <required> / [optional]
  3687.     inc %i
  3688.   }
  3689.   var %tab = 11
  3690.   while (%tab < 16) {
  3691.     var %src = $replace(%tab,11,setup,12,irc,13,extended,14,sysinfo,15,other)
  3692.     var %src = scripts\txt\cmds_ $+ %src $+ .txt
  3693.     var %targetid = $calc(%tab - 10)
  3694.     var %i = 1, %e = $lines(%src)
  3695.     while (%i <= %e) {
  3696.       var %x = $read(%src,%i)
  3697.       if (%x) did -a cmds %targetid / $+ $gettok(%x,1,44) $chr(9) $+ $gettok(%x,2-,44)
  3698.       else did -a cmds %targetid $chr(160)
  3699.       inc %i
  3700.     }
  3701.     inc %tab
  3702.   }
  3703.   did -f cmds 1
  3704. }
  3705. on *:dialog:cmds:dclick:1-5:{
  3706.   var %x = $gettok($did($did,$did($did).sel),6,32)
  3707.   if ($left(%x,1) == /) && ($n.input(Run command %x now?,y/n)) $right(%x,-1)
  3708. }
  3709.  
  3710.  
  3711. dialog fkeys {
  3712.   title "F-key bindings (/fkeys)"
  3713.   size -1 -1 171 90
  3714.   option dbu
  3715.   icon $scriptdirdll\i.dll, 17
  3716.   edit "", 1, 11 3 70 11, autohs
  3717.   edit "/setup", 2, 11 15 70 11, read
  3718.   edit "", 3, 11 27 70 11, autohs
  3719.   edit "", 4, 11 40 70 11, autohs
  3720.   edit "", 5, 11 52 70 11, autohs
  3721.   edit "(ban/unban latest ban)", 6, 11 64 70 11, read autohs
  3722.   edit "", 7, 99 3 70 11, autohs
  3723.   edit "", 8, 99 15 70 11, autohs
  3724.   edit "", 9, 99 27 70 11, autohs
  3725.   edit "", 10, 99 40 70 11, autohs
  3726.   edit "", 11, 99 52 70 11, autohs
  3727.   edit "", 12, 99 64 70 11, autohs
  3728.   text "F1", 20, 1 5 9 7, right
  3729.   text "F2", 39, 1 17 9 8, right
  3730.   text "F3", 98, 1 29 9 8, right
  3731.   text "F4", 58, 1 42 9 8, right
  3732.   text "F5", 74, 1 54 9 8, right
  3733.   text "F6", 78, 1 66 9 8, right
  3734.   text "F7", 77, 89 5 9 8, right
  3735.   text "F8", 67, 89 17 9 8, right
  3736.   text "F9", 57, 89 29 9 8, right
  3737.   text "F10", 83, 89 42 9 8, right
  3738.   text "F11", 32, 89 54 9 8, right
  3739.   text "F12", 54, 89 66 9 8, right
  3740.   button "Reset", 101, 1 79 37 11
  3741.   button "OK", 100, 95 79 37 11, ok
  3742.   button "Cancel", 13, 133 79 37 11, cancel
  3743. }
  3744.  
  3745. on *:dialog:fkeys:init:0:{
  3746.   var %i = 1
  3747.   while (%i < 13) {
  3748.     if (%i != 6) && (%i != 2) && ($ncfg(fkey_f [ $+ [ %i ] ]) != ânoneâ) did -a fkeys %i $ifmatch
  3749.     inc %i 1
  3750.   }
  3751. }
  3752. on *:dialog:fkeys:sclick:101:{
  3753.   if ($?!="Are you sure?") {
  3754.     did -ar fkeys 1 /help
  3755.     did -ar fkeys 3 /awaysys
  3756.     did -ar fkeys 4 /back
  3757.     did -ar fkeys 5 /lastpop
  3758.     did -ar fkeys 7 /topic $chr(35)
  3759.     did -ar fkeys 8 /np
  3760.     did -ar fkeys 9 /logviewer
  3761.     did -ar fkeys 10 /g-join
  3762.     did -ar fkeys 11 /blist
  3763.     did -ar fkeys 12 /aboutnbs
  3764.   }
  3765. }
  3766. on *:dialog:fkeys:sclick:100:{
  3767.   var %i = 1
  3768.   while (%i < 13) {
  3769.     if (%i != 6) && (%i != 2) {
  3770.       if ($did(fkeys,%i).text) w_ncfg fkey_f $+ %i $ifmatch
  3771.       else w_ncfg fkey_f $+ %i ânoneâ
  3772.     }
  3773.     inc %i 1
  3774.   }
  3775. }
  3776. dialog servers {
  3777.   title "Servers"
  3778.   size -1 -1 200 124
  3779.   option dbu
  3780.   icon $scriptdirdll\i.dll,12
  3781.   list 1, 1 1 198 111, size extsel
  3782.   button "Close", 3, 169 113 30 10, cancel
  3783.   button "Edit", 4, 138 113 30 10
  3784.   check "New connection", 5, 57 113 52 10,
  3785.   check "Show on startup", 2, 2 113 50 10,
  3786. }
  3787. on *:dialog:servers:init:0:{
  3788.   n.mdx SetMircVersion $version
  3789.   n.mdx MarkDialog $dname
  3790.   n.mdx SetControlMDX $dname 1 ListView report single rowselect showsel > scripts\dll\mdx\views.mdx  
  3791.   did -i $dname 1 1 headerdims 90:1 180:2 40:3
  3792.   did -i $dname 1 1 headertext Name $chr(9) $+ Server:port $chr(9) $+ Pass.
  3793.   if ($status == connected) did -c servers 5
  3794.   if ($ncfg(con-on-start) == 1) did -c servers 2  
  3795.   con-update
  3796. }
  3797. on *:dialog:servers:sclick:4:{
  3798.   set %txtload con-update
  3799.   txt config\irc-servers.txt
  3800. }
  3801. alias con-update {
  3802.   if ($lines(config\irc-servers.txt) < 1) { did -ra servers 1 (empty) | return }
  3803.   set %e $lines(config\irc-servers.txt)
  3804.   var %i = 1
  3805.   did -r servers 1
  3806.   while (%i <= %e) {
  3807.     if ($gettok($read(config\irc-servers.txt,%i),3,44)) did -a servers 1 $gettOK($read(config\irc-servers.txt,%i),1,44) $chr(9) $+ $gettOK($read(config\irc-servers.txt,%i),2,44) $chr(9) $+ yes
  3808.     else did -a servers 1 $replace($read(config\irc-servers.txt,%i),$chr(44),$chr(9)) $chr(9) $+ no
  3809.     inc %i
  3810.   }
  3811. }
  3812. on *:dialog:servers:sclick:2:{
  3813.   if ($did(servers,2).state == 1) w_ncfg con-on-start 1
  3814.   else w_ncfg con-on-start o
  3815. }
  3816. on *:dialog:servers:dclick:1:{
  3817.   if ($did(servers,1).sel) {
  3818.     var %con-temp = $gettok($read(config\irc-servers.txt, $+ $calc($did(servers,1).sel -1) $+ ),2,44) $gettok($read(config\irc-servers.txt, $+ $calc($did(servers,1).sel -1) $+ ),3,44)
  3819.     if ($did(servers,5).state == 1) server -m %con-temp
  3820.     else server %con-temp
  3821.     if ($did(servers,5).state == 0) did -c servers 5
  3822.   }
  3823. }
  3824. dialog addedit {
  3825.   title "Add"
  3826.   size -1 -1 167 41
  3827.   option dbu
  3828.   icon $scriptdirdll\i.dll, 17
  3829.   text "Address:", 1, 2 5 22 8
  3830.   text "Reason:", 2, 2 17 22 8
  3831.   edit "", 3, 25 3 140 11, autohs
  3832.   edit "", 4, 25 15 140 11, autohs
  3833.   button "OK", 5, 90 29 37 11, ok
  3834.   button "Cancel", 6, 128 29 37 11, cancel
  3835. }
  3836. on *:dialog:addedit:init:0:{
  3837.   if ($gettok(%addedit,1,1)) {
  3838.     did -a addedit 3 $ifmatch
  3839.     dialog -t addedit Edit
  3840.     if ($gettok(%addedit,2-,1)) did -a addedit 4 $ifmatch
  3841.   }
  3842.   else did -a addedit 4 Blacklisted
  3843. }
  3844. on *:dialog:addedit:sclick:5:{
  3845.   if (%addedit) && $did(addedit,3) && ($read(config\blacklist.txt,w,$gettok(%addedit,1,1) $+ *)) {
  3846.     .write -dl $+ $readn config\blacklist.txt
  3847.     var %x = $readn
  3848.   }
  3849.   if ($did(addedit,3)) .write $iif(%x,-il $+ %x) config\blacklist.txt $iif($chr(33) !isin $did(addedit,3),*!*) $+ $iif(@ !isin $did(addedit,3),@) $+ $did(addedit,3) $+ $iif($did(addedit,4),$chr(44) $+ $ifmatch)
  3850.   n.bl-update
  3851. }
  3852. on *:dialog:addedit:close:0:unset %addedit
  3853. dialog blchans {
  3854.   title "Blacklist channels"
  3855.   size -1 -1 112 146
  3856.   option dbu
  3857.   icon $scriptdirdll\i.dll, 15
  3858.   box "Enable blacklist for:", 5, 2 2 108 129
  3859.   radio "All channels", 7, 6 11 54 10,
  3860.   radio "Specified channels:", 8, 6 20 68 10,
  3861.   edit "", 2, 13 30 93 86, multi return autohs autovs vsbar
  3862.   button "Add current", 4, 69 117 37 11
  3863.   button "OK", 3, 73 134 37 11, ok
  3864. }
  3865. on *:dialog:blchans:init:0:{
  3866.   if ($ncfg(blacklist_custom_channels) == 1) did -c blchans 8
  3867.   else {
  3868.     did -c blchans 7
  3869.     did -b blchans 2,4
  3870.   }
  3871.   var %i = 1, %x = $gettok($ncfg(blacklist_channels),0,32)
  3872.   if (%x) {
  3873.     while (%i <= %x) {
  3874.       did -a blchans 2 $gettok($ncfg(blacklist_channels),%i,32) $+ $crlf
  3875.       inc %i
  3876.     }
  3877.   }
  3878.   else {
  3879.     var %i = 1
  3880.     while (%i <= $chan(0)) {
  3881.       did -a blchans 2 $chan(%i) $+ $crlf
  3882.       inc %i
  3883.     }
  3884.   }
  3885. }
  3886. on *:dialog:blchans:sclick:7:did -b blchans 2,4
  3887. on *:dialog:blchans:sclick:8:did -e blchans 2,4
  3888. on *:dialog:blchans:sclick:3:{
  3889.   if ($did(blchans,8).state == 1) {
  3890.     w_ncfg blacklist_custom_channels 1
  3891.     .remini config\config.ini nbs-irc blacklist_channels
  3892.     var %i = 1, %x = $did(blchans,2).lines, %y
  3893.     if (%x) {
  3894.       while (%i <= %x) {
  3895.         var %y = %y $did(blchans,2,%i)
  3896.         inc %i
  3897.       }
  3898.       w_ncfg blacklist_channels %y
  3899.     }
  3900.   }
  3901.   else w_ncfg blacklist_custom_channels o
  3902. }
  3903. on *:dialog:blchans:sclick:4:{
  3904.   if ($did(blchans,2,$did(blchans,2).lines)) did -a blchans 2 $crlf
  3905.   if ($active ischan) did -a blchans 2 $active
  3906. }
  3907. dialog blist {
  3908.   title "Blacklist"
  3909.   size -1 -1 213 146
  3910.   option dbu
  3911.   icon $scriptdirdll\i.dll, 15
  3912.   list 1, 1 2 210 130, size extsel
  3913.   check "Enable blacklist", 2, 3 135 50 10,
  3914.   button "Add", 5, 58 134 30 11
  3915.   button "Remove", 6, 89 134 30 11
  3916.   button "Edit", 4, 120 134 30 11
  3917.   button "Channels", 7, 151 134 30 11
  3918.   button "Close", 3, 182 134 30 11, cancel
  3919. }
  3920. on *:dialog:blist:init:0:{
  3921.   n.mdx SetMircVersion $version
  3922.   n.mdx MarkDialog $dname
  3923.   n.mdx SetControlMDX $dname 1 ListView report single rowselect showsel > scripts\dll\mdx\views.mdx  
  3924.   did -i $dname 1 1 headerdims 260:1 130:2
  3925.   did -i $dname 1 1 headertext Address $chr(9) $+ Reason
  3926.   if ($ncfg(blacklist) == 1) did -c blist 2
  3927.   n.bl-update
  3928. }
  3929. on *:dialog:blist:sclick:7:dlg blchans
  3930. on *:dialog:blist:dclick:1:bl.edit
  3931. on *:dialog:blist:sclick:4:bl.edit
  3932. alias bl.edit {
  3933.   if ($did(blist,1).seltext) {
  3934.     var %x = $replace($did(blist,1).seltext,$chr(9),$chr(32))
  3935.     addedit $+($gettok(%x,6,32),$chr(1),$gettok(%x,11-,32))
  3936.   }
  3937. }
  3938. on *:dialog:blist:sclick:2:n.ds cw 2 blacklist
  3939. on *:dialog:blist:sclick:5:addedit
  3940. on *:dialog:blist:sclick:6:{
  3941.   var %x = $gettok($replace($did(blist,1).seltext,$chr(9),$chr(32)),6,32)
  3942.   if (%x) && ($read(config\blacklist.txt,w,%x $+ *)) {
  3943.     .write -dl $+ $readn config\blacklist.txt
  3944.     n.bl-update
  3945.   }
  3946. }
  3947. on *:dialog:blist:sclick:3:if ($did(blist,2).state == 1) scon -at1 n.blscanall
  3948. alias n.bl-update {
  3949.   if ($lines(config\blacklist.txt) < 1) did -r blist 1
  3950.   else {
  3951.     var %i = 1, %e = $lines(config\blacklist.txt)
  3952.     did -r blist 1
  3953.     while (%i <= %e) {
  3954.       did -a blist 1 $replace($read(config\blacklist.txt,%i),$chr(44),$chr(9))
  3955.       inc %i
  3956.     }
  3957.   }
  3958. }
  3959. dialog alarm {
  3960.   title "Alarm timer (/alarm)"
  3961.   size -1 -1 106 141
  3962.   option dbu
  3963.   icon $scriptdirdll\i.dll, 17
  3964.   box "Time:", 9, 2 2 101 35
  3965.   box "Action:", 10, 2 40 101 86
  3966.   radio "Ring at:", 2, 6 10 31 10, group
  3967.   edit "", 1, 38 10 24 11, autohs center
  3968.   radio "Ring in:", 17, 6 22 30 10
  3969.   edit "", 18, 38 22 24 11, autohs center
  3970.   radio "Beep", 3, 6 49 26 10, group
  3971.   radio "Play sound:", 4, 6 60 40 10
  3972.   edit "", 5, 14 70 73 11, autohs
  3973.   button "...", 13, 89 71 11 9
  3974.   check "Run program:", 11, 6 81 50 10,
  3975.   edit "", 12, 14 91 73 11, autohs
  3976.   button "...", 14, 89 92 11 9
  3977.   check "Display notification:", 15, 6 102 70 10,
  3978.   edit "", 16, 14 112 86 11, autohs
  3979.   button "Set", 6, 2 129 33 11, ok
  3980.   button "Reset", 7, 36 129 33 11
  3981.   button "Close", 8, 70 129 33 11, cancel
  3982.   text "hh:mm (24h)", 19, 65 12 35 8
  3983.   text "minutes", 20, 65 24 22 8
  3984. }
  3985.  
  3986.  
  3987. On *:dialog:alarm:init:0:{
  3988.   did -b alarm 18
  3989.   if (%alarm_time) did -ar alarm 1 $ifmatch
  3990.   if (%alarm_etime) did -ar alarm 18 $ifmatch
  3991.   if ($timer(alarm)) {
  3992.     if ($timer(alarm).time) did -c alarm 2
  3993.     else did -c alarm 17
  3994.     did -b alarm 1,2,3,4,5,6,11,12,13,14,15,16,17
  3995.     did -f alarm 8
  3996.   }
  3997.   else did -c alarm 2
  3998.   if ($ncfg(alarm_type) == sound) && ($ncfg(alarm_sound)) {
  3999.     did -c alarm 4
  4000.     did -a alarm 5 $ifmatch
  4001.   }
  4002.   else did -c alarm 3
  4003.   if ($ncfg(alarm_program)) did -a alarm 12 $ifmatch
  4004.   if ($ncfg(alarm_message)) did -a alarm 16 $ifmatch
  4005.   if (%alarm.program == 1) did -c alarm 11
  4006.   if (%alarm.message == 1) did -c alarm 15
  4007. }
  4008. On *:dialog:alarm:sclick:2:{
  4009.   if ($did(alarm,2).state == 1) did -b alarm 18
  4010.   did -e alarm 1
  4011. }
  4012. On *:dialog:alarm:sclick:17:{
  4013.   if ($did(alarm,17).state == 1) did -b alarm 1
  4014.   did -e alarm 18
  4015. }
  4016. On *:dialog:alarm:sclick:13:{
  4017.   if ($sfile(*.wav;*.mp3,Choose sound file)) {
  4018.     did -ar alarm 5 $ifmatch
  4019.     w_ncfg alarm_sound $ifmatch
  4020.   }
  4021. }
  4022. On *:dialog:alarm:sclick:14:{
  4023.   if ($sfile(*.exe;*.com;*.lnk,Choose program)) {
  4024.     did -ar alarm 12 $ifmatch
  4025.     w_ncfg alarm_program $ifmatch
  4026.   }
  4027. }
  4028. On *:dialog:alarm:sclick:6:{
  4029.   if ($did(alarm,2).state == 1) && (?:? iswm $did(alarm,1).text) {
  4030.     var %alarm = $remove($did(alarm,1).text,:)
  4031.     if ($len(%alarm) == 3) var %alarm = 0 $+ %alarm
  4032.     if ($mid(%alarm,1,2) !isnum 0-23) || ($mid(%alarm,3,2) !isnum 0-59) {
  4033.       echo $color(info) -atg $kl:(Alarm) invalid time
  4034.       return
  4035.     }
  4036.   }
  4037.   if ($did(alarm,17).state == 1) {
  4038.     if ($did(alarm,18).text !isnum) {
  4039.       echo $color(info) -atg $kl:(Alarm) invalid time
  4040.       return
  4041.     }
  4042.   }
  4043.   unset %alarm.*
  4044.   if ($did(alarm,3).state == 1) {
  4045.     set %alarm.beep 1
  4046.     w_ncfg alarm_type beep
  4047.   }
  4048.   elseif ($did(alarm,4).state == 1) {
  4049.     if ($isfile($did(alarm,5))) {
  4050.       set %alarm.sound $did(alarm,5)
  4051.       w_ncfg alarm_type sound
  4052.     }
  4053.     else {
  4054.       .echo -qg $n.input($did(alarm,5) does not exist.,info)
  4055.       halt
  4056.     }
  4057.   }
  4058.   if ($did(alarm,11).state == 1) {
  4059.     if ($isfile($did(alarm,12))) set %alarm.program $did(alarm,12)
  4060.     else {
  4061.       .echo -qg $n.input($did(alarm,12) does not exist.,info)
  4062.       halt
  4063.     }
  4064.     set %alarm.program.on 1
  4065.   }
  4066.   else unset %alarm.program.on
  4067.   if ($did(alarm,15).state == 1) {
  4068.     set %alarm.message 1
  4069.     w_ncfg alarm_message $did(alarm,16).text
  4070.   }
  4071.  
  4072.   if ($did(alarm,2).state == 1) {
  4073.     .timeralarm -oi $did(alarm,1).text 1 0 n.alarm_action
  4074.     echo $color(info) -st $npre Alarm set at $did(alarm,1).text $iif(%alarm.message == 1,$par($ncfg(alarm_message)))  
  4075.   }
  4076.   else {
  4077.     .timeralarm -o 1 $calc($did(alarm,18).text *60) n.alarm_action
  4078.     echo $color(info) -st $npre Alarm set at $did(alarm,18).text minute(s) $iif(%alarm.message == 1,$par($ncfg(alarm_message)))  
  4079.   }
  4080. }
  4081. On *:dialog:alarm:sclick:7:{
  4082.   did -e alarm 1,2,3,4,5,6,11,12,13,14,15,16,17
  4083.   did -c alarm 2
  4084.   did -u alarm 17
  4085.   .timeralarm off
  4086.   splay stop
  4087. }
  4088. dialog gl {
  4089.   title "Game launcher (F10) (/g-join)"
  4090.   size -1 -1 218 44
  4091.   option dbu
  4092.   icon nbs.ico
  4093.   combo 1, 25 3 122 100, edit drop
  4094.   check "Minimize mIRC", 33, 8 32 46 9,
  4095.   check "Pause Winamp", 34, 57 32 49 9,
  4096.   button "Connect", 13, 109 32 35 11, ok
  4097.   button "Rcon (cs)", 39, 145 32 35 11
  4098.   button "Close", 14, 181 32 35 11, cancel
  4099.   combo 2, 25 16 129 100, drop
  4100.   button "Reload", 3, 156 16 30 11
  4101.   button "Edit", 17, 187 16 29 11
  4102.   text "Address:", 8, 2 5 22 8
  4103.   text "Pass:", 46, 151 5 13 8
  4104.   text "Game:", 15, 2 18 17 8
  4105.   edit "", 4, 165 3 50 11
  4106. }
  4107. On *:dialog:gl:init:0:{
  4108.   n.gl.updategames
  4109.   if (%hlip) did -a gl 1 $ifmatch
  4110.   if ($lines(config\hl-servers.txt) > 0) loadbuf -o gl 1 config\hl-servers.txt
  4111.   if (%n.gl.lastpw) did -a gl 4 $ifmatch
  4112.   did -c gl 1 1
  4113.   n.ds cr 33 csminmirc
  4114.   n.ds cr 34 gl_pausewinamp
  4115. }
  4116. On *:dialog:gl:sclick:17:run config\games.txt
  4117. On *:dialog:gl:sclick:39:{
  4118.   unset %rcon.*
  4119.   var %gl.tmp = $gettok($gettok($did(gl,1).text,1,32),1,58)
  4120.   if ($gettok(%gl.tmp,1,46) isnum 1-255) set %rcon.ip %gl.tmp
  4121.   else {
  4122.     .echo -qg $n.input(Error: enter ip:port (eg: 83.126.53.32:27015) Hostnames are not supported.,info)
  4123.     return
  4124.   }
  4125.   var %gl.tmp2 = $gettok($gettok($did(gl,1).text,1,32),2,58)
  4126.   if (%gl.tmp2 isnum) set %rcon.port %gl.tmp2
  4127.   else {
  4128.     .echo -qg $n.input(Error: please enter port (eg :27015),info)
  4129.     return
  4130.   }
  4131.   rcon_win
  4132. }
  4133. On *:dialog:gl:sclick:13:{
  4134.   if ($did(gl,2)) set %currgame $ifmatch
  4135.   else {
  4136.     .echo -qg $n.input(Error: no game specified.,info)
  4137.     return
  4138.   }
  4139.   if ($did(gl,1)) n.history config\hl-servers.txt $ifmatch
  4140.   if ($did(gl,4)) set %n.gl.lastpw $ifmatch
  4141.   else unset %n.gl.lastpw
  4142.   if ($did(gl,2)) run -p $replace($gettok($ifmatch,2,124),[adr],$gettok($did(gl,1),1,32),[pass],$did(gl,4))
  4143.   if ($did(gl,34).state == 1) { dll scripts\dll\winamp.dll playpause | w_ncfg gl_pausewinamp 1 }
  4144.   else w_ncfg gl_pausewinamp o
  4145.   if ($did(gl,33).state == 1) { w_ncfg csminmirc 1 | showmirc -m }
  4146.   else w_ncfg csminmirc o
  4147.   unset %hlip
  4148. }
  4149.  
  4150. On *:dialog:gl:sclick:3:n.gl.updategames
  4151. On *:dialog:gl:sclick:14:{
  4152.   n.ds cw 34 gl_pausewinamp
  4153.   n.ds cw 33 csminmirc
  4154.   unset %hlip
  4155. }
  4156. alias -l n.gl.updategames {
  4157.   did -r gl 2
  4158.   did -a gl 2 - Current:
  4159.   did -a gl 2 %currgame
  4160.   did -a gl 2 - Available:
  4161.   if ($lines(config\games.txt) > 0) loadbuf -o gl 2 config\games.txt
  4162.   did -c gl 2 2
  4163. }
  4164.  
  4165. on *:udpread:hl:{
  4166.   while ($sockerr == 0) {
  4167.     var %hl
  4168.     sockread -f %hl
  4169.     if ($gettok(%hl,4,92)) var %hlk %hl
  4170.     if ($sockbr == 0) {
  4171.       wigl namn $gettok(%hlk,20,92)
  4172.       wigl spelare $gettok(%hlk,6,92) $+ / $+ $gettok(%hlk,12,92)
  4173.       wigl game $gettok(%hlk,16,92)
  4174.       wigl map $gettok(%hlk,22,92)
  4175.       wigl hlpass $gettok(%hlk,26,92)
  4176.       wigl ip $gettok(%hlk,4,92)
  4177.       wigl vac $gettok(%hlk,29,92)
  4178.       wigl typ $replace($gettok(%hlk,24,92),d,dedi,l,listen)
  4179.       wigl ping $calc($ticks - %hl.start)
  4180.       sockclose hl
  4181.       return
  4182.     }
  4183.   }
  4184. }
  4185.  
  4186. ; events etc
  4187.  
  4188. on ^*:CHAT:*:{
  4189.   if ($1 == ACTION) { echo $color(action) -t =$nick * $nick $left($2-,-1) }
  4190.   else echo $color(normal) -mtbf =$nick $replace($nick.style,<mode>,,<nick>,$nick) $+  $1-
  4191.   if ($ncfg(privpip) == 1) && ($ncfg(query_sound_onopen) != 1) && (!%tmp.query.sound.block) var %x = 1
  4192.   if ($active != =$nick) {
  4193.     if (%x == 1) $ncfg(privljud)
  4194.     set -u3 %tmp.query.sound.block 1
  4195.   }
  4196.   elseif (!$appactive) {
  4197.     if (%x == 1) $ncfg(privljud)
  4198.     set -u3 %tmp.query.sound.block 1
  4199.   }
  4200.   haltdef
  4201. }
  4202. on ^*:TEXT:*:#:{
  4203.   if ($halted) return
  4204.   haltdef
  4205.   if ($hget(nbs,win_ashow) == 1) window -w $chan
  4206.   hadd -m temp ci. [ $+ [ $cid ] $+ ] . [ $+ [ $chan ] ] $ticks
  4207.   hadd -m temp text $color(normal) -mtlbfi4 # $replace($nick.style,<mode>,$cmode($nick,$chan,o),<nick>,$nick) $+  $1-
  4208.   ;if ($me isin $1-) {
  4209.   if ($wildtok($1-,$me $+ *,0,32) != 0) {
  4210.     if ($hget(nbs,nickbar) == 1) echo $color(normal) -mtlbfi4 # $replace($nick.style,<mode>,$cmode($nick,$chan,o),<nick>, $+ $hget(nbs,highlight_nick_color) $+ $nick $+ ) $+  $1-
  4211.     else echo $hget(temp,text)
  4212.     n.highlight $1-
  4213.     if ($away && !%n.away. [ $+ [ $nick ] ]) && ($ncfg(awaynotice) != 1) {
  4214.       .notice $nick I'm away: $awaymsg
  4215.       set -u99999 %n.away. $+ $nick 1
  4216.     }
  4217.   }
  4218.   else echo $hget(temp,text)
  4219.   if ($hget(nbs,mp3serv) == 1) && ($hget(nbs,mp3getcmd) isin $1-) n.servemp3 $nick
  4220.   if ($chr(1) $+ # isin $hget(prot,chans)) && ($me isop #) || ($me ishop #) {
  4221.     if (($nick isop #) || ($nick ishop #)) && (!$hget(prot,$+(#,punishops))) return
  4222.     if ($hget(prot,$+(#,caps)) == 1) n.capss # $nick $1-
  4223.     if ($hget(prot,$+(#,repeat)) == 1) n.repeats # $nick $1-
  4224.     if ($hget(prot,$+(#,flood)) == 1) n.floods # $nick $1-
  4225.     if ($hget(prot,$+(#,advertising)) == 1) n.spams # $nick $1-
  4226.   }
  4227. }
  4228. on ^*:action:*:#:{
  4229.   if ($me isin $1-) {
  4230.     if ($ncfg(nickpip) == 1) && ((!%tmp.nbf) || (%tmp.nbf < 2)) {
  4231.       splay $qt($mircdirscripts\beep.wav)
  4232.       inc -u10 %tmp.nbf
  4233.     }
  4234.     if ($hget(nbs,popup_nick) == 1) n.ptext # $chr(1) Highlighted in # $chr(1) * $cmode($nick,$chan) $eval($strip($1-),1)
  4235.   }
  4236.   if ($chr(1) $+ # isin $hget(prot,chans)) && ($me isop #) || ($me ishop #) {
  4237.     if (($nick isop #) || ($nick ishop #)) && (!$hget(prot,$+(#,punishops))) return
  4238.     if ($hget(prot,$+(#,caps)) == 1) n.capss # $nick $1-
  4239.     if ($hget(prot,$+(#,repeat)) == 1) n.repeats # $nick $1-
  4240.     if ($hget(prot,$+(#,flood)) == 1) n.floods # $nick $1-
  4241.     if ($hget(prot,$+(#,advertising)) == 1) n.spams # $nick $1-
  4242.   }
  4243. }
  4244. on ^*:TEXT:*:?:{
  4245.   if ($halted) return
  4246.   haltdef
  4247.   if ($nick == -psyBNC) {  
  4248.     if ($window(-psyBNC).state != hidden) window -h -psyBNC    
  4249.     n.bnc psyBNC
  4250.     echo -tmi4 $bncwin(psyBNC,$cid) ‹- $1-
  4251.   }
  4252.   elseif ($nick == -sBNC) {  
  4253.     if ($window(-sBNC).state != hidden) window -h -sBNC    
  4254.     n.bnc sBNC
  4255.     echo -tmi4 $bncwin(sBNC,$cid) ‹- $1-
  4256.     if ($ncfg(sbnc_autoread) == 1) {
  4257.       if ($1-4 == You have new messages.) {
  4258.         set %sbnc. [ $+ [ $cid ] $+ ] .msglog 1
  4259.         .!msg -sbnc read
  4260.       }
  4261.       elseif ($1-4 == End of LOG. Use) {
  4262.         unset %sbnc. [ $+ [ $cid ] $+ ] .*
  4263.         .!msg -sbnc erase
  4264.       }
  4265.       elseif (%sbnc. [ $+ [ $cid ] $+ ] .msglog == 1) && ($numtok($1-,58) > 2) {
  4266.         var %nick = $gettok($gettok($1-,2,58),1,32)
  4267.         if (@ !isin %nick) && (%nick !isnum) {
  4268.           if (!$window(%nick)) query %nick
  4269.           set %sbnc. [ $+ [ $cid ] $+ ] .host1. [ $+ [ %nick ] ] $mid($gettok($gettok($1-,2,58),2,32),2,-1)
  4270.           if (%sbnc. [ $+ [ $cid ] $+ ] .host1. [ $+ [ %nick ] ] != %sbnc. [ $+ [ $cid ] $+ ] .host2. [ $+ [ %nick ] ]) echo $color(info) -ti4 %nick $pre Offline messages from $gettok($gettok($1-,2,58),1,32) $par($mid($gettok($gettok($1-,2,58),2,32),2,-1)) $+ :
  4271.           set %sbnc. [ $+ [ $cid ] $+ ] .host2. [ $+ [ %nick ] ] %sbnc. [ $+ [ $cid ] $+ ] .host1. [ $+ [ %nick ] ]
  4272.           if ($gettok($gettok($1-,3,58),1,32) == ++c) {
  4273.             var %cryptmsg = $gettok($gettok($1-,3-,58),2-,32), %crypthost = *!* $+ $remove($mid($gettok($gettok($1-,2,58),2,32),2,-1),~)
  4274.             var %msg = (c) $n.crypt(%cryptmsg,d,%nick,%crypthost)
  4275.           }
  4276.           else var %msg = $gettok($1-,3-,58)
  4277.           echo $color(normal) -mi4 %nick $gettok($1-,1,58) $event.msg(%nick,%nick,%msg)
  4278.         }
  4279.       }
  4280.     }
  4281.   }
  4282.   else {
  4283.     echo $color(normal) -mtlbfi4 $nick $replace($nick.style,<mode>,,<nick>,$nick) $+  $1-
  4284.     if ($hget(nbs,mp3serv) == 1) && ($hget(nbs,mp3getcmd) isin $1-) n.servemp3 $nick
  4285.     if ($hget(nbs,privpip) == 1) && ($hget(nbs,query_sound_onopen) != 1) && (!%tmp.query.sound.block) var %x = 1
  4286.     if (!$appactive) fasttitle $nick $+ : $eval($1-,1)
  4287.     if ($active != $nick) {
  4288.       if (%x == 1) $hget(nbs,privljud)
  4289.       set -u3 %tmp.query.sound.block 1
  4290.     }
  4291.     elseif (!$appactive) {
  4292.       if (%x == 1) $ncfg(privljud)
  4293.       set -u3 %tmp.query.sound.block 1
  4294.     }
  4295.     if ($hget(nbs,popup_query) == 1) && ($hget(nbs,popup_query_always) == 1) {
  4296.       if ($appactive) && ($active != $nick) var %x = 1
  4297.       elseif (!$appactive) var %x = 1
  4298.       if (%x == 1) n.ptext $nick $chr(1) msg from $nick $chr(1) $replace($nick.style,<mode>,$null,<nick>,$nick)  $+ $eval($1-,1)
  4299.     }
  4300.   }
  4301. }
  4302. on *:OPEN:?:*:{
  4303.   if ($halted) return
  4304.   if ($nick == -psyBNC) n.bnc psyBNC
  4305.   elseif ($nick == -sBNC) n.bnc sBNC
  4306.   else {
  4307.     n.query.stats $nick $address
  4308.     if ($ncfg(privpip) == 1) && ($ncfg(query_sound_onopen == 1)) $ncfg(privljud)
  4309.     if ($n.bluser($fulladdress)) echo $color(info) -t $nick $npre User is blacklisted $par($gettok(%bltmp,2-,44)))
  4310.     if ($hget(nbs,popup_query) == 1) && ($ncfg(popup_query_always) != 1) n.ptext $nick $chr(1) msg from $nick $chr(1) $replace($nick.style,<mode>,$null,<nick>,$nick)  $+ $eval($1-,1)
  4311.   }
  4312. }
  4313. on ^*:RAWMODE:#:{
  4314.   if ($halted) return
  4315.   haltdef
  4316.   if ($1 == +b) || ($1 == -o+b) {
  4317.     if ($me isop #) || ($me ishop #) {
  4318.       var %o = 1
  4319.       set -u900 %banmode -b | set -u900 %banchan # | set -u900 %banmask $iif($1 == -o+b,$3,$2)
  4320.     }
  4321.     echo $color(mode) -ti4 # $npre $+  $nick $par($replace($1,+b,4+b)) $2- $iif(%o == 1,$par(F6: unban))
  4322.   }
  4323.   elseif ($1 == -b) {
  4324.     if ($me isop #) || ($me ishop #) {
  4325.       var %o = 1
  4326.       set -u900 %banmode +b | set -u900 %banchan # | set -u900 %banmask $2
  4327.     }
  4328.     echo $color(mode) -ti4 # $npre $+  $nick $par(4 $+ $1) $2- $iif(%o == 1,$par(F6: ban))
  4329.   }
  4330.   else $iif($hget(netsplit, [ [ $cid ] $+ ] . [ $+ [ $2 ] ]),.timer -m 1 1900) echo $color(mode) -ti4 # $npre $+  $nick $par($1) $iif($2,$2-,#)
  4331.   if ($me isin $2) && ($hget(nbs,popup_other) == 1) n.ptext # $chr(1) Channel mode: # $chr(1) $npre $+  $nick $par($1) $replace($2-,$me, $+ $me $+ ) $iif($cid != $activecid,$par($network))
  4332. }
  4333. on ^*:DEOP:#:{
  4334.   if ($opnick == $me) {
  4335.     if ($active != $chan) && (!%n.connecting. [ $+ [ $cid ] ]) echo $color(mode) -atg $npre $+  info: -o in $chan by $nick $iif($cid != $activecid,$par($network))
  4336.   }
  4337. }
  4338. on ^*:OP:#:{
  4339.   if ($opnick == $me) {
  4340.     if ($active != $chan) && (!%n.connecting. [ $+ [ $cid ] ]) echo $color(mode) -atg $npre $+  info: +o in $chan by $nick $iif($cid != $activecid,$par($network))
  4341.     if ($hget(nbs,blacklist) == 1) .timer 1 1 n.blscan #
  4342.     .timer 1 10 n.checkkey #
  4343.   }
  4344. }
  4345. on ^*:SERVEROP:#:if ($opnick == $me) && ($hget(nbs,blacklist) == 1) .timer 1 2 n.blscan #
  4346. on ^*:VOICE:#:{
  4347.   if ($vnick == $me) && ($active != $chan) && (!%n.connecting. [ $+ [ $cid ] ]) echo $color(mode) -atg $npre $+  info: +v in $chan by $nick $iif($cid != $activecid,$par($network))
  4348. }
  4349. on ^*:DEVOICE:#:{
  4350.   if ($vnick == $me) && ($active != $chan) && (!%n.connecting. [ $+ [ $cid ] ]) echo $color(mode) -atg $npre $+  info: -v in $chan by $nick $iif($cid != $activecid,$par($network))
  4351. }
  4352. on ^*:HELP:#:{
  4353.   if ($hnick == $me) {
  4354.     if ($active != $chan) && (!%n.connecting. [ $+ [ $cid ] ]) echo $color(mode) -atg $npre $+  info: +h in $chan by $nick $iif($cid != $activecid,$par($network))
  4355.     if ($hget(nbs,blacklist) == 1) n.blscan #  
  4356.   }
  4357. }
  4358. on ^*:DEHELP:#:{
  4359.   if ($hnick == $me) {
  4360.     if ($active != $chan) && (!%n.connecting. [ $+ [ $cid ] ]) echo $color(mode) -atg $npre $+  info: -h in $chan by $nick $iif($cid != $activecid,$par($network))
  4361.   }
  4362. }
  4363. on *:CTCPREPLY:*:{
  4364.   n.echo ctcp -at $kl:(CTCP $1 reply from $nick) $iif($1 == ping,reply took $calc(($ticks - %ctcp.ping.ticks)/1000) $+ s,$2-)
  4365.   unset %ctcp.ping.ticks
  4366.   haltdef
  4367. }
  4368. on ^*:USERMODE:{
  4369.   echo $color(mode) -ste $npre $+  $nick sets mode: $1-
  4370.   haltdef
  4371. }
  4372. alias amsg {
  4373.   if ($chan(0) == 0) { echo $color(info) -at $npre /amsg: you're not on a channel | return }
  4374.   if (!$1) { echo $color(info) -at $npre /amsg: insufficient parameters | return }
  4375.   .!amsg $1-
  4376.   var %i = 1, %t = $chan(0)
  4377.   while (%i <= %t) {
  4378.     echo $color(own) -qmnt $chan(%i) $replace($me.style,<mode>,$cmode($me,$chan(%i),o),<nick>,$me) $+  $1-
  4379.     inc %i 1
  4380.   }
  4381. }
  4382. alias amsg2 {
  4383.   if (!$1) {
  4384.     echo $color(info) -atg $npre /amsg2: lets you exclude channels from 'amsg'
  4385.     echo $color(info) -atg $npre Usage: /amsg2 setlist to view ignored channels, /amsg2 setlist <channels> to set ignored channels $par(seperated with space) $+ , /amsg2 message
  4386.   }
  4387.   elseif ($1 == setlist) && ($2) {
  4388.     w_ncfg amsg_ignore $2-
  4389.     n.echo info -atg Channels to not msg: $2- $par($numtok($2-,32))
  4390.   }
  4391.   elseif ($1 == setlist) && (!$2) echo $color(info) -atg $npre Current channels to ignore: $iif($ncfg(amsg_ignore),$ifmatch $par($numtok($ifmatch,32)),none)
  4392.   else {
  4393.     var %i = 1, %t = $chan(0), %amsg.ignore = $ncfg(amsg_ignore), %amsg.chans
  4394.     while (%i <= %t) {
  4395.       if (!$istok(%amsg.ignore,$chan(%i),32)) {
  4396.         var %amsg.chans = $addtok(%amsg.chans,$chan(%i),44)
  4397.         echo $color(own) -qmnt $chan(%i) $replace($me.style,<mode>,$cmode($me,$chan(%i),o),<nick>,$me) $+  $1-
  4398.       }
  4399.       inc %i 1
  4400.     }
  4401.     .raw PRIVMSG %amsg.chans : $+ $1-
  4402.   }
  4403. }
  4404. on *:filercvd:*:{
  4405.   if ($hget(nbs,popup_dcc) == 1) && ($file(" $filename ").size > 1048576) n.ptext "get $nick $nopath($filename) "  $chr(1) DCC Get finished $chr(1) $npre Get of $nopath($filename) from $nick finished.
  4406. }
  4407. on *:getfail:*:{
  4408.   if ($hget(nbs,popup_dcc) == 1) n.ptext "get $nick $nopath($filename) " $chr(1) DCC Get failed $chr(1) $npre Failed to get $nopath($filename) from $nick
  4409. }
  4410. alias notice {
  4411.   if ($isid) return
  4412.   if ($2) {
  4413.     echo $color(notice) -atgq $pre $kl:(notice: $1) $2-
  4414.     !.notice $1-
  4415.   }
  4416.   else n.echo info -atg usage: /notice nick message
  4417. }
  4418. alias ctcp {
  4419.   if ($isid) return
  4420.   if ($2 == ping) set %ctcp.ping.ticks $ticks
  4421.   n.echo ctcp -atgq $kl:(CTCP to $1) $upper($2)) $3-
  4422.   !.ctcp $1-
  4423. }
  4424. alias dcc {
  4425.   if ($isid) return
  4426.   .write $cit($logdir $+ -dcc.log) $date $time - Send to $2 $+ : $3- ( $+ $round($calc($file($3).size /1024/1024),2) MB)
  4427.   !dcc $1-
  4428. }
  4429. alias msg {
  4430.   if ($isid) || ($0 < 2) return
  4431.   if (!$window($1)) echo -atqg $npre $kl:(msg: $1) $2-
  4432.   else echo $color(own) -qnmti4 $1 $replace($me.style,<mode>,$cmode($me,$1,o),<nick>,$me) $+  $2-
  4433.   !.msg $1-
  4434. }
  4435. alias pastemsg {
  4436.   if ($isid) || ($0 < 2) return
  4437.   else echo $color(own) -nmti4 $1 $replace($me.style,<mode>,$cmode($me,$1,o),<nick>,$me) $+  $2-
  4438.   !.msg $1-
  4439. }
  4440. alias say {
  4441.   if ($active === Status Window) { n.echo info -atg Error: can't use command here }
  4442.   else msg $active $1-
  4443. }
  4444. on *:INPUT:*:{
  4445.   if ($active === Status Window) || ($left($1,1) == /) && (!$ctrlenter) return
  4446.   if ($left($target,1) == @) && ($window($target)) return
  4447.   if ($target ischan) {
  4448.     hadd -m temp ci. [ $+ [ $cid ] $+ ] . [ $+ [ $chan ] ] $ticks
  4449.     if ($window($chan).state == hidden) window -w $chan
  4450.   }
  4451.   if ($inpaste) && ($left($target,1) != =) {
  4452.     if ($cb(0) > 1) {
  4453.       set %paste.target $target
  4454.       if (!%tmp.paste) dlg paste
  4455.       set -u1 %tmp.paste 1
  4456.     }
  4457.     else editbox -a $1-
  4458.   }
  4459.   elseif (!$halted) msg $target $1-
  4460.   haltdef
  4461. }
  4462. on ^*:JOIN:#:{
  4463.   haltdef
  4464.   if ($nick == $me) {
  4465.     hadd -m temp ci. [ $+ [ $cid ] $+ ] . [ $+ [ $chan ] ] $ticks
  4466.     .timer 1 9 topicchan #
  4467.     set -u7 % [ $+ [ # ] $+ ] .disabled 1
  4468.     return
  4469.   }
  4470.   if ($query($nick)) && ($comchan($nick,0) == 1) {
  4471.     if ($ncfg(query_show_online) == 1) echo $color(join) -t $nick $npre Online $par(joined $chan)
  4472.   }
  4473.   if ($hget(nbs,blacklist) == 1) {
  4474.     if ($hget(nbs,blacklist_custom_channels) != 1) || ($istok($hget(nbs,blacklist_channels),$chan,32)) {
  4475.       if ($me isop #) || ($me ishop #) {
  4476.         if ($n.bluser($address($nick,5)) == 1) !raw -q mode # +b $gettok(%bltmp,1,44) $+ $crlf $+ KICK # $nick : $+ $gettok(%bltmp,2-,44)
  4477.       }
  4478.     }
  4479.   }
  4480.   if (!$ehide(joins,#)) {
  4481.     if ($hget(netsplit, [ [ $cid ] $+ ] . [ $+ [ $nick ] ])) {
  4482.       hinc -m temp netsplit.tj. [ $+ [ $cid ] $+ ] . [ $+ [ # ] ]
  4483.       if ($hget(temp,netsplit.join.f. [ $+ [ $cid ] $+ ] . [ $+ [ # ] ]) != 1) {
  4484.         if ($len($hget(temp,netsplit.join. [ $+ [ $cid ] $+ ] . [ $+ [ # ] ]) $nick) < 500) hadd -m temp netsplit.join. [ $+ [ $cid ] $+ ] . [ $+ [ # ] ] $hget(temp,netsplit.join. [ $+ [ $cid ] $+ ] . [ $+ [ # ] ]) $nick $+ $chr(44)
  4485.         else hadd temp netsplit.join.f. [ $+ [ $cid ] $+ ] . [ $+ [ # ] ] 1
  4486.       }
  4487.       .timer 1 4 hdel netsplit [ [ $cid ] $+ ] . [ $+ [ $nick ] ]
  4488.     }
  4489.     if ($hget(temp,netsplit.tj. [ $+ [ $cid ] $+ ] . [ $+ [ # ] ])) .timernetsplitjoin [ $+ [ # ] ] 1 1 n.netsplitjoin #
  4490.     else {
  4491.       if ($ialchan($wildsite,#,0) > 1) {
  4492.         if ($ialchan($wildsite,#,0) < 9) {
  4493.           var %i = 1, %x
  4494.           while (%i <= $ialchan($wildsite,#,0)) {
  4495.             if ($nick != $ialchan($wildsite,#,%i).nick) var %x = %x $cmode($ialchan($wildsite,#,%i).nick,#) $+ $chr(44)
  4496.             inc %i
  4497.           }
  4498.           var %jklon = $par(clones with: $left(%x,-1) $iif(%i > 3,( $+ $calc(%i -2) $+ )))
  4499.         }
  4500.         else var %jklon = $par($calc($ialchan($wildsite,#,0) -1) clones)
  4501.       }
  4502.       echo $color(join) -ti4 $chan $npre Join: $nick $par($address) %jklon
  4503.     }
  4504.   }
  4505. }
  4506. on ^*:PART:#:{
  4507.   haltdef
  4508.   if ($nick == $me) {
  4509.     hdel nbs ci. [ $+ [ $cid ] $+ ] . [ $+ [ $chan ] ]
  4510.     n.echo join -t # parting channel $par($1-)
  4511.     echo #   
  4512.     return
  4513.   }
  4514.   if (!$ehide(parts,#)) echo $color(part) -ti4 $chan $npre Part: $cmode($nick,#) $par($address) $par($1-)
  4515. }
  4516. on *:DNS:{
  4517.   haltdef  
  4518.   if (!$raddress) {
  4519.     echo $color(info) -atgq $npre Unable to resolve $n.quote($dns(0).ip)
  4520.     set %tmp.dnsresult $dns(0).ip
  4521.   }
  4522.   elseif ($dns(0) > 1) {
  4523.     var %i = 1
  4524.     set %tmp.dnsresult $dns(%i)
  4525.     while (%i <= $dns(0)) {
  4526.       echo $color(info) -tagq $npre Result %i $+ : $dns(%i).ip  $+ $par($dns(%i))
  4527.       inc %i
  4528.     }
  4529.   }
  4530.   else {
  4531.     set %tmp.dnsresult $raddress
  4532.     echo $color(info) -tagq $npre Result: $raddress  $+ $par(  $iif($naddress == $raddress,$dns(0).ip,$naddress)) $+ , Ctrl+F2: copy to clipboard
  4533.   }
  4534.   if (%tmp.i2n == 1) {
  4535.     host2nick %tmp.dnsresult
  4536.     unset %tmp.i2n
  4537.   }
  4538. }
  4539. on ^*:KICK:#:{
  4540.   haltdef
  4541.   echo $color(kick) -ti4 $chan $npre  $+ $cmode($knick,#) was 4kicked by $nick $par($1-)
  4542.   if ($knick == $me) {
  4543.     echo $color(info) -ste $npre kicked from $chan by $cmode($nick,#) $par($address) $par($1-) $iif($ncfg(autorejoin) == 1 && $nick != $me,rejoining in $ncfg(ar_time) $+ s $+ $chr(44) $par(Cancel with Ctrl+F5))
  4544.     if ($active != $chan) && ($active != Status Window) echo $color(mode) -atg $npre info: kicked from $chan by $nick $par($1-) $iif($cid != $activecid,$par($network))    
  4545.     if ($ncfg(autorejoin) == 1) && ($ncfg(ar_time) isnum) && ($nick != $me) .timer [ $+ [ # ] ] 1 [ $ncfg(ar_time) ] n.rejoin # $chankey(#)
  4546.     set -u [ $+ [ $ncfg(ar_time) ] ] %rejointimer #
  4547.     if ($hget(nbs,popup_other) == 1) n.ptext - $chr(1) Kicked $chr(1) $npre kicked from $chan by $cmode($nick,#) $par($1-)
  4548.     if ($hget(nbs,whois_on_kick) == 1) {
  4549.       set -u10 %whois.window.passive 1
  4550.       whois $nick
  4551.     }      
  4552.   }
  4553. }
  4554. on ^*:BAN:# {
  4555.   haltdef
  4556.   if ($me isop #) && ($hget(nbs,banskydd) == 1) && ($banmask iswm $address($me,5)) && ($nick != $me) {
  4557.     !raw -q mode # -ob $nick $banmask $+ $crlf $+ KICK # $nick : $+ $hget(nbs,bsmed)
  4558.   }
  4559. }
  4560.  
  4561. on ^*:QUIT:{
  4562.   haltdef  
  4563.   if ($query($nick)) echo $color(quit) -t $nick $npre Quit $par($1-)
  4564.   var %i = 1
  4565.   while (%i <= $comchan($nick,0)) {
  4566.     if (!$ehide(quits,$comchan($nick,%i))) {
  4567.       if (!$3) && (quit !isin $1) && (. isin $1) && (. isin $2) {
  4568.         if (!$hget(netsplit)) hmake netsplit 30
  4569.         hadd -u1800 netsplit [ [ $cid ] $+ ] . [ $+ [ $nick ] ] 1
  4570.         hinc -m temp netsplit.tq. [ $+ [ $cid ] $+ ] . [ $+ [ $comchan($nick,%i) ] ]
  4571.         if ($hget(temp,netsplit.quit.f. [ $+ [ $cid ] $+ ] . [ $+ [ $comchan($nick,%i) ] ]) != 1) {
  4572.           if ($len($hget(temp,netsplit.quit. [ $+ [ $cid ] $+ ] . [ $+ [ $comchan($nick,%i) ] ]) $nick) < 500) hadd -m temp netsplit.quit. [ $+ [ $cid ] $+ ] . [ $+ [ $comchan($nick,%i) ] ] $hget(temp,netsplit.quit. [ $+ [ $cid ] $+ ] . [ $+ [ $comchan($nick,%i) ] ]) $nick $+ $chr(44)
  4573.           else hadd temp netsplit.quit.f. [ $+ [ $cid ] $+ ] . [ $+ [ $comchan($nick,%i) ] ] 1
  4574.         }
  4575.         .timersnetsplitquit 1 1 n.netsplitquit $1-
  4576.       }
  4577.       else n.echo quit -ti4 $comchan($nick,%i) Quit: $cmode($nick,$comchan($nick,%i)) $par($address) $par($1-)
  4578.     }
  4579.     inc %i
  4580.   }
  4581.   if ($hget(nbs,reclaim_nick) == 1) {
  4582.     if ($address($me,1) == $gettok($hget(temp,disconnect. [ $+ [ $cid ] ]),2,32)) && ($nick == $gettok($hget(temp,disconnect. [ $+ [ $cid ] ]),1,32)) nick $nick
  4583.   }
  4584. }
  4585.  
  4586. on ^*:TOPIC:#:{
  4587.   if ($1) {
  4588.     echo $color(topic) -ti4 $chan - $clr(info,$nick changes topic to:) $1-
  4589.     if (!$isdir($scriptdirtemp\topic)) mkdir $scriptdirtemp\topic
  4590.     .write -il1 $+(",$scriptdirtemp\topic\,$md5(#),â,$cid,") $1-
  4591.   }
  4592.   else echo $color(topic) -ti4 $chan $npre Topic removed by $nick
  4593.   haltdef
  4594. }
  4595. on ^*:INVITE:*:{
  4596.   haltdef
  4597.   if ($n.qnet) && ($ncfg(quakenet_bot_autojoin) == 1) && (($nick == q) || ($nick == l)) join $iif(autojoin_minimize == 1,-n) $chan
  4598.   elseif ($n.unet) && ($ncfg(undernet_bot_autojoin) == 1) && ($nick == x) join $iif(autojoin_minimize == 1,-n) $chan
  4599.   n.echo notice -atm $nick $par($address) invited you to $chan
  4600.   if ($hget(nbs,popup_other) == 1) n.ptext - $chr(1) Invite $chr(1) $bpre $nick invited you to $chan
  4601. }
  4602. on ^*:NICK:{
  4603.   haltdef
  4604.   if ($nick === $newnick) return
  4605.   if ($nick == $me) echo $color(nick) -st $npre Nick changed to: $newnick
  4606.   elseif ($query($newnick)) echo $color(nick) -t $newnick $npre $clr(highlight,$nick) is now known as $clr(highlight,$newnick)
  4607.   var %i = 1
  4608.   while (%i <= $comchan($newnick,0)) {
  4609.     if (!$ehide(nicks,$comchan($newnick,%i))) echo $color(nick) -t $comchan($newnick,%i) $npre $cmode($newnick,$comchan($newnick,%i),_) $+ $clr(highlight,$nick) is now known as $cmode($newnick,$comchan($newnick,%i),_) $+ $clr(highlight,$newnick)
  4610.     inc %i
  4611.   }
  4612. }
  4613. on *:EXIT:{
  4614.   scon -a clearall
  4615.   close -@
  4616.   cuptime
  4617. }
  4618.  
  4619. raw 366:*:{
  4620.   if (!$chan($2).ial) .timer 1 1 whochan $2
  4621.   set %jkanal $2
  4622.   set -u15 %ctcp.ignore $2
  4623.   if (%show.names == 1) {
  4624.     n.echo notice -sgm $clr(norm,$+(,$2,:)) $3-
  4625.     echo $color(info) -sg -
  4626.     window -g2 "status window"
  4627.     haltdef
  4628.   }
  4629.   else n.echo info -t $2 $n.chanstats($2)
  4630.   unset %show.names
  4631. }
  4632. raw 352:*:{
  4633.   if (%dns2nick.host) {
  4634.     inc %dns2nick.times
  4635.     if (%dns2nick.times == 1) set %dns2nick.users $6
  4636.     else set %dns2nick.users %dns2nick.users $+ , $6
  4637.     haltdef
  4638.   }
  4639.   if (%n.whosvar != 1) { haltdef }
  4640. }
  4641. raw 315:*:{
  4642.   if (%dns2nick.host) {
  4643.     if (!%dns2nick.times) echo $color(info) -atg $npre Couldn't find any user with that host
  4644.     elseif (%dns2nick.times == 1) echo $color(info) -atg $npre User found: %dns2nick.users
  4645.     else echo $color(info) -at $npre %dns2nick.times users found: %dns2nick.users
  4646.     unset %dns2nick*
  4647.     haltdef
  4648.   }
  4649.   if ($2 == %csial) clonescan $2
  4650.   if (%n.whosvar != 1) { haltdef }
  4651.   unset %csial %n.whosvar
  4652. }
  4653. raw 332:*:{
  4654.   haltdef  
  4655.   if ($2 ischan) echo $color(topic) -ti5 $2 - Topic: $3-
  4656.   else echo $color(topic) -atgi5 - Topic in $2 $+ : $3-
  4657. }
  4658. raw 333:*:{
  4659.   haltdef
  4660.   if ($2 ischan) echo $color(info) -ti4 $2 - Set by $clr(topic,$3) on $date($4, dd/mm/yyyy - HH:nn:ss) $par($dur($calc($ctime - $4),2) ago)
  4661.   else echo $color(info) -atgi4 - Set by $clr(topic,$3) on $date($4, dd/mm/yyyy - HH:nn:ss) $par($dur($calc($ctime - $4),2) ago)
  4662. }
  4663. raw 479:*:n.echo info -atg Unable to join $2 $par($3-) | haltdef
  4664. raw 406:*:n.echo info -atg $3- $par($2) | haltdef
  4665. raw 401:*:n.echo info -atg $3- $par($2) | haltdef
  4666. raw 403:*:n.echo info -atg $3- $par($2) | haltdef
  4667. raw 005:*:{
  4668.   if ($wildtok($1-,topiclen=*,1,32)) set %topiclen. [ $+ [ $cid ] ] $right($ifmatch,-9)
  4669.   if ($wildtok($1-,maxbans=*,1,32)) set %maxbans. [ $+ [ $cid ] ] $right($ifmatch,-8)
  4670.   cbinfo
  4671. }
  4672. raw 329:*:{
  4673.   if ($2 !isin %körv) {
  4674.     if ($calc($ctime - $3) > 60) n.echo info -t $2 Channel created: $date($3,HH:nn:ss - dd/mm/yyyy) $par($dur($calc($ctime - $3),2) ago)
  4675.     else n.echo info -t $2 Channel created
  4676.     set -u30 %körv %körv $2
  4677.   }
  4678. }
  4679. raw 331:*:{
  4680.   if ($me ison $2) echo $color(topic) -t $2 $npre No topic set
  4681.   else echo $color(topic) -atg $npre No topic set on $2
  4682.   haltdef
  4683. }
  4684. raw 001:*:cbinfo
  4685. raw 002:*:cbinfo
  4686. raw 003:*:cbinfo
  4687. raw 004:*:cbinfo
  4688. raw 251:*:cbinfo
  4689. raw 252:*:cbinfo
  4690. raw 253:*:cbinfo
  4691. raw 254:*:cbinfo
  4692. raw 255:*:cbinfo
  4693. raw 375:*:cbinfo
  4694. raw 376:*:cbinfo
  4695. raw 472:*:n.echo info -atg $n.quote($2) $3-
  4696. raw 477:*:n.echo info -atg Unable to join $2 $par($3-) | haltdef
  4697. raw 473:*:n.echo info -atg Unable to join $2 $par(invite only) | haltdef
  4698. raw 474:*:n.echo info -atg Unable to join $2 $par(you are banned) | haltdef
  4699. raw 404:*:n.echo info -atg $3- $par($2) | haltdef
  4700. raw 405:*:n.echo info -stge $2- | haltdef
  4701. raw 402:*:n.echo info -atg No such nick/server $par($2) | haltdef
  4702. raw 432:*:n.echo info -atg $3- $n.quote($2) | haltdef
  4703. raw 499:*:n.echo info -atg $3- $par($2)
  4704. raw 433:*:{
  4705.   haltdef
  4706.   n.echo info -atg Nickname $n.quote($2) is already in use
  4707.   if ($ncfg(nickserv_on) == 1) && ($ncfg(nickserv_ghost) == 1) .timer 1 3 nickserv_ghost
  4708. }
  4709. raw 467:*:echo $color(info) -tg $2 $npre $3- | haltdef
  4710. raw 438:*:echo $color(info) -atg $npre $3- | haltdef
  4711. raw 441:*:echo $color(info) -stge $npre $2- | haltdef
  4712. raw 396:*:echo $color(info) -stge $npre $clr(high,$2) $3- | haltdef
  4713. raw 442:*:n.echo info -atg You are not on that channel $par($2) | haltdef
  4714. raw 461:*:n.echo info -atg $3- $par($lower($2)) | haltdef
  4715. raw 471:*:n.echo info -atg Unable to join $2 $par(channel is full) | haltdef
  4716. raw 486:*:n.echo info -atg $3- $par($2) | haltdef
  4717. raw 475:*:n.echo info -atg Unable to join $2 $par(need correct key) | haltdef
  4718. raw 481:*:n.echo info -atg $2- | haltdef
  4719. raw 482:*:echo $color(info) -tg $2 $npre $2 $+ : $3- | haltdef
  4720. raw 478:*:n.echo info -atg $4- $par($3) | haltdef
  4721. raw 443:*:n.echo info -atg $2 is already on $3 | haltdef
  4722. raw 341:*:n.echo info -atg Invited $2 to $3 | haltdef
  4723. raw 305:*:{
  4724.   var %x = $2- $par($iif($awaytime,away for $dur($awaytime)))
  4725.   n.echo notice -stge %x
  4726.   if ($active != status window) n.echo notice -atg %x
  4727.   titleupdate
  4728.   haltdef
  4729. }
  4730. raw 306:*:{
  4731.   var %x = $2- $par($awaymsg)
  4732.   n.echo notice -stge %x
  4733.   if ($active != status window) n.echo notice -atg %x
  4734.   titleupdate
  4735.   haltdef
  4736. }
  4737. raw 311:*:{
  4738.   unset %w-*
  4739.   if (%whois.idle != 1) {
  4740.     if ($ncfg(whois) == @whois) {
  4741.       set %w-dest @whois ( $+ $cid $+ )
  4742.       if (!$window(%w-dest)) {
  4743.         if ($ncfg(whois_inside) == 1) {
  4744.           window -k0n %w-dest
  4745.           if ($appactive) && ($activecid == $cid) window -a %w-dest
  4746.         }
  4747.         else window -k0d $+ $iif(%whois.window.passive,n) %w-west 200 200 600 200
  4748.       }
  4749.       else {
  4750.         if ($ncfg(whois_inside) != 1) dline %w-dest 1
  4751.         if (%whois.idle != 1) window -g1 %w-dest
  4752.       }
  4753.     }
  4754.     else set %w-dest $ncfg(whois)
  4755.   }
  4756.   set %whois 1
  4757.   set %w-nick $2
  4758.   set %w-address echo $color(whois) %w-dest $chr(160) $+ › address: $3 $+ $clr(highlight,@) $+ $4
  4759.   set %w-name echo $color(whois) %w-dest $chr(160) $+ › name: $6-
  4760.   haltdef
  4761. }
  4762. raw 312:*:set %w-server echo $color(whois) %w-dest $chr(160) $+ › server: $3 $par($4-) | haltdef
  4763. raw 313:*:set %w-ircop echo $color(whois) %w-dest $chr(160) $+ › irc operator | haltdef
  4764. raw 301:*:{
  4765.   haltdef
  4766.   if (%whois == 1) set %w-away echo $color(whois) %w-dest $chr(160) $+ › away: $3-
  4767.   elseif (!%waway. [ $+ [ $2 ] ]) {
  4768.     echo $color(info) -tg $2 $npre $2 is away $par($3-)
  4769.     set -u3600 %waway. [ $+ [ $2 ] ] 1
  4770.   }
  4771. }
  4772. raw 317:*:{
  4773.   if ($calc($ctime - $4) > 1) var %s = $dur($ifmatch) ago
  4774.   set %w-time echo $color(whois) %w-dest $chr(160) $+ › idle: $dur($3) $+ , signed on: $date($4,HH:nn:ss - dd/mm/yyyy) $par(%s)
  4775.   if (%whois.idle) n.echo info -atg $2 has been idle for $dur($3)
  4776.   haltdef
  4777. }
  4778. raw 353:*:{
  4779.   if (%show.names == 1) {
  4780.     n.echo norm -gs $3 $+ : $replace($4-,@,$clr(notice,@),+,$clr(notice,+),%,$clr(notice,%),~,$clr(notice,~),&,$clr(notice,&))
  4781.     haltdef
  4782.   }
  4783. }
  4784. raw 330:*:if (%whois == 1) { set %w-auth echo $color(whois) %w-dest $chr(160) $+ › auth: $3 | haltdef } | else { haltdef }
  4785. raw 307:*:if (%whois == 1) { set %w-registered 1 | haltdef }
  4786. raw 338:*:{
  4787.   haltdef
  4788.   if (%whois == 1) {
  4789.     if ($n.qnet) { set %w-realip echo $color(whois) %w-dest $chr(160) $+ › user@host: $3 $par($4) }
  4790.     else set %w-realip echo $color(whois) %w-dest $chr(160) $+ › user@host: $3-
  4791.   }
  4792. }
  4793. raw 318:*:{
  4794.   if (%whois.idle != 1) {
  4795.     if (%w-name) echo $color(whois) %w-dest $chr(160)
  4796.     if (%w-nick) echo $color(high) %w-dest $kl(whois: %w-nick) $par($iif(%w-registered == 1,registered nick))
  4797.     if (%w-name) $ifmatch
  4798.     if (%w-address) $ifmatch
  4799.     if (%w-chans) $ifmatch
  4800.     if (%w-ircop) $ifmatch
  4801.     if (%w-auth) $ifmatch
  4802.     if (%w-realip) $ifmatch
  4803.     if (%w-away) $ifmatch
  4804.     var %i = 1
  4805.     while (%i <= %w-other-count) {
  4806.       echo $color(whois) %w-dest %w-other [ $+ [ %i ] ]
  4807.       inc %i
  4808.     }
  4809.     if (%w-server) $ifmatch
  4810.     if (%w-time) $ifmatch
  4811.     if (%whois == 1) {
  4812.       echo $color(high) %w-dest $kl(/whois: $time(HH:nn))
  4813.       echo $color(whois) %w-dest $chr(160)
  4814.     }
  4815.   }
  4816.   unset %whois* %w-*
  4817.   haltdef
  4818. }
  4819. raw 319:*:{
  4820.   var %c = $3-
  4821.   if ($2 != $me) {
  4822.     var %i = 1
  4823.     while (%i <= $comchan($2,0)) {
  4824.       var %x = $comchan($2,%i), %c = $reptok(%c,$cmode($2,%x,_) $+ %x,$cmode($2,%x,_) $+  $+ %x $+ ,1,32)
  4825.       inc %i
  4826.     }
  4827.   }
  4828.   set %w-chans echo $color(whois) %w-dest $chr(160) $+ › channels: %c $par($calc($0 - 2))
  4829.   haltdef
  4830. }
  4831. raw 314:*:{
  4832.   unset %w-*
  4833.   if (%whois.idle != 1) {
  4834.     if ($ncfg(whois) == @whois) {
  4835.       set %w-dest @whois ( $+ $cid $+ )
  4836.       if (!$window(%w-dest)) {
  4837.         if ($ncfg(whois_inside) == 1) {
  4838.           window -k0n %w-dest
  4839.           if ($appactive) && ($activecid == $cid) window -a %w-dest
  4840.         }
  4841.         else window -k0d $+ $iif(%whois.window.passive,n) %w-west 200 200 600 200
  4842.       }
  4843.       else {
  4844.         if ($ncfg(whois_inside) != 1) dline %w-dest 1
  4845.         if (%whois.idle != 1) window -g1 %w-dest
  4846.       }
  4847.     }
  4848.     else set %w-dest $ncfg(whois)
  4849.   }
  4850.   set %whois 1
  4851.   set %w-nick $2
  4852.   set %w-address echo $color(whois) %w-dest $chr(160) $+ › address: $3 $+ $clr(highlight,@) $+ $4
  4853.   set %w-name echo $color(whois) %w-dest $chr(160) $+ › name: $6-
  4854.   echo $color(whois) %w-dest $chr(160)
  4855.   haltdef
  4856. }
  4857. raw 369:*:{
  4858.   if (%w-name) echo $color(whois) %w-dest $chr(160)
  4859.   if (%w-nick) echo $color(high) %w-dest $kl(whowas: %w-nick)
  4860.   if (%w-name) $ifmatch
  4861.   if (%w-address) $ifmatch
  4862.   if (%w-chans) $ifmatch
  4863.   if (%w-ircop) $ifmatch
  4864.   if (%w-auth) $ifmatch
  4865.   if (%w-realip) $ifmatch
  4866.   if (%w-away) $ifmatch
  4867.   var %i = 1
  4868.   while (%i <= %w-other-count) {
  4869.     echo $color(whois) %w-dest %w-other [ $+ [ %i ] ]
  4870.     inc %i
  4871.   }
  4872.   if (%w-server) $ifmatch
  4873.   if (%w-time) $ifmatch
  4874.   if (%whois == 1) {
  4875.     echo $color(high) %w-dest $kl(/whowas: $time(HH:nn))
  4876.     echo $color(whois) %w-dest $chr(160)
  4877.   }
  4878.   if ($window(%w-dest)) window -a %w-dest
  4879.   unset %whois* %w-*
  4880.   haltdef
  4881. }
  4882. raw 367:*:{
  4883.   haltdef
  4884.   if (%unba == 1) {
  4885.     inc %totbans1
  4886.     set %ban $+ %totbans1 $3
  4887.   }
  4888.   elseif ($dialog(cc)) {
  4889.     did -a cc 2 $3 $chr(9) $+ $iif($4 === $server,(server),$4) $chr(9) $+ $date($5,HH:nn - dd/mm/yy)
  4890.     inc %totbans
  4891.   }
  4892.   elseif (%ccc.banget) haltdef
  4893.   else echo $color(info) -smtg $npre $kl($clr(normal,$3)) Set by $4 on $date($5,HH:nn - dd/mm/yy) $par($dur($calc($ctime - $5)) ago)
  4894. }
  4895. raw 368:*:{
  4896.   haltdef
  4897.   if ($dialog(cc)) {
  4898.     if (%totbans > 0) did -ra cc 4 Bans ( $+ %totbans $+ / $+ $n.maxbans $+ )
  4899.     else did -ra cc 4 Bans (0/ $+ $n.maxbans $+ )
  4900.     unset %totbans
  4901.     if (%adopgk == 1) {
  4902.       did -r cc 2
  4903.       did -ra cc 4 Bans
  4904.     }
  4905.   }
  4906.   elseif (%ccc.banget) { haltdef | unset %ccc.banget }
  4907.   else echo $color(info) -stge $npre $kl($clr(normal,$2)) $3-
  4908. }
  4909. raw 346:*:{
  4910.   haltdef
  4911.   if ($dialog(cc)) {
  4912.     did -i cc 2 2 $3 $chr(9) $+ $4 $chr(9) $+ $date($5,HH:nn - dd/mm/yy)
  4913.     inc %totbans
  4914.   }
  4915.   elseif (%ccc.banget) haltdef
  4916.   else echo $color(info) -stge $npre $kl($clr(normal,$3))
  4917. }
  4918. raw 347:*:{
  4919.   haltdef
  4920.   if ($dialog(cc)) {
  4921.     if (%totbans > 0) did -ra cc 4 Invites ( $+ %totbans $+ )
  4922.     else did -ra cc 4 Invites (none)
  4923.     unset %totbans
  4924.   }
  4925.   elseif (%ccc.banget) { haltdef | unset %ccc.banget }
  4926.   else echo $color(info) -stge $npre $kl($clr(normal,$2)) $3-
  4927. }
  4928. raw 348:*:{
  4929.   haltdef
  4930.   if ($dialog(cc)) {
  4931.     did -i cc 2 2 $3 $chr(9) $+ $4 $chr(9) $+ $date($5,HH:nn - dd/mm/yy)
  4932.     inc %totbans
  4933.   }
  4934.   elseif (%ccc.banget) haltdef
  4935.   else echo $color(info) -stge $npre $kl($clr(normal,$3))
  4936. }
  4937. raw 349:*:{
  4938.   haltdef
  4939.   if ($dialog(cc)) {
  4940.     if (%totbans > 0) did -ra cc 4 Excepts ( $+ %totbans $+ )
  4941.     else did -ra cc 4 Excepts (none)
  4942.     unset %totbans
  4943.   }
  4944.   elseif (%ccc.banget) { haltdef | unset %ccc.banget }
  4945.   else echo $color(info) -stge $npre $kl($clr(normal,$2)) $3-
  4946. }
  4947. ;raw 324:*:return
  4948. ;raw 372:*:return
  4949. ;raw 422:*:return
  4950. ;raw 303:*:return
  4951. raw *:*:{
  4952.   if (%whois == 1) {
  4953.     haltdef
  4954.     inc %w-other-count
  4955.     set %w-other $+ %w-other-count $chr(160) $+ › $2 $+  $3-
  4956.   }
  4957.   ;else n.echo info -atgm $2-
  4958. }
  4959.  
  4960. ; popup menu
  4961.  
  4962. menu nicklist {
  4963.   Whois:whois $$1
  4964.   Idle:idle $$1
  4965.   -
  4966.   $iif($me isop #, $iif($1 isop #, - op,+ op),$style(2) +/- op):if ($1 isop #) emode - o | else emode + o
  4967.   $iif($me isop # || $me ishop # && % isin $npre, $iif($1 ishop #, - halfop,+ halfop),):if ($1 ishop #) emode - h | else emode + h
  4968.   $iif($me isop # || $me ishop #, $iif($1 isvoice #, - voice,+ voice),$style(2) +/- voice):if ($1 isvoice #) emode - v | else emode + v
  4969.   $iif($len($prefix) > 3,+/- custom):{
  4970.     var %x = $n.input(Enter custom mode (eg: +a or -a):)
  4971.     if (%x) emode $mid(%x,1,1) $mid(%x,2,1)
  4972.   }
  4973.   -
  4974.   $iif($me isop # || $me ishop #, Kick,$style(2) Kick)
  4975.   .Kick:{
  4976.     var %i = 1
  4977.     while (%i <= $snick(#,0)) {
  4978.       kick $chan $snick(#,%i) $read(config\kicks.txt)
  4979.       inc %i
  4980.     }
  4981.   }
  4982.   .Kick $chr(9) (reason):{
  4983.     var %i = 1, %kmsg = $$n.input(Enter kick reason:)
  4984.     while (%i <= $snick(#,0)) {
  4985.       kick $chan $snick(#,%i) %kmsg
  4986.       inc %i
  4987.     }
  4988.   }
  4989.   $iif($me isop # || $me ishop #, Ban,$style(2) Ban)
  4990.   .Ban, kick:{
  4991.     var %i = 1
  4992.     while (%i <= $snick(#,0)) {
  4993.       bk # $snick(#,%i) $read(config\kicks.txt)
  4994.       inc %i
  4995.     }
  4996.   }
  4997.   .Ban, kick (reason):{
  4998.     var %kick = $$n.input(Enter kick reason:), %i = 1
  4999.     while (%i <= $snick(#,0)) {
  5000.       bk # $snick(#,%i) %kick
  5001.       inc %i
  5002.     }
  5003.   }
  5004.   .-
  5005.   .Kick, ban:{
  5006.     var %i = 1
  5007.     while (%i <= $snick(#,0)) {
  5008.       kb # $snick(#,%i) $read(config\kicks.txt)
  5009.       inc %i
  5010.     }
  5011.   }
  5012.   .Kick, ban (reason):{
  5013.     var %kick = $$n.input(Enter kick reason:), %i = 1
  5014.     while (%i <= $snick(#,0)) {
  5015.       kb # $snick(#,%i) %kick
  5016.       inc %i
  5017.     }
  5018.   }
  5019.   .-
  5020.   .$iif($n.qnet && q ison #,Kick $+ $chr(44) Q ban auth):{
  5021.     var %i = 1
  5022.     while (%i <= $snick($chan,0)) {
  5023.       msg Q chanlev # $snick(#,%i) +b
  5024.       kick # $snick(#,%i) $read(config\kicks.txt)
  5025.       inc %i
  5026.     }
  5027.   }
  5028.   .$iif($n.qnet && q ison #,Kick $+ $chr(44) Q ban auth (reason)):{
  5029.     var %kick = $$n.input(Enter kick reason:), %i = 1
  5030.     while (%i <= $snick($chan,0)) {
  5031.       msg Q chanlev # $snick($chan,%i) +b
  5032.       kick # $snick(#,%i) %kick
  5033.       inc %i
  5034.     }
  5035.   }
  5036.   .-
  5037.   .$iif($n.qnet && q ison #,Q ban host):{
  5038.     var %i = 1
  5039.     while (%i <= $snick(#,0)) {
  5040.       msg Q ban # $address($snick($chan,%i),$ncfg(ban_mask))
  5041.       inc %i
  5042.     }
  5043.   }
  5044.   -
  5045.   Stuff
  5046.   .Blacklist
  5047.   ..$$1 (nick only):.write config\blacklist.txt $1 $+ $chr(44) $$n.input(Enter blacklist reason:,Blacklisted) | w_ncfg blacklist 1 | n.blscan # | n.blscanall
  5048.   ..$address($snicks,2):.write config\blacklist.txt $address($snicks,2) $+ $chr(44) $+ $$n.input(Enter blacklist reason:,Blacklisted) | w_ncfg blacklist 1 | n.blscan # | n.blscanall
  5049.   ..$address($snicks,1):.write config\blacklist.txt $address($snicks,1) $+ $chr(44) $+ $$n.input(Enter blacklist reason:,Blacklisted) | w_ncfg blacklist 1 | n.blscan # | n.blscanall
  5050.   ..-
  5051.   ..Edit blacklist:blist
  5052.   .Ignore
  5053.   ..$$1 (nick only):ignore $1 | .ignore on
  5054.   ..$address($snicks,2):ignore $address($snicks,2) | .ignore on
  5055.   ..$address($snicks,1):ignore $address($snicks,1) | .ignore on
  5056.   .Auto op
  5057.   ..$$1 (nick only):aop $1 # | .aop on
  5058.   ..$address($snicks,2):aop $address($snicks,2) # | .aop on
  5059.   ..$address($snicks,1):aop $address($snicks,1) # | .aop on
  5060.   .Auto voice
  5061.   ..$$1 (nick only):avoice $1 # | .avoice on
  5062.   ..$address($snicks,2):avoice $address($snicks,2) # | .avoice on
  5063.   ..$address($snicks,1):avoice $address($snicks,1) # | .avoice on
  5064.  
  5065.   .Edit:uwho
  5066.   .-
  5067.   .IP $chr(9) (/dns):dns $$1
  5068.   .View log $chr(9) (/logg):{
  5069.     !query -n $$1
  5070.     if ($exists($window($1).logfile)) run $window($1).logfile
  5071.     !close -m $$1
  5072.   }
  5073.   .$iif($notify($1),Remove from notify list,Add to notify list):notifyer $1
  5074.   .Host2nick $chr(9) (/host2nick host):dns2nick $remove($address($$1,2),*!*@)
  5075.   .Request op $chr(9) (QuakeNet):msg R requestop # $$1
  5076.   .-
  5077.   Slap:slap $$1
  5078.   -
  5079.   $iif(q ison #,Q flags):botcontrol # $1
  5080.   -
  5081.   DCC/CTCP
  5082.   .[DCC]:return
  5083.   .-
  5084.   .Send:dcc send $$1
  5085.   .Chat:dcc chat $$1
  5086.   .Send current song:mp3send $$1
  5087.   .-
  5088.   .[CTCP]:return
  5089.   .-
  5090.   .Ping:ctcp $$1 PING
  5091.   .Version:ctcp $$1 VERSION
  5092.   .Finger:ctcp $$1 FINGER
  5093.   .Time:ctcp $$1 TIME
  5094. }
  5095.  
  5096. menu status {
  5097.   $iif($status == connected,Reconnect $chr(9) (/server)):server
  5098.   -
  5099.   Control Panel $chr(9) (/setup):setup
  5100.   Auto connect settings $chr(9) (/autocon):autocon
  5101.   Autojoin settings $chr(9) (/caj):caj
  5102.   NickServ settings $chr(9) (/cns):cns
  5103.   -
  5104.   $iif($status == connected,,$style(2)) Force autojoin $chr(9) (/aj):aj
  5105.   $iif($n.qnet && $status == connected,,$style(2)) Auth with Q $chr(9) (/auth):auth
  5106.   $iif($status == connected,,$style(2)) Set mode +x $chr(9) (/mode nick +x):mode $me +x
  5107.   $iif($status == connected,,$style(2)) Check lag $chr(9) (/clag):clag
  5108.   $iif($status == connected,,$style(2)) MOTD $chr(9) (/motd):motd
  5109.   -
  5110.   $iif($n.qnet && $status == connected,Q bot)
  5111.   .Auth now:auth
  5112.   .Register:msg Q hello $$n.input(Enter your mail address:) $$n.input(Enter your mail address again:)
  5113.   .-
  5114.   .Whoami:msg Q whoami
  5115.   .Whois:msg Q whois $$n.input(Enter nick name: $crlf $crlf $+ (Prefix nick with $chr(35) to use auth nick))
  5116.   .Change password:.msg Q@CServe.quakenet.org newpass $$n.input(Enter your new password:) $$n.input(Enter your new password again:)
  5117.   .Change mail:.msg Q@CServe.quakenet.org email $$n.input(Enter your auth password:) $$n.input(Enter your new mail address:) $$n.input(Enter your new mail address again:)
  5118.   .Request password:msg Q requestpassword $$n.input(Enter your mail address:)
  5119.   .Show auth history:msg Q authhistory
  5120. }
  5121.  
  5122. menu channel {
  5123.   $left(#,12) $+ $iif($len(#) > 12,...)
  5124.   .Chan central $chr(9) (/cc #chan):channel $1-
  5125.   .Hide events $chr(9) (/hevents #chan):hevents #
  5126.   .-
  5127.   .Search log $chr(9) (/slog <text>):if ($input(Search for:,e,Search log)) slog $!
  5128.   .View log $chr(9) (/logg):logg
  5129.   .View log $chr(9) (external):{
  5130.     if ($exists($window($active).logfile)) run $window($active).logfile
  5131.     else n.echo other -at no log file found for $active
  5132.   }
  5133.   .Show topic $chr(9) (default F7):topic #
  5134.   .Clear $chr(9) (/clear):clear
  5135.   .Clonescan $chr(9) (/clonescan #chan):clonescan #
  5136.   .-
  5137.   .$iif($n.qnet,Request op $chr(9) (QuakeNet)):.msg R requestop $chan $me
  5138.   .$iif($n.qnet,Request op $chr(9) (choose nick)):.msg R requestop $chan $$n.input(Enter nick name:)
  5139.   .-
  5140.   .$iif(Q !ison # && $n.qnet,request Q):msg R requestbot #
  5141.   .-
  5142.   .$iif($me ison #,Leave $chr(9) (/part),Join $chr(9) (/join #chan)):$iif($me ison #,part #,join # $chan(#).key)
  5143.   .Rejoin $chr(9) (/hop):hop
  5144.  
  5145.   Autojoin
  5146.   .$iif($read(config\autojoin- [ $+ [ $network ] $+ ] .txt,w,[ $chan [ $+ ] * ]),Remove # from autojoin,Add # to autojoin):n.aj.edit #
  5147.   .Edit autojoin on $network:{
  5148.     var %a = config\autojoin- $+ $network $+ .txt
  5149.     if (!$read(%a)) write -c %a
  5150.     caj $network
  5151.   }
  5152.   .-
  5153.   .$iif($ncfg(autojoin) == 1,$style(1) Autojoin $+ $chr(58) on,Autojoin $+ $chr(58) off):{
  5154.     if ($ncfg(autojoin) == 1) w_ncfg autojoin o
  5155.     else w_ncfg autojoin 1
  5156.   }
  5157.   $iif(q ison # && $n.qnet,Q bot)  
  5158.   .Nick
  5159.   ..Auth now:auth
  5160.   ..Register:msg Q hello $$n.input(Enter your mail address:) $$n.input(Enter your mail address again:)
  5161.   ..-
  5162.   ..Whoami:msg Q whoami
  5163.   ..Whois:msg Q whois $$n.input(Enter nick name: $crlf $crlf $+ (Prefix nick with $chr(35) to use auth nick))
  5164.   ..Change password:.msg Q@CServe.quakenet.org newpass $$n.input(Enter your new password:) $$n.input(Enter your new password again:)
  5165.   ..Change mail:.msg Q@CServe.quakenet.org email $$n.input(Enter your auth password:) $$n.input(Enter your new mail address:) $$n.input(Enter your new mail address again:)
  5166.   ..Request password:msg Q requestpassword $$n.input(Enter your mail address:)
  5167.   ..Show auth history:msg Q authhistory
  5168.   .Channel
  5169.   ..Show welcome message:msg Q welcome #
  5170.   ..Show and edit welcome message:msg Q welcome # | editbox -ap /msg Q welcome #
  5171.   ..-
  5172.   ..Show online users:msg Q users #
  5173.   ..Show all added users:msg Q chanlev #
  5174.   ..Show chanstats:msg Q chanstat #
  5175.   ..Show op history:msg Q chanophistory #
  5176.   ..Show banlist:msg Q banlist #
  5177.   ..Show autolimit:msg Q autolimit #
  5178.   ..Clear bans:msg Q banclear #
  5179.   ..Clear chanmodes:msg Q clearchan #
  5180.   ..Deop all users:msg Q deopall #
  5181.   .Chanflags
  5182.   ..Show channel flags:msg Q chanflags #
  5183.   ..-
  5184.   ..Known only $chr(9) (+k)
  5185.   ...on:msg Q chanflags # +k
  5186.   ...off:msg Q chanflags # -k
  5187.   ..Enforce bans $chr(9) (+e)
  5188.   ...on:msg Q chanflags # +e
  5189.   ...off:msg Q chanflags # -e
  5190.   ..Voice all $chr(9) (+v)
  5191.   ...on:msg Q chanflags # +v
  5192.   ...off:msg Q chanflags # -v
  5193.   ..Bitch mode $chr(9) (+b)
  5194.   ...on:msg Q chanflags # +b
  5195.   ...off:msg Q chanflags # -b
  5196.   ..Channel-limit $chr(9) (+c)
  5197.   ...on:msg Q chanflags # +c
  5198.   ...off:msg Q chanflags # -c
  5199.   ..Force topic $chr(9) (+f)
  5200.   ...on:msg Q chanflags # +f
  5201.   ...off:msg Q chanflags # -f
  5202.   ..Force key $chr(9) (+k)
  5203.   ...on:msg Q chanflags # +k
  5204.   ...off:msg Q chanflags # -k
  5205.   ..Force limit $chr(9) (+l)
  5206.   ...on:msg Q chanflags # +l
  5207.   ...off:msg Q chanflags # -l
  5208.   ..Protect ops $chr(9) (+p)
  5209.   ...on:msg Q chanflags # +p
  5210.   ...off:msg Q chanflags # -p
  5211.   ..Topic save $chr(9) (+t)
  5212.   ...on:msg Q chanflags # +t
  5213.   ...off:msg Q chanflags # -t
  5214.   ..Welcome message $chr(9) (+w)
  5215.   ...on:msg Q chanflags # +w
  5216.   ...off:msg Q chanflags # -w
  5217.   .-
  5218.   .Show commands:msg Q showcommands
  5219.   .-
  5220.   .Request op:msg Q op #
  5221.   .Request voice:msg Q voice #
  5222.   -
  5223.   Stuff
  5224.   .Say sys info
  5225.   ..Complete $chr(9) (/sys):sys
  5226.   ..-
  5227.   ..OS $chr(9) (/os):os
  5228.   ..CPU $chr(9) (/cpu):cpu
  5229.   ..Memory usage $chr(9) (/mem):/mem
  5230.   ..Graphics card $chr(9) (/gfx):gfx
  5231.   ..Sound card $chr(9) (/snd):snd
  5232.   ..Total hdd free space $chr(9) (/hd):hd
  5233.   ..Individual free space $chr(9) (/hds):hds
  5234.   ..Ind. free space w/ labels $chr(9) (/hds -l):hds -l
  5235.   ..Ind. mapped free space $chr(9) (/hds -m):hds -m
  5236.   ..Ind. mapped free space w/ labels $chr(9) (/hds -ml):hds -ml
  5237.   ..Uptime $chr(9) (/uptime):uptime
  5238.   ..Connection $chr(9) (/net):net
  5239.   ..IP address $chr(9) (/ip):ip
  5240.   ..Bandwidth usage $chr(9) (/bw):bw
  5241.   ..Change network card used for /bw:.echo -qg $dedll(change_adapter)
  5242.   .-
  5243.   .Voting $chr(9) (y/n)
  5244.   ..Begin $chr(9) (/vote):vote
  5245.   ..End $chr(9) (/voteoff):voteoff
  5246.   .Say power $chr(9) (/power):power
  5247.   .Advertise script $chr(9) (/ad):ad
  5248.   .Lag-check (echo) $chr(9) (/clag):clag
  5249.   .-
  5250.   .Google search $chr(9) (/g query):editbox -p /g
  5251.   .Wikipedia search $chr(9) (/wiki query):editbox -p /wiki
  5252.   .IMDb search $chr(9) (/imdb query):editbox -p /imdb
  5253.   .-
  5254.   .Export log $chr(9) (/exportlog)
  5255.   ..This channel:exportlog $window($active).logfile
  5256.   ..Select log file:exportlog
  5257.   Configuration
  5258.   .Control Panel $chr(9) (/setup, F2):setup
  5259.   .-
  5260.   .Misc settings $chr(9) (/misc):misc
  5261.   .Theme/font settings $chr(9) (/theme):theme
  5262.   .Sound/highlight settings $chr(9) (/nq):nq
  5263.   .Song announce $chr(9) (/sa):sa
  5264.   .Protections $chr(9) (/prot):prot
  5265.   .Auto connect $chr(9) (/autocon):autocon
  5266.   .Autojoin $chr(9) (/caj):caj
  5267.   .QuakeNet setup $chr(9) (/quakenet):quakenet
  5268.   .UnderNet setup $chr(9) (/undernet):undernet
  5269.   .NickServ setup $chr(9) (/cns):cns
  5270.   .Notifications $chr(9) (/popups):popups
  5271.   .F-key bindings $chr(9) (/fkeys):fkeys
  5272.   .Logviewer $chr(9) (/lv):lv
  5273.   .Game launcher $chr(9) (/g-join):g-join
  5274.   .Blacklist $chr(9) (/blist):blist
  5275.   .Alarm timer $chr(9) (/alarm):alarm
  5276.   -
  5277.   Song announce
  5278.   .Advertise current song:np
  5279.   .Settings:mp3say
  5280.   .-
  5281.   .Winamp only $+ $chr(58):.
  5282.   .(Shift+F1) $+ $chr(58) Previous:sf1
  5283.   .(Shift+F2) $+ $chr(58) Play:sf2
  5284.   .(Shift+F3) $+ $chr(58) Pause:sf3
  5285.   .(Shift+F4) $+ $chr(58) Stop:sf4
  5286.   .(Shift+F5) $+ $chr(58) Next:sf5
  5287.   .-
  5288.   .Start Winamp:{
  5289.     if ($exists($cit($ncfg(wapath)))) { run $ncfg(wapath) }
  5290.     else {
  5291.       w_ncfg wapath $sfile(winamp.exe,Locate your winamp.exe)
  5292.       if ($exists($cit($ncfg(wapath)))) { run $ncfg(wapath) }
  5293.     }
  5294.   }
  5295.   .Close Winamp:dll scripts\dll\winamp.dll closewinamp
  5296.   $iif(%psybnc. [ $+ [ $cid ] ],psyBNC)
  5297.   .Play private log:!raw -q playprivatelog
  5298.   .Erase private log:!raw -q eraseprivatelog
  5299.   .-
  5300.   .Play traffic log (last):!raw -q playtrafficlog last
  5301.   .Erase traffic log:!raw -q erasetrafficlog
  5302.   .-
  5303.   .Open psyBNC window:n.bnc psyBNC | window -a $bncwin(psybnc,$cid)
  5304.   $iif(%sbnc. [ $+ [ $cid ] ],sBNC)
  5305.   .Read log:n.bnc sbnc read
  5306.   .Erase log:n.bnc sbnc erase
  5307.   .-
  5308.   .Open sBNC window:n.bnc sBNC | window -a $bncwin(sbnc,$cid)
  5309.   Change nick:editbox -a /nick $me
  5310.   -
  5311.   Away
  5312.   .$iif(!$away,Set away (default F3),$style(2) Set away (default F3))):awaysys
  5313.   .$iif($away,Return (default F4),$style(2) Return (default F4))):back
  5314.   .-
  5315.   .$iif($away,Change away msg,$style(2) Change away message):away $$n.input(Enter new away message:)
  5316. }
  5317. menu query {
  5318.   Info
  5319.   .Whois (extended):whois $$1
  5320.   .Whois (normal):whois2 $$1
  5321.   .-  
  5322.   .Whois (Q):msg Q whois $$1
  5323.   .Whois (L):msg L whois $$1
  5324.   .-
  5325.   .DNS (ip):dns $$1
  5326.   .Host-2-nick:dns2nick $remove($address($$1,2),*!*@)
  5327.   -
  5328.   $iif($ncfg(privpip) == 1,$style(1) Query sound,Query sound):{
  5329.     if ($ncfg(privpip) == 1) { w_ncfg privpip o }
  5330.     else { w_ncfg privpip 1 }
  5331.   }
  5332.   -
  5333.   Ignore $1
  5334.   .$address($1,2):ignore $address($1,2) | n.echo normal -atg Note: If you have a query window open with someone, private messages from them won't be ignored even if their address matches an ignore address.
  5335.   .$address($1,1):ignore $address($1,1) | n.echo normal -atg Note: If you have a query window open with someone, private messages from them won't be ignored even if their address matches an ignore address.
  5336.   .$1 $+ *@*:ignore $1 | n.echo normal -atg Note: If you have a query window open with someone, private messages from them won't be ignored even if their address matches an ignore address.
  5337.   Edit ignore list:uwho
  5338.   -
  5339.   $iif($notify($1),Remove from notify list,Add to notify list):notifyer $1
  5340.   Open get dir:{
  5341.     if ($isdir($getdir $+ $1 $+ )) run $getdir $+ $1
  5342.     else n.echo info -atg No download dir found for $1 $par($getdir $+ $1)
  5343.   }
  5344.   Logfile
  5345.   .View log:logg
  5346.   .View log (external):run $n.log($active)
  5347.   .Search in log:slog $$n.input(Search for:))
  5348.   .Export/save log:exportlog $n.log($active)
  5349.   -
  5350.   DCC/CTCP
  5351.   .[DCC]:return
  5352.   .-
  5353.   .Send:dcc send $$1
  5354.   .Chat:dcc chat $$1
  5355.   .Send current song:mp3send $$1
  5356.   .-
  5357.   .[CTCP]:return
  5358.   .-
  5359.   .Ping:ctcp $$1 ping
  5360.   .Time:ctcp $$1 time
  5361.   .Finger:ctcp $$1 finger
  5362.   .Version:ctcp $$1 version
  5363. }
  5364. menu menubar {
  5365.   .Control Panel (F2):setup
  5366.   Windows
  5367.   .Close all windows:partall | close -icfgms@
  5368.   .Close all querys:scon -a close -m
  5369.   .-
  5370.   .Leave all channels (/partall):partall
  5371.   .Leave all channels (reason):partall $$n.input(Enter part reason:)
  5372.   .-
  5373.   Away
  5374.   .$iif(!$away,Set away (F3),$style(2) Set away (F3))):awaysys
  5375.   .$iif($away,Return (F4),$style(2) Return (F4))):back
  5376.   .-
  5377.   .$iif($away,Change away msg,$style(2) Change away message):away $$n.input(Enter new away message:)
  5378.   -
  5379.   Alarm timer:alarm
  5380.   Open DCC get folder:run $getdir
  5381. }
  5382. menu @preview {
  5383.   rclick:close -@ @preview*
  5384. }
  5385. menu @previewx {
  5386.   sclick:window -a @preview
  5387.   rclick:close -@ @preview*
  5388. }
  5389. menu @whois (*),@highlights (*) {
  5390.   dclick:{
  5391.     if ($window($active).mdi) window -n $active
  5392.     else close -@ $active
  5393.   }
  5394.   Settings:misc
  5395. }
  5396. menu @psybnc (*) {
  5397.   Play private log:!raw -q PLAYPRIVATELOG
  5398.   Erase private log:!raw -q ERASEPRIVATELOG
  5399.   -
  5400.   Play traffic log (last):!raw -q playtrafficlog last
  5401.   Erase traffic log:!raw -q erasetrafficlog
  5402.   -
  5403.   Bwho (list users):!raw -q bwho
  5404.   -
  5405.   Away
  5406.   .set away-msg (setaway):echo -t $active $npre ex. setaway :offline | editbox $active /quote setaway $chr(58)
  5407.   .set public away-msg (setleavemsg):echo -t $active $npre ex. setaway :offline | editbox $active /quote setleavemsg $chr(58)
  5408.   .-
  5409.   .set away-nick (setawaynick):editbox -p $active /quote setawaynick
  5410.   Server
  5411.   .bconnect:!raw -q bconnect
  5412.   .bquit:!raw -q bquit
  5413.   .jump:!raw -q bjump
  5414. }
  5415. menu @sbnc (*) {
  5416.   Read log:n.bnc sbnc read
  5417.   Erase log:n.bnc sbnc erase
  5418.   -
  5419.   jump:n.bnc sbnc jump
  5420.   partall:n.bnc sbnc partall
  5421.   status:n.bnc sbnc status
  5422.   vhosts:n.bnc sbnc vhosts
  5423. }
  5424. menu @logviewer {
  5425.   dclick:{
  5426.     var %f = $remove($logdir,$mircdir) $+ $line(@logviewer,$1,1), %h = $nofile(%f) $+ $mid($nopath(%f),3,-2)
  5427.     if ($isdir(%h)) || ($mid($nopath(%f),3,-2) == ..) {
  5428.       if ($mid($nopath(%f),3,-2) == ..) var %h = $left(%h,-3)
  5429.       clear -l @logviewer
  5430.       clear @logviewer
  5431.       aline -l @logviewer $chr(91) .. $chr(93)
  5432.       var %a = $finddir(%h,*,0,1,aline -l @logviewer $chr(91) $nopath($1-) $chr(93))
  5433.       echo @logviewer $npre $findfile(%h,*.log,0,1,aline -l @logviewer $nopath($1-)) log files and %a folders in %h
  5434.       set %lv.dir %h $+ \
  5435.     }
  5436.     else {
  5437.       var %y = %lv.dir $+ $nopath(%f)
  5438.       if ($file(%y).size > 10000000) {
  5439.         if (!$n.input(This is a very large log file ( $+ $round($calc($file(%y).size /1024/1024),2) MB) $+ $c44 loading will take some time. Do you want to continue?,y/n)) return
  5440.       }
  5441.       clear @logviewer
  5442.       loadbuf -p @logviewer $cit(%y)
  5443.       echo @logviewer $npre $kl:($nopath(%f)) $lines(%y) lines, $round($calc($file(%y).size /1024),2) KB
  5444.     }
  5445.     titlebar @logviewer - %lv.dir
  5446.   }
  5447.   -
  5448.   $iif($sline(@logviewer,0) && $left($sline(@logviewer,1),1) != [,Rename log) {
  5449.     var %file = $+(",%lv.dir,$sline(@logviewer,1),")
  5450.     if ($exists(%file)) {
  5451.       var %newname = $n.input(Enter new name (name.log):,$nopath(%file))"
  5452.       if (!%newname) { return }
  5453.       var %newfile = $+(",%lv.dir,$iif($right(%newname,4) == .log,%newname,$+(%newname,.log)),")
  5454.     }
  5455.     else {
  5456.       echo @logviewer $npre %file does not exist
  5457.       dline -l @logviewer $sline(@logviewer,1).ln
  5458.       return
  5459.     }
  5460.     if ($exists(%newfile)) { echo @logviewer $npre %newfile already exists | return }
  5461.     .rename %file %newfile
  5462.     if ($exists(%newfile)) {
  5463.       echo -t @logviewer $npre $nopath(%file) renamed to $nopath(%newfile)
  5464.       rline -l @logviewer $sline(@logviewer,1).ln $nopath(%newfile)
  5465.     }
  5466.   }
  5467.   $iif($sline(@logviewer,0) && $left($sline(@logviewer,1),1) != [,Delete log) {
  5468.     var %file = $+(",%lv.dir,$sline(@logviewer,1),")
  5469.     if ($exists(%file)) {
  5470.       if ($n.input(Delete $nopath(%file) $+ ?,y/n)) {
  5471.         .remove %file
  5472.         dline -l @logviewer $sline(@logviewer,1).ln
  5473.         echo -t @logviewer $npre %file deleted
  5474.       }
  5475.     }
  5476.     else {
  5477.       echo @logviewer $npre %file does not exist
  5478.       dline -l @logviewer $sline(@logviewer,1).ln
  5479.     }
  5480.   }
  5481.   -
  5482.   $iif($sline(@logviewer,0) && $left($sline(@logviewer,1),1) != [,Open selected file):run $+(",%lv.dir,$sline(@logviewer,1),")
  5483.   $iif($sline(@logviewer,0) && $left($sline(@logviewer,1),1) == [,Open selected folder):run $+(",%lv.dir,$mid($sline(@logviewer,1),3,-2),")
  5484.   Open current folder:run $+(",%lv.dir,")
  5485. }
  5486. menu @search*,@log*,@clones*,@whois (*),@psybnc (*),@sbnc (*),@highlights (*) {
  5487.   -
  5488.   Clear:clear
  5489.   Close:close -@ $active
  5490. }
  5491. menu @n.popup {
  5492.   sclick:{
  5493.     if ("*" iswm %popup.window) window -a %popup.window
  5494.     else {
  5495.       if ($appstate == minimized) || ($appstate == tray) {
  5496.         showmirc -r
  5497.       }
  5498.       showmirc -s
  5499.       if ($window(%popup.window)) window -a %popup.window
  5500.     }
  5501.   }
  5502.   rclick:close -@ @n.popup
  5503. }
  5504.  
  5505. menu @rcon {
  5506.   send status:rcon_cmd status
  5507.   send stats:rcon_cmd stats
  5508.   send sv_password:rcon_cmd sv_password
  5509.   -
  5510.   Close:{
  5511.     close -@ @rcon
  5512.     sockclose rcon*
  5513.     unset %rcon.*
  5514.   }
  5515. }
  5516.  
  5517. ; themes
  5518.  
  5519. alias n.color.reset {
  5520.   if ($color(0) != 16777215) { color -r 0 }
  5521.   if ($color(1) != 0) { color -r 1 }
  5522.   if ($color(2) != 8323072) { color -r 2 }
  5523.   if ($color(3) != 37632) { color -r 3 }
  5524.   if ($color(4) != 255) { color -r 4 }
  5525.   if ($color(5) != 127) { color -r 5 }
  5526.   if ($color(6) != 10223772) { color -r 6 }
  5527.   if ($color(7) != 32764) { color -r 7 }
  5528.   if ($color(8) != 65535) { color -r 8 }
  5529.   if ($color(9) != 64512) { color -r 9 }
  5530.   if ($color(10) != 9671424) { color -r 10 }
  5531.   if ($color(11) != 16776960) { color -r 11 }
  5532.   if ($color(12) != 16515072) { color -r 12 }
  5533.   if ($color(13) != 16711935) { color -r 13 }
  5534.   if ($color(14) != 8355711) { color -r 14 }
  5535.   if ($color(15) != 13816530) { color -r 15 }
  5536. }
  5537. alias byt-tema {
  5538.   if (!$1) || (($nopath($isalias(ttimestamp).fname) == $1 $+ .tem) && (!%poaksdfopka)) { return }
  5539.   if (!$exists($cit($scriptdirtema\ $+ $1- $+ .tem))) { n.echo normal -atg $scriptdirtema\ $+ $1- $+ .tem does not exist | return }  
  5540.   if (!$dialog(bt)) { dialog -m bt bt | did -a bt 1 Loading theme }  
  5541.   if (!$exists($cit($isalias(ttimestamp).fname))) {
  5542.     dialog -x bt
  5543.     return
  5544.   }
  5545.   var %ticks $ticks
  5546.   if ($isalias(tname).fname) .unload -rs $cit($isalias(tname).fname)
  5547.   .load -rs $cit($scriptdirtema\ $+ $1- $+ .tem)
  5548.   .timestamp -f $n.timestamp
  5549.   cnicks
  5550.   n.color.reset
  5551.   tclr
  5552.   color treebar $color(background)
  5553.   if ($ncfg(use_theme_fonts) == 1) {
  5554.     if ($tfont) fc $tfont
  5555.     else fc 11 tahoma
  5556.   }
  5557.   dialog -x bt
  5558.   if (!%poaksdfopka) n.echo normal -atgq Theme: $tname loaded $par(Ctrl+F12: clear all windows) $iif(%ticks,$par($calc(($ticks - %ticks) / 1000) $+ s))
  5559.   if (%generatepreview) {
  5560.     .remove $scriptdirtema\$1 $+ . *
  5561.     n.genpreview $1
  5562.   }
  5563.   elseif (!$exists($+(",$scriptdirtema\,$1,.png,"))) && (!$exists($+(",$scriptdirtema\,$1,.bmp,"))) n.genpreview $1
  5564.   unset %generatepreview %poaksdfopka
  5565. }
  5566. alias theme.finished return
  5567. alias theme.reset return
  5568. dialog bt {
  5569.   title "nbs-irc"
  5570.   size -1 -1 50 10
  5571.   option dbu
  5572.   text "", 1, 1 6 50 7, center
  5573.   button "-", 2, 300 300 30 10, disable ok
  5574. }
  5575. On *:dialog:bt:init:0:{
  5576.   n.mdx SetMircVersion $version
  5577.   n.mdx MarkDialog $dname
  5578.   n.mdx SetDialog $dname style dlgframe
  5579. }
  5580. alias cnicks {
  5581.   if ($ncfg(nicklist_use_themed_colors) != 1) return
  5582.   .cnick -r * @
  5583.   .cnick -r * +
  5584.   .cnick -nr *
  5585.   .cnick -m2 $!me $me.clr
  5586.   .cnick -m2 * $op.clr @
  5587.   .cnick -m2 * $voice.clr +
  5588.   .cnick -nm2 * $normal.clr
  5589. }
  5590. alias n.quote {
  5591.   if ($1) {
  5592.     if ($quote.style) return $replace($quote.style,<text>,$1- $+ ) $+ 
  5593.     else return ' $+ $1- $+ '
  5594.   }
  5595. }
  5596. alias par if ($1) return $replace($par.style,<text>,$1- $+ ) $+ 
  5597. alias kl if ($1) return $replace($bracket.style,<text>,$1- $+ ) $+ 
  5598. alias kl: if ($1) return $replace($bracket.style,<text>,$1- $+ ) $+ :
  5599. alias n.timestamp return $ttimestamp $+ $iif($right($ttimestamp,1) != ,)
  5600. alias npre return $pre $+ 
  5601. alias color_gen {
  5602.   if (!$1) {
  5603.     var %f = temp.txt
  5604.     .write -c temp.txt
  5605.   }
  5606.   if ($color(0) != 16777215) .write %f color 0 $color(0)
  5607.   if ($color(1) != 0) .write %f color 1 $color(1)
  5608.   if ($color(2) != 8323072) .write %f color 2 $color(2)
  5609.   if ($color(3) != 37632) .write %f color 3 $color(3)
  5610.   if ($color(4) != 255) .write %f color 4 $color(4)
  5611.   if ($color(5) != 127) .write %f color 5 $color(5)
  5612.   if ($color(6) != 10223772) .write color 6 %f $color(6)
  5613.   if ($color(7) != 32764) .write %f color 7 $color(7)
  5614.   if ($color(8) != 65535) .write %f color 8 $color(8)
  5615.   if ($color(9) != 64512) .write %f color 9 $color(9)
  5616.   if ($color(10) != 9671424) .write %f color 10 $color(10)
  5617.   if ($color(11) != 16776960) .write %f color 11 $color(11)
  5618.   if ($color(12) != 16515072) .write %f color 12 $color(12)
  5619.   if ($color(13) != 16711935) .write %f color 13 $color(13)
  5620.   if ($color(14) != 8355711) .write %f color 14 $color(14)
  5621.   if ($color(15) != 13816530) .write %f color 15 $color(15)
  5622.   .write %f color action text $color(action)
  5623.   .write %f color ctcp text $color(ctcp)
  5624.   .write %f color info text $color(info)
  5625.   .write %f color info2 text $color(info2)
  5626.   .write %f color highlight text $color(highlight)
  5627.   .write %f color invite text $color(invite)
  5628.   .write %f color join text $color(join)
  5629.   .write %f color kick text $color(kick)
  5630.   .write %f color mode text $color(mode)
  5631.   .write %f color nick text $color(nick)
  5632.   .write %f color normal text $color(normal)
  5633.   .write %f color notice text $color(notice)
  5634.   .write %f color notify text $color(notify)
  5635.   .write %f color other text $color(info)
  5636.   .write %f color own text $color(own)
  5637.   .write %f color part text $color(part)
  5638.   .write %f color quit text $color(quit)
  5639.   .write %f color topic text $color(topic)
  5640.   .write %f color wallops text $color(wallops)
  5641.   .write %f color whois text $color(whois)
  5642.   .write %f color listbox $color(listbox)
  5643.   .write %f color listbox text $color(listbox text)
  5644.   .write %f color title text $color(title)
  5645.   .write %f color editbox text $color(editbox text)
  5646.   .write %f color inactive $color(inactive)
  5647.   .write %f color background $color(background)
  5648.   .write %f color editbox $color(editbox)
  5649.   .write %f color treebar text $color(treebar text)
  5650.   if (%f == temp.txt) {
  5651.     if ($dialog(tedit)) loadbuf -o tedit 3 temp.txt
  5652.     else run %f
  5653.     .timer 1 1 .remove %f
  5654.   }
  5655. }
  5656. alias pretimestamp {
  5657.   return $replace($ttimestamp,HH,$1,nn,$2,ss,$3)
  5658. }
  5659. alias n.genpreview {
  5660.   var %font = $window(status window).font, %size = $window(status window).fontsize
  5661.   window -k0dnhp +dl @tp -1 -1 386 210
  5662.   drawtext -p @tp $color(join) %font %size 3 0 $pretimestamp($time(HH),$time(nn),10) $npre Join: elof $par(~mjo@h10v2ftb31p876.com)
  5663.   drawtext -p @tp $color(mode) %font %size 3 14 $pretimestamp($time(HH),$time(nn),10) $npre Q $par(+v) elof
  5664.   drawtext -p @tp $color(own) %font %size 3 28 $pretimestamp($time(HH),$time(nn),13) $replace($me.style,<mode>,@,<nick>,Yngve) $+  hello
  5665.   drawtext -p @tp $color(normal) %font %size 3 42 $pretimestamp($time(HH),$time(nn),15) $replace($nick.style,<mode>,+,<nick>,elof) $+  hi
  5666.   drawtext -p @tp $color(nick) %font %size 3 56 $pretimestamp($time(HH),$time(nn),17) $npre $clr(high,nick) is now known as $clr(high,nick-afk)
  5667.   drawtext -p @tp $color(normal) %font %size 3 70 $pretimestamp($time(HH),$time(nn),20) $replace($nick.style,<mode>,+,<nick>,elof) $+  where's albin?
  5668.   drawtext -p @tp $color(normal) %font %size 3 84 $pretimestamp($time(HH),$time(nn),23) $replace($nick.style,<mode>,,<nick>,albin) $+  here
  5669.   drawtext -p @tp $color(normal) %font %size 3 98 $pretimestamp($time(HH),$time(nn),25) $replace($nick.style,<mode>,+,<nick>,elof) $+  ok, pm
  5670.   drawtext -p @tp $color(normal) %font %size 3 112 $pretimestamp($time(HH),$time(nn),26) $replace($nick.style,<mode>,@,<nick>,karl-bertil) $+  bla bla
  5671.   drawtext -p @tp $color(part) %font %size 3 126 $pretimestamp($time(HH),$time(nn),30) $npre Part: ingvar $par(id@h140z26ls35a876.net)
  5672.   drawtext -p @tp $color(topic) %font %size 3 140 $pretimestamp($time(HH),$time(nn),33) $npre Yngve changes topic to: Preview
  5673.   drawtext -p @tp $color(join) %font %size 3 154 $pretimestamp($time(HH),$time(nn),35) $npre Join: billythekid $par(~lame@455-b17ch.cbh.com)
  5674.   drawtext -p @tp $color(normal) %font %size 3 168 $pretimestamp($time(HH),$time(nn),39) $replace($nick.style,<mode>,,<nick>,billythekid) $+  Hello, is this the preview channel?
  5675.   drawtext -p @tp $color(own) %font %size 3 182 $pretimestamp($time(HH),$time(nn),42) $replace($me.style,<mode>,@,<nick>,Yngve) $+  Yes it is.
  5676.   drawtext -p @tp $color(quit) %font %size 3 196 $pretimestamp($time(HH),$time(nn),44) $npre Quit: Random $par(id@c-d7bd70d5.com) $par(Signed off)
  5677.   drawsave -b24 @tp $qt($scriptdirtema\ $+ $left($nopath($isalias(tname).fname),-4) $+ .bmp)
  5678.   close -@ @tp
  5679.   n.echo other -stge Preview for $tname generated
  5680. }
Add Comment
Please, Sign In to add comment