Guest User

Untitled

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