Guest User

Untitled

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