;ЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇ
;;;;;;;;;;;;;;; >>>>>>>> Narkoman's Script by [StingeR] ver: 3.5   All Rights Reserved. Copyright Narkoman's™ 2008 <<<<<<<<<< ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;; >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> создатель - [StingeR] <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;; >>>>>>>>>>>>> Об ошибках пишите на: StingeRuleZ@mail.ru  <<<<<<<<<<<< ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 
;;;;;;;;;;;;;;; >>>>>>>>>>>>>>>>>>>>> Официальный сайт скрипта: http://chan456.ucoz.ru <<<<<<<<<<<<<<<<<<<<<<<<<<<< ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;ЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇ
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Старт скрипта ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;              
on *:start: {
  backup
  /loading
  /loading.label Загрузка...
  /loading.add 10
  iconsset 
  inc %ScripTRunNum 
  inc %nirc.start
  /gstart
  if (%startsound == on) && (%nirc.start != 1) && (%musik.patch != $null) { splay -w %musik.patch }
  /loading.add 40
  if (%nirc.start == 2) { /anim }
  if (%mircraz == 1) { showmirc -x }
  /loading.add 60
  if (%statusraz == 1) { window -ax "Status Window" }
  if (%mirctray == 1) { showmirc -t }
  /loading.add 80
  /startupmsg
  /loading.add 100
  .timer -m 1 500 loading
}
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
on ^*:join:#:{ 
  haltdef  
  if ($nick == $me) { echo # $time(%stamp.style) %skinpref %ti_pripersia $chan }
  if ($nick != $me) { 
    echo # $time(%stamp.style) %skinpref $nick 12(10 $address 12) %pripersia $chan 
  }
}
on ^1:NOTICE:*NickServ IDENTIFY*:?: { 
  if (%aid == 1 ) {
    if ($me == %nck_1) { /nickserv identify %nick_pass1 }
    if ($me == %nck_1a) { /nickserv identify %nick_pass1 }
    if ($me == %nck_2) { /nickserv identify %nick_pass2 }
    if ($me == %nck_2a) { /nickserv identify %nick_pass2 }
    if ($me == %nck_3) { /nickserv identify %nick_pass3 }
    if ($me == %nck_3a) { /nickserv identify %nick_pass3 }
    if ($me == %nck_4) { /nickserv identify %nick_pass4 }
    if ($me == %nck_4a) { /nickserv identify %nick_pass4 }
    if ($me == %nck_5) { /nickserv identify %nick_pass5 }
    if ($me == %nck_5a) { /nickserv identify %nick_pass5 }
  }
  if (%auto.csop == 1) { /cs op }
}
on *:connect: {
  if (%aid == 1 ) {
    if ($me == %nck_1) { /nickserv identify %nick_pass1 }
    if ($me == %nck_1a) { /nickserv identify %nick_pass1 }
    if ($me == %nck_2) { /nickserv identify %nick_pass2 }
    if ($me == %nck_2a) { /nickserv identify %nick_pass2 }
    if ($me == %nck_3) { /nickserv identify %nick_pass3 }
    if ($me == %nck_3a) { /nickserv identify %nick_pass3 }
    if ($me == %nck_4) { /nickserv identify %nick_pass4 }
    if ($me == %nck_4a) { /nickserv identify %nick_pass4 }
    if ($me == %nck_5) { /nickserv identify %nick_pass5 }
    if ($me == %nck_5a) { /nickserv identify %nick_pass5 }
  }
}
on @100:BAN:#: {
  if ($banmask == *!*) && ($banmask == *!*@*) halt
  if (%banprot == ON) && ($nick != $me) && ($me isop #) {
    mode $chan +b $nick $mask($address($nick,0),2) | mode $chan -b $banmask 
    .timerG 1 1 kick $chan $nick маска бана на мою похожа! < $+ %kick $+ >
    %lse Снимаю с тебя бан на канале $chan (4поставлен ником $nick 4на $banmask $+ )
  }
}
on *:op:#:{ 
  if ($opnick == $me) && ($chan) && (%autoie.enabled.op == on) {
    mode $chan +e $me $address($me,2) $me $address($me,2)
  } 
  .timer 1 0 colorize $chan
}
on *:help:#:{ 
  if ($hnick == $me) && ($chan) && (%autoie.enabled.hop == on) {
    mode $chan +e $me $address($me,2) $me $address($me,2)
  } 
  .timer 1 0 colorize $chan
}
on *:DEOP:#: {
  .timer 1 0 colorize $chan
  if ($me == $opnick) {
    if (%deopgtzs == on) { /dll sys\Dlls\game_tools.dll splay %medeop } 
  }
}
on *:DEHELP:#: {
  .timer 1 0 colorize $chan
}
on *:exit: {
  if (%saveini.fx == 1) {
    /loading
    /loading.label Сохранение настроек....
    /loading.add 10
    /loading.add 40
    /saveini
    /loading.add 60
    /loading.add 100
    .timer -m 1 500 loading
  }
}
on ^*:PART:#: {
  haltdef 
  if ( $nick != $me ) {
    echo # $time(%stamp.style) %skinpref $nick 12(10 $address 12) %vishel $chan 12[14 $1- 12]
  }
}
on *:ctcpreply:version*: {
  haltdef
  /dll sys\Dlls\game_tools.dll splay %x.vers1me | echo $color(ctcp) -ta 3[ $+ $nick $+ 3] Версия: $2-
}
on *:ctcpreply:time*: {
  haltdef
  /dll sys\Dlls\game_tools.dll splay %x.time1me | echo $color(ctcp) -ta 3[ $+ $nick $+ 3] Время: $2-
}
on *:ctcpreply:ping*: {
  haltdef
  /dll sys\Dlls\game_tools.dll splay %x.pongtome | echo $color(ctcp) -ta 3[ $+ $nick $+ 3] Пинг: $2-
}
on *:ctcpreply:finger*: {
  haltdef
  /dll sys\Dlls\game_tools.dll splay %finger.snd | echo $color(ctcp) -ta 3[ $+ $nick $+ 3] Финжер: $2-
}
on *:ctcpreply:**: {
  haltdef
  echo $color(ctcp) -ta 3[ $+ $nick $+ 3] $1 $+ : $2-
}
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;; Разные скрипты ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
alias msg if ($server) msg $1-
alias ss {
  if ($1- != $null) && ($server) .msg seenserv $1-
}  
alias ns {
  if ($1- != $null) && ($server) /nickserv $1-
}  
alias cs {
  if ($1- != $null) && ($server) /chanserv $1-
}  
alias op { if ($server) { mode # +ooo $$1 $2 $3 } }
alias dop { if ($server) { mode # -ooo $$1 $2 $3 } }
alias j { if ($server) { join #$$1 $2- } }
alias p { part # }
alias n { if ($server) { names #$$1 } }
alias e { if (!$1-) { exit Narkoo Script 3.5 www.first-net.narod.ru } | else { exit $1- } }
alias w { if ($server) { whois $$1 } }
alias k { if ($server) { kick # $$1 $2- } }
alias q { if ($server) { query $$1 } }
alias send { dcc send $1 $2 }
alias chat { dcc chat $1 }
alias ping { ctcp $$1 ping }
alias s { if (!$1) { server } | else { server $$1- } }
alias gt showmirc -t
alias mircreg { run sys\nirc.reg }
alias views return sys\dlls\Views.mdx
alias dialogs return sys\dlls\dialog.mdx
alias ctl return sys\dlls\ctl_gen.mdx
alias bars return sys\dlls\bars.mdx
alias mdxload { mdx SetMircVersion $version | mdx MarkDialog $dname $dialog($dname).hwnd }
alias mdx {
  if ($isid) return $dll(sys\dlls\mdx.dll,$1,$2-)
  else dll sys\dlls\mdx.dll $1-
}
alias clearlogs {
  if ($input(Вы точно хотите удалить все логи?,ys,Предупреждение,Предупреждение,text) = $false) { halt }
  :logvs
  set %search $findfile($logdir,*.log,1)
  set %search.v $nopath(%search)
  if (!%search.v) { unset %search.v | unset %search | if ($input(Все логи удалены!,o,Сообщение,title) == $true) { halt } | return }
  .remove $+(",%search,")
  goto logvs
}
alias popups {
  if ($isid) return $dll(sys\dlls\popups.dll,$1,$2-)
  else dll sys\dlls\popups.dll $1-
}
alias icl return Pics\
alias mdxlist {
  did -i $dname $1- 1 setbkg color $color($color(back))
  did -i $dname $1- 1 settxt bgcolor $color($color(back))
  did -i $dname $1- 1 settxt color $color($color(normal))
}
;###################################################################################################################
;#########################################  LOADING  ###############################################################
;###################################################################################################################
alias loading { if ($dialog(loading)) { dialog -x loading } | else { dialog -mo loading loading } }
alias loading.add { if ($dialog(loading)) { did -a loading 2 $1- } }
alias loading.label { if ($dialog(loading)) { did -ra loading 1 $1- } }
dialog loading {
  title "Loading..."
  size -1 -1 200 28
  text "", 2, 5 5 190 20
  text "", 1, 5 30 190 18, center
}
on *:dialog:loading:init:*: {
  dll sys\Dlls\mdx.dll MarkDialog loading
  dll sys\Dlls\mdx.dll SetDialog loading style 0 dlgmodal
  dll sys\Dlls\mdx.dll SetControlMDX loading 2 ProgressBar smooth > sys\Dlls\ctl_gen.mdx
  dll sys\Dlls\mdx.dll SetFont loading 1 14 700 Tahoma
  did -b loading 1
}
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
alias xpopdll {
  if ($isid) return $dll(sys\Dlls\xpopup.dll,$1,$2-)
  else dll " $+ sys\Dlls\xpopup.dll" $1 $2-
}
alias uxpop dll -u xpopup.dll
alias xpop {
  if ( $isid ) {
    return $xpopdll( _xpop, $1 $prop $2- )
  }
  else {
    xpopdll xpop $2 $1 $3-
  }
}
alias xpopup {
  if ( $isid ) {
    return $xpopdll( _xpopup, $1 $prop $2- )
  }
  else {
    xpopdll xpopup $2 $1 $3-
  }
}
alias mpopup {
  xpopdll mpopup $1 $2
}
ON *:SIGNAL:Xpopup-*: { 
  echo -s $signal : $1-
}
alias mtest {
  xpopup -i mirc 0 $shell
  mpopup mirc 1
  xpopup -t mirc %menustyle
  xpopup -b mirc icons\menu.bmp
}
alias mtest2 {
  xpopup -i mircbar 0 $shell
  mpopup mircbar 1
  xpopup -t mircbar %menustyle
  xpopup -b mircbar icons\menu.bmp
}
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
alias chgmode {
  set %first -3
  :mode1
  inc %curcle
  inc %first 4 | inc %second 4
  if ( %curcle > $calc($int($calc($snick($chan,0) / 4 )) + 1) ) { unset %first | unset %curcle | unset %first | unset %second | goto next }
  else { mode $chan $$1 $replace($gettok($snick($chan),%first $+ - $+ %second,44),$chr(44),$chr(32)) | goto mode1 }
  :next 
  set %first -3
  :mode2
  if ( $2 != $null ) {
    inc %curcle
    inc %first 4 | inc %second 4
    if ( %curcle > $calc($int($calc($snick($chan,0) / 4 )) + 1) ) { unset %first | unset %curcle | unset %first | unset %second | halt }
    else { mode $chan $$2 $replace($gettok($snick($chan),%first $+ - $+ %second,44),$chr(44),$chr(32)) | goto mode2 }
  }
  else { unset %first | unset %curcle | unset %first | unset %second | halt }
}
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Дополнительные настройки ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
alias dsopt {
  if $dialog(dsopt) = $null { dialog -m dsopt dsopt }
}
dialog dsopt {
  title "Дополнительные настройки"
  size -1 -1 422 218
  option pixels
  icon sys\icons\ $+ %icons $+ \1.ico, 0
  tab "Сообщения", 1, 5 5 411 176
  box "Авто текст", 610, 18 39 215 120, tab 1
  check "Здароваться при входе на канал", 601, 25 55 185 15, tab 1
  check "Прощатся при выходе с канала", 602, 25 75 185 15, tab 1
  check "Благодарить если дали войсиг", 603, 25 95 185 15, tab 1
  check "Возразить если войс сняли", 604, 25 115 185 15, tab 1
  check "Благодарить если дали оп", 605, 25 135 185 15, tab 1
  button "Редактировать сообщения", 606, 250 40 152 30, tab 1
  button "CTCP ответы", 607, 250 130 152 30, tab 1
  icon 608, 310 90 32 32,  icons\autotext.ico, tab 1
  tab "Анти Спам", 2
  check "Вырезать цвета(коды) из сообщений выхода", 22, 23 48 275 15, tab 2
  check "Не показывать цветные нотисы", 23, 23 68 189 15, tab 2
  check "Не показывать нотисы, если в них присутствует(через пробел):", 7, 23 88 357 20, tab 2
  check "Не показывать приваты, если в них присутствует(через пробел):", 9, 23 108 357 20, tab 2
  edit %dontshow, 8, 23 132 281 21, tab 2 autohs
  tab "Цв. Ники", 3
  icon 30, 90 40 15 15,  Pics\0.bmp, 0, tab 3
  icon 31, 110 40 15 15,  Pics\1.bmp, 1, tab 3
  icon 32, 130 40 15 15,  Pics\2.bmp, 2, tab 3
  icon 33, 150 40 15 15,  Pics\3.bmp, 3, tab 3
  icon 34, 170 40 15 15,  Pics\4.bmp, 4, tab 3
  icon 35, 190 40 15 15,  Pics\5.bmp, 5, tab 3
  icon 36, 210 40 15 15,  Pics\6.bmp, 6, tab 3
  icon 37, 230 40 15 15,  Pics\7.bmp, 7, tab 3
  icon 38, 250 40 15 15,  Pics\8.bmp, 8, tab 3
  icon 39, 270 40 15 15,  Pics\9.bmp, 9, tab 3
  icon 40, 290 40 15 15,  Pics\10.bmp, 10, tab 3
  icon 41, 310 40 15 15,  Pics\11.bmp, 11, tab 3
  icon 42, 330 40 15 15,  Pics\12.bmp, 12, tab 3
  icon 43, 350 40 15 15,  Pics\13.bmp, 13, tab 3
  icon 44, 370 40 15 15,  Pics\14.bmp, 14, tab 3
  icon 45, 390 40 15 15,  Pics\15.bmp, 15, tab 3
  list 101, 20 40 60 132, tab 3
  check "Разукрасить список ников", 46, 90 65 155 15, tab 3
  check "Разукрасить ники в тексте", 47, 90 85 160 15, tab 3
  check "Выделять тех, кто в Игноре (Ignore)", 48, 90 105 210 15, tab 3
  check "Выделять тех, о ком Извещает (Notify)", 49, 90 125 220 15, tab 3
  check "Выделять себя", 50, 90 145 100 15, tab 3
  tab "Авто Перевод", 5
  check "Включить автотрансляцию сообщений ghbdtn -> привет", 20, 21 42 315 15, tab 5
  check "Включить автотрансляцию действий (/me = action)", 21, 21 62 292 15, tab 5
  edit "", 100, 21 103 381 38, tab 5 multi autovs vsbar
  button "?", 6, 370 58 31 23, tab 5
  check "Включить свой автоперевод", 12, 21 82 292 15, tab 5
  text "Исключения:", 62, 21 148 72 16, tab 5
  edit %perevisk, 63, 104 145 297 21, tab 5 autohs
  tab "Вспл. Сбщ", 10
  check "Включить", 11, 21 42 79 20, tab 10
  list 13, 21 62 241 100, tab 10 size
  button "По умолчанию", 14, 310 40 98 21, tab 10
  text "Цвет попапов:", 15, 267 116 79 16, tab 10
  combo 17, 267 141 129 150, tab 10 size drop
  button "+", 16, 349 118 16 16, tab 10
  button "-", 64, 368 118 16 16, tab 10
  check "Выключать, если Away", 65, 111 42 154 20, tab 10
  button "Пример", 84, 348 89 51 21, tab 10
  edit %balloonstime, 86, 267 89 61 21, tab 10 autohs
  text "Задержка на экарне (сек):", 85, 267 69 139 16, tab 10
  tab "Разное", 55
  check "Сохранять все настройки при выходе (повышает надёжность и замедляет выкл скрипта)", 501, 27 48 350 40, multi, center, tab 55
  text "Сообщение при выходе из IRC:", 59, 27 122 165 16, tab 55
  edit %quit, 60, 27 143 166 21, tab 55 autohs
  check "Проверять клонов при заходе на канал", 24, 27 90 230 20, tab 55
  text "Сообщения при выходе c канала:", 70, 200 122 179 16, tab 55
  combo 69, 199 143 167 100, tab 55 size drop
  button "+", 71, 369 145 16 16, tab 55
  button "-", 72, 388 145 16 16, tab 55
  tab "При старте", 87
  check "Сворачивать mIRC в трей ", 56, 24 94 166 20, tab 87
  check "Разворачивать окно статуса", 88, 24 70 193 20, tab 87
  check "Разворачивать окно mIRC во весь экран", 89, 24 46 245 20, tab 87
  button "Ок", 230, 212 185 65 25, ok
  button "Отмена", 231, 352 185 65 25, cancel
  button "Применить", 232, 282 185 65 25
  box "", 4, 13 29 399 141
  button "Обращение", 53, 7 185 81 25
}
dialog help1 {
  title "Справка"
  size -1 -1 94 53
  option dbu
  icon sys\icons\ $+ %icons $+ \1.ico
  text "Список слогов (частей слов), по которым будет распознано некорректно введеное предложение, или его часть (писать через пробелы)", 1, 2 3 90 35
  button "Закрыть", 2, 55 41 37 10, ok
}
on *:DIALOG:dsopt:init:*: {
  ;tab1
  if (%autotext.hello == on) { did -c dsopt 601 }
  if (%autotext.onpart == on) { did -c dsopt 602 }
  if (%autotext.onvoice == on) { did -c dsopt 603 }
  if (%autotext.ondevoice == on) { did -c dsopt 604 }
  if (%autotext.onop == on) { did -c dsopt 605 }
  ;tab2
  did $iif(%stripquits == 1,-c,-u) dsopt 22
  did $iif(%stripcolornotices == 1,-c,-u) dsopt 23
  ;tab3
  did $iif(%usecolornicks == 1,-c,-u) dsopt 46
  did $iif(%popups == 1,-c,-u) dsopt 11
  did $iif(%dontshownotice == 1,-c,-u) dsopt 7
  did $iif(%dontshowquery == 1,-c,-u) dsopt 9
  did $iif(%usecolornicksintext == 1,-c,-u) dsopt 47
  did $iif(%nick.colorignores == 1,-c,-u) dsopt 48
  did $iif(%nick.colornotify == 1,-c,-u) dsopt 49
  did $iif(%nick.colorme == 1,-c,-u) dsopt 50
  did $iif(%clonedet == 1,-c,-u) dsopt 24
  did $iif(%saveini.fx == 1,-c,-u) dsopt 501
  did $iif(%mirctray == 1,-c,-u) dsopt 56
  did $iif($did(dsopt,46).state == 0, -b, -e) dsopt 47
  did $iif($did(dsopt,46).state == 0, -b, -e) dsopt 48
  did $iif($did(dsopt,46).state == 0, -b, -e) dsopt 49
  did $iif($did(dsopt,46).state == 0, -b, -e) dsopt 50
  did $iif($did(dsopt,46).state == 0, -b, -e) dsopt 101
  did -a dsopt 101 Я
  did -a dsopt 101 Овнер
  did -a dsopt 101 Оп
  did -a dsopt 101 Полуоп
  did -a dsopt 101 Войс
  did -a dsopt 101 Обычный
  did -a dsopt 101 Игнор
  did -a dsopt 101 Нотифи
  did -c dsopt 101 1
  set %nick.colors.temp %nick.color.my %nick.color.owner %nick.color.op %nick.color.hop %nick.color.voice %nick.color.regular %nick.color.ignore %nick.color.notify
  set %lastcolor -1
  dsdrcoloricons $did(dsopt,46).state
  ;tab5
  did -a  dsopt 100 %transdic
  did $iif(%autotranslate == 1,-c,-u) dsopt 20
  did $iif(%autotranslateact == 1,-c,-u) dsopt 21
  did $iif(%ourautotrans == 1,-c,-u) dsopt 12
  did $iif($did(dsopt,20).state == 0, -b, -e) dsopt 21
  did $iif($did(dsopt,20).state == 0, -b, -e) dsopt 100
  did $iif(%mircraz == 1,-c,-u) dsopt 89
  did $iif(%statusraz == 1,-c,-u) dsopt 88
  did -t dsopt 230
  loadpart
  loadpopups
}
on *:DIALOG:dsopt:sclick:73: { comm }    
on *:DIALOG:dsopt:sclick:606: { messagesmgr }
on *:DIALOG:dsopt:sclick:607: { ctcpmenu }
on *:DIALOG:dsopt:sclick:71: {
  if ($lines(sys\txt\part.txt) <= 10) {
    var %t = $$?"Введите причину"
    if (%t) { write sys\txt\part.txt %t | loadpart }
  }
}
on *:DIALOG:dsopt:sclick:950: {
  /awayer
  s.cl
}
alias loadpart {
  did -r $dname 69
  var %w = 1
  while (%w <= $lines(sys\txt\part.txt)) {
    did -i $dname 69 %w $gettok($read(sys\txt\part.txt,%w),1,42)
    inc %w
  }
}
on *:dialog:dsopt:edit:86: {
  if ($did(86).text && $did(86).text isnum) { set %balloonstime $did(86).text }

}
on *:DIALOG:dsopt:sclick:72: {
  if ($did(69).sel) { write -dl $+ $did(69).sel sys\txt\part.txt | loadpart }
}
on *:DIALOG:dsopt:sclick:84: { balloons Пример сообщения :) Пример сообщения :) }
on *:DIALOG:dsopt:sclick:6: { mk help1 }
on *:DIALOG:dsopt:sclick:16: { rgb }
alias loadpopups {
  mdxload
  mdx SetFont $dname 68 13 700 verdana
  mdx SetControlMDX $dname 13 listview checkboxes rowselect report single showsel > $views
  mdxlist 13
  did -i $dname 13 1 headerdims 292
  did -i $dname 13 1 headertext Событие
  loadballoons
  if (%popups == 1) { did -c $dname 11 }
  if (%popupsaway == 1) { did -c $dname 65 }
  did -r $dname 17
  var %w = 1
  while (%w <= $lines(sys\popups\Colours.txt)) {
    did -i $dname 17 %w $gettok($read(sys\popups\Colours.txt,%w),1,42)
    inc %w
  }
  did -c $dname 17 %popupscolor
}
on *:DIALOG:dsopt:sclick:64: {
  if ($did(17).sel) {
    write -dl $+ $did(17).sel sys\popups\colours.txt
    did -r $dname 17
    var %w = 1
    while (%w <= $lines(sys\popups\Colours.txt)) {
      did -i $dname 17 %w $gettok($read(sys\popups\Colours.txt,%w),1,42)
      inc %w
    }
    set %popupscolor 1
    did -c $dname 17 %popupscolor
  }
}
alias loadballoons { 
  did -r $dname 13
  var %i = 1
  while (%i <= $lines(sys\popups\popups.txt)) {
    did -a $dname 13 $gettok($read(sys\popups\popups.txt,%i),1,42)
    $iif($gettok($read(sys\popups\popups.txt,%i),2,42) == on,did -o $dname 13 $calc(%i + 1) 0 0 0 2 $gettok($did($dname,13,$calc(%i + 1)),6-,32))
    inc %i
  }
}
on *:DIALOG:dsopt:sclick:13: {
  if ($did(dsopt,13).sel) {
    did -u dsopt 16
    if ($mr($did(dsopt,13).sel, status) == 1) { did -c dsopt 16 }
  }
}
on *:DIALOG:dsopt:sclick:16: {
  if ($did(dsopt,13).sel) {
    if ($did(dsopt,16).state == 1) {
      ms $did(dsopt,13).sel status 1
    }
    else { ms $did(dsopt,13).sel status 0 }
  }
}
on *:DIALOG:dsopt:sclick:53: { dc }
on *:DIALOG:dsopt:sclick:17: { set %popupscolor $did(dsopt,17).sel }
on *:DIALOG:dsopt:sclick:14: {
  .copy -o " $+ sys\popups\def\popups.txt $+ "  " $+ sys\popups\ $+ "
  loadpopups
}
on *:DIALOG:dsopt:sclick:230,232: {
  if ($did(601).state = 1) { /set %autotext.hello on }
  if ($did(601).state = 0) { /set %autotext.hello off }
  if ($did(602).state = 1) { /set %autotext.onpart on }
  if ($did(602).state = 0) { /set %autotext.onpart off }
  if ($did(603).state = 1) { /set %autotext.onvoice on }
  if ($did(603).state = 0) { /set %autotext.onvoice off }
  if ($did(604).state = 1) { /set %autotext.ondevoice on }
  if ($did(604).state = 0) { /set %autotext.ondevoice off }
  if ($did(605).state = 1) { /set %autotext.onop on }
  if ($did(605).state = 0) { /set %autotext.onop off }
  set %ourautotrans $did(dsopt,12).state
  set %dontshownotice $did(dsopt,7).state
  set %dontshowquery $did(dsopt,9).state
  set %popups $did(dsopt,11).state
  set %popupsaway $did(dsopt,65).state
  set %mirctray $did(dsopt,56).state
  set %mircraz $did(dsopt,89).state
  set %statusraz $did(dsopt,88).state
  set %clonedet $did(dsopt,24).state
  set %saveini.fx $did(dsopt,501).state
  if ($did(dsopt,8).text) { set %dontshow $did(dsopt,8).text }
  if ($did(dsopt,60).text) { set %quit $did(dsopt,60).text }
  if ($did(dsopt,69).text) { set %part $did(dsopt,69).text }
  if ($did(dsopt,63).text) { set %perevisk $did(dsopt,63).text }
  set %nick.color.my $gettok(%nick.colors.temp,1,32)
  set %nick.color.owner $gettok(%nick.colors.temp,2,32)
  set %nick.color.op $gettok(%nick.colors.temp,3,32)
  set %nick.color.hop $gettok(%nick.colors.temp,4,32)
  set %nick.color.voice $gettok(%nick.colors.temp,5,32)
  set %nick.color.regular $gettok(%nick.colors.temp,6,32)
  set %nick.color.ignore $gettok(%nick.colors.temp,7,32)
  set %nick.color.notify $gettok(%nick.colors.temp,8,32)
  set %usecolornicks $did(dsopt,46).state
  set %usecolornicksintext $did(dsopt,47).state
  set %nick.colorignores $did(dsopt,48).state
  set %nick.colornotify $did(dsopt,49).state
  set %nick.colorme $did(dsopt,50).state
  if ($cnick(*).method == 0 && ( %usecolornicksintext == 0 || %usecolornicks == 0 )) { .cnick -r * }
  if ($cnick(*).method != 0 && %usecolornicksintext == 1 && %usecolornicks == 1 ) { .cnick -m0 * %nick.color.regular }
  if ($cnick(*).method == 0 && $cnick(*).color != %nick.color.regular) { .cnick -r * | .cnick -m0 * %nick.color.regular }
  set %autotranslate $did(dsopt,20).state
  set %autotranslateact $did(dsopt,21).state
  set %stripquits $did(dsopt,22).state
  set %stripcolornotices $did(dsopt,23).state
  set %transdic
  var %aa = 1
  while ( %aa <= $did(dsopt,100).lines ) { 
    set %transdic %transdic $did(dsopt,100,%aa).text
    inc %aa
  }
  if ($dialog(dsopt)) { buat.war27 }
  if (%autoaway == 1) { .timeraway 0 1 goautoaway } 
  if (%autoaway == 0) { .timeraway off } 
  var %is = 2
  while (%is <= $did($dname,13).lines) {
    if ($gettok($did($dname,13,%is),5,32) == 2) {
      write -l $+ $calc(%is - 1) sys\popups\popups.txt $gettok($read(sys\popups\popups.txt,$calc(%is - 1)),1,42) $+ *on
    }
    else {
      write -l $+ $calc(%is - 1) sys\popups\popups.txt $gettok($read(sys\popups\popups.txt,$calc(%is - 1)),1,42) $+ *off
    }
    inc %is
  }
}
alias newicons {
  toolbar -as sepp1 "-"
  toolbar -az2 nicks "Ники" sys\icons\ $+ %icons $+ \nicks.ico "/settingsfx" 
  toolbar -az2 noptions "Дополнительные настройки" " $+ sys\icons\ $+ %icons $+ \noptions.ico $+ " "/more" 
  toolbar -az2 notify "Менеджер уведомлений" " $+ sys\icons\ $+ %icons $+ \notify.ico $+ " "/nlist" 
  toolbar -as sepp2 "-"
  toolbar -az2 menu "Главное меню" " $+ icons\menu.ico $+ " "/menu"
  toolbar -az2 pox "Управление системой" " $+ icons\power.ico $+ " "/power"
  toolbar -as sepp3 "-"
  toolbar -az2 run3 "Narkoman's Audio Player" " $+ icons\9fx.ico $+ " "/mcmp3" 
  toolbar -az2 video "Narkoman's Video Player" " $+ icons\10fx.ico $+ " "/mplay"
  toolbar -as sepp4 "-"
  if ($swamp(WinAmpGet, INSTALLED) == $true) {
    toolbar -az2 pre "Предыдущий трек (Winamp)" " $+ sys\icons\ $+ %icons $+ \pre.ico $+ " "/ampprev" 
    toolbar -az2 play "Игра\Пауза (Winamp)" " $+ sys\icons\ $+ %icons $+ \play.ico $+ " "/winampplay" 
    toolbar -az2 stop "Стоп (Winamp)" " $+ sys\icons\ $+ %icons $+ \stop.ico $+ " "/winampstop" 
    toolbar -az2 next "Следующий трек (Winamp)" " $+ sys\icons\ $+ %icons $+ \next.ico $+ " "/ampnext" 
    if ($swamp(WinAmpGet, STATE) == PLAYING) { toolbar -p play " $+ sys\icons\ $+ %icons $+ \pause.ico $+ " }
  }
}
on *:DIALOG:dsopt:sclick:20: {
  did $iif($did(dsopt,20).state == 0, -b, -e) dsopt 21
  did $iif($did(dsopt,20).state == 0, -b, -e) dsopt 15
  did $iif($did(dsopt,20).state == 0, -b, -e) dsopt 100
}
on *:DIALOG:dsopt:sclick:46: {
  dsdrcoloricons $did(dsopt,46).state
  did $iif($did(dsopt,46).stкate == 0, -b, -e) dsopt 47
  did $iif($did(dsopt,46).state == 0, -b, -e) dsopt 48
  did $iif($did(dsopt,46).state == 0, -b, -e) dsopt 49
  did $iif($did(dsopt,46).state == 0, -b, -e) dsopt 50
  did $iif($did(dsopt,46).state == 0, -b, -e) dsopt 101
}
on *:DIALOG:dsopt:sclick:101: {
  dsdrcoloricons $did(dsopt,46).state
}
on *:DIALOG:dsopt:sclick:30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45: {
  if ($did(dsopt,46).state == 0) { return }
  var %sel = $did(dsopt,101).seltext
  var %b = $calc($did -30)
  if (%sel == Я ) { set %nick.colors.temp $puttok(%nick.colors.temp,%b,1,32) }
  if (%sel == Овнер ) { set %nick.colors.temp $puttok(%nick.colors.temp,%b,2,32) }
  if (%sel == Оп ) { set %nick.colors.temp $puttok(%nick.colors.temp,%b,3,32) }
  if (%sel == Полуоп ) { set %nick.colors.temp $puttok(%nick.colors.temp,%b,4,32) }
  if (%sel == Войс ) { set %nick.colors.temp $puttok(%nick.colors.temp,%b,5,32) }
  if (%sel == Обычный ) { set %nick.colors.temp $puttok(%nick.colors.temp,%b,6,32) }
  if (%sel == Игнор ) { set %nick.colors.temp $puttok(%nick.colors.temp,%b,7,32) }
  if (%sel == Нотифи ) { set %nick.colors.temp $puttok(%nick.colors.temp,%b,8,32) }
  dsdrcoloricons $did(dsopt,46).state
}
alias dsdrcoloricons {
  var %b
  var %sel = $did(dsopt,101).seltext

  if (%sel == Я ) { %b = $gettok(%nick.colors.temp,1,32) }
  if (%sel == Овнер ) { %b = $gettok(%nick.colors.temp,2,32) }
  if (%sel == Оп ) { %b = $gettok(%nick.colors.temp,3,32) }
  if (%sel == Полуоп ) { %b = $gettok(%nick.colors.temp,4,32) }
  if (%sel == Войс ) { %b = $gettok(%nick.colors.temp,5,32) }
  if (%sel == Обычный ) { %b = $gettok(%nick.colors.temp,6,32) }
  if (%sel == Игнор ) { %b = $gettok(%nick.colors.temp,7,32) }
  if (%sel == Нотифи ) { %b = $gettok(%nick.colors.temp,8,32) }
  if ($1 == 0) { %b = -1 }
  if (%lastcolor && ( %b == %lastcolor )) { return }
  if ( %lastcolor >= 0 ) { did -g dsopt $calc(%lastcolor +30) 1 Pics\ $+ %lastcolor $+  .bmp }
  if (%b >= 0) { did -g dsopt $calc(%b +30) 1 Pics\ $+ %b $+  _.bmp }
  set %lastcolor %b
}
dialog addr {
  title "Настройки мышки"
  size -1 -1 380 166
  option pixels
  icon sys\icons\ $+ %icons $+ \1.ico, 0
  edit %addr1, 10, 15 55 111 19, autohs
  edit %addr2, 11, 155 55 124 19, autohs
  text "Ник", 12, 132 58 25 13
  text "Текст сообщения", 13, 279 58 91 13
  box "", 14, 5 3 371 127
  button "Сохранить", 30, 239 135 65 23, ok
  button "Отмена", 31, 310 135 65 23, cancel
  text "По двойному клику на ник:", 1, 15 17 144 16
  combo 2, 164 17 193 80, size drop
}
on *:DIALOG:addr:sclick:2: {
  set %db $did($dname,2).sel
}
on *:dialog:addr:init:0: {
  did -t $dname 30
  did -ra $dname 2 ПривАД
  did -a $dname 2 Обращение
  did -a $dname 2 По 2 Обращение, по 4 приват
  did -c $dname 2 %db
  ONwindow2
  refreshTEXT2
}
on *:DIALOG:addr:edit:10: {
  if $pos($did(addr,10).text,,1) { did -i addr 10 1 $replace($did(addr,10).text,,) }
  refreshTEXT2
}
on *:DIALOG:addr:edit:11: {
  if $pos($did(addr,11).text,,1) { did -i addr 11 1 $replace($did(addr,11).text,,) }
  refreshTEXT2
}
on 1:DIALOG:addr:sclick:3: { refreshTEXT2 }
on 1:DIALOG:addr:sclick:30: {
  window -h @TEXTwindow
  set %addr1 $did(addr,10).text
  set %addr2 $did(addr,11).text
}
on 1:DIALOG:addr:sclick:32: {
  set %addr1 $did(addr,10).text
  set %addr2 $did(addr,11).text
}
alias refreshposition2 {
  if (!$dialog(addr)) { .timerTXwin off | window -c @TEXTwindow | return }
  window $iif($dialog(addr).active,-o,-u) @TEXTwindow $calc($dialog(addr).x + 15) $calc($dialog(addr).y + 120) 356 20
}
alias ONwindow2 {
  window -c @TEXTwindow
  window -hkdo +dL @TEXTwindow $calc($dialog(addr).x + 15) $calc($dialog(addr).y + 120) 356 20
  window -a @TEXTwindow
  .timerTXwin -mo 0 50 refreshposition2
}
alias refreshTEXT2 {
  clear @TEXTwindow
  var %tmp $did(addr,10).text $+ Ник $+ $did(addr,11).text $+  сообщение
  echo @TEXTwindow %tmp
}
on ^*:NOTICE:*:*: {
  if ($nick != NickServ) && ($nick != ChanServ) && ($nick != SeenServ) && ($nick != MemoServ) && ($nick != -psyBNC) && ($nick != Global) && ($nick != SecureServ) && ($nick != ScanServ) && ($nick != $network) && ($nick != freza.dmitrov.ru) {
    if (%notice.me == on) { /dll sys\Dlls\game_tools.dll splay %notice.me.snd }
  }
  if (%dontshownotice == 1) {
    if $nick == nickserv || $nick == chanserv { goto next }
    var %x $strip($1-) , %i $numtok(%dontshow,32)
    while (%i) {
      if ($gettok(%dontshow,%i,32) iswm %x) || ($gettok(%dontshow,%i,32) isin %x) {
        halt
      }
      dec %i
    }
  }
  :next
  if ($nick == nickserv) { noticefromservice $1- }
  if ($nick == chanserv) { noticefromservice $1- }
  if ($nick == seenserv) { noticefromservice $1- }
  if ($nick == memoserv) { noticefromservice $1- }
  else {
    if  ( %stripcolornotices == 0 || $count($1-,,,,,) == 0 ) { echo $color(notice) -ati2bfl - $+  $+ %nick.color.regular $+ $nick $+ - $1- } 
  }
  haltdef 
}
on *:INPUT:* {
  if (!$ctrlenter) {
    if ($left($1-,1) != $chr(47)) {
      if ($chan && $poscs($chan($chan).mode,c)) { set %string $strip(%string) }
      if (%ourautotrans == 1) {
        set %string $strip($1-)
        if ($chan) {
          var %s1 = 0
          while ($nick($chan,%s1)) {
            inc %s1
            set %string $replace(%string,$nick($chan,%s1),)
          }
        }
        if ($transdictest(%string) == 1) {
          set %string $strip($1-)
          var %x $strip($1-) , %d $numtok(%perevisk,32)
          while (%d) {
            if ($gettok(%perevisk,%d,32) iswm %x) || ($gettok(%perevisk,%d,32) isin %x) {
              goto iskl
            }
            dec %d
          }
          transtemp
          :iskl
          haltdef
          if ($chan && $poscs($chan($chan).mode,c)) { msg $active $strip(%string) | halt }
          say Автоперевод -> %string
        }
        unset %string
      }
    }
  }
}

on *:text:*:* { 
  if  (%autotranslate == 1) {
    set %string $strip($1-)
    if ($chan) && ($query) {
      var %s1 = 0
      while ($nick($chan,%s1)) {
        inc %s1
        set %string $replace(%string,$nick($chan,%s1),)
      }
    }
    if ($transdictest(%string) == 1) {
      set %string $strip($1-)
      var %x $strip($1-) , %d $numtok(%perevisk,32)
      while (%d) {
        if ($gettok(%perevisk,%d,32) iswm %x) || ($gettok(%perevisk,%d,32) isin %x) {
          goto iskl
        }
        dec %d
      }
      transtemp
      echo $color(other) -i2mbfl $iif($chan,$chan,$nick) -Перевод-: < $+ $nick $+ > %string
    }
    :iskl
    unset %string
  }
}

on *:action:*:* { 
  if  (%autotranslate == 1) {
    set %string $strip($1-)
    if ($chan) {
      var %s1 = 0
      while ($nick($chan,%s1)) {
        inc %s1
        set %string $replace(%string,$nick($chan,%s1),)
      }
    }
    if ($transdictest(%string) == 1) {
      set %string $strip($1-)
      var %x $strip($1-) , %d $numtok(%perevisk,32)
      while (%d) {
        if ($gettok(%perevisk,%d,32) iswm %x) || ($gettok(%perevisk,%d,32) isin %x) {
          goto iskl
        }
        dec %d
      }
      transtemp
      echo $color(other) -i2mbfl $iif($chan,$chan,$nick) -Перевод-: < $+ $nick $+ > %string
    }
    :iskl
    unset %string
  }
}
on *:DISCONNECT: { unset %myban }
on *:voice:#:{ 
  .timer -m 1 0 colorize $chan
}
on *:devoice:#:{ 
  .timer -m 1 0 colorize $chan
}
alias iconsset {
  if (%icons == Стандартные) {
    toolbar -r
    toolbar -d 8
    toolbar -d 8
    toolbar -d 8
    toolbar -az1 link "Громкость" icons\volume.ico "/volume" 
    toolbar -m 9 link
    toolbar -asz1 e "-"
    toolbar -m 10 e
  }
  else {
    toolbar -r
    toolbar -d 8
    toolbar -d 8
    toolbar -d 8
    toolbar -az1 link "Громкость" " $+ icons\volume.ico $+ " "/volume" 
    toolbar -m 9 link
    toolbar -asz1 e "-"
    toolbar -m 10 e
    var %i = 1
    var %u = 2
    while (%i <= 14) {
      if ($toolbar(%i).type == separator) { inc %i }
      if ($findfile(sys\icons\ $+ %icons $+ , $+ %u $+ .ico,1)) { toolbar -pz2 $toolbar(%i).name " $+ $findfile(sys\icons\ $+ %icons $+ , $+ %u $+ .ico,1) $+ " }
      else { deleteicons %i }
      inc %u
      inc %i
    }
  }
}
alias deleteicons {
  var %e = $1
  var %d = $1
  while (%e <= 50) {
    if ($toolbar(%d).name) { toolbar -d %d }
    inc %e
  }
  newicons
}
alias font_ {
  if ($1 == 0) { if ($2 == 6) { return 406 } | if ($2 == 7) { return 407 } | if ($2 == 8) { return 408 } | if ($2 == 9) { return 409 } | if ($2 == 10) { return 410 } | if ($2 == 11) { return 411 } | if ($2 == 12) { return 412 } | if ($2 == 13) { return 413 } | if ($2 == 14) { return 414 } | if ($2 == 15) { return 415 } | if ($2 == 16) { return 416 } }
}
alias fontset {
  var %i = 1
  while (%i <= $scon(0)) {
    scon %i setfont
    inc %i
  }
}
alias setfont {
  if ($chan(0) != 0) { chanfont }
  if ($query(0) != 0) { queryfont }
  remini mirc.ini fonts
  writeini -n mirc.ini fonts fstatus %font $+ , $+ $font_(0,%fontsize) $+ ,204
  writeini -n mirc.ini fonts fchannel %font $+ , $+ $font_(0,%fontsize) $+ ,204
  writeini -n mirc.ini fonts fquery %font $+ , $+ $font_(0,%fontsize) $+ ,204
  writeini -n mirc.ini fonts fnotify %font $+ , $+ $font_(0,%fontsize) $+ ,204
  writeini -n mirc.ini fonts ffinger %font $+ , $+ $font_(0,%fontsize) $+ ,204
  writeini -n mirc.ini fonts flist %font $+ , $+ $font_(0,%fontsize) $+ ,204
  writeini -n mirc.ini fonts fwwwlist %font $+ , $+ $font_(0,%fontsize) $+ ,204
  writeini -n mirc.ini fonts fchat %font $+ , $+ $font_(0,%fontsize) $+ ,204
  writeini -n mirc.ini fonts fscripts %font $+ , $+ $font_(0,%fontsize) $+ ,204
  writeini -n mirc.ini fonts flinks %font $+ , $+ $font_(0,%fontsize) $+ ,204
  font -s %fontsize %font
}
alias chanfont {
  var %q = 1 
  while (%q <= $chan(0)) {
    .font -b $chan(%q) %fontsize %font
    inc %q
  }
}
alias queryfont {
  var %q = 1 
  while (%q <= $query(0)) {
    .font -b $query(%q) %fontsize %font
    inc %q
  }
}
;==========clonescan ===========(c) Voron
alias lookChanNickClones {
  ; parameters : nick #
  if ($ialchan($address($1,2),$2,0) == 1) return
  var %nNickCount = 0
  var %aNickClones = $1
  while (%nNickCount < $ialchan($address($1,2),$2,0)) {
    inc %nNickCount
    var %aNickClones = $addtok(%aNickClones,$ialchan($address($1,2),$2,%nNickCount).nick,32)
  }
  return %aNickClones
}
alias PClones {
  if ($ishideIPDNS($remove($address($1,2),*!*@)) == 1) return 
  return  $iif($ialchan($address($1,2),$2,0) > 1,Клоны) $iif($ialchan($address($1,2),$2,0) > 1,$ialchan($address($1,2),$2,0))
}
;rgb support
alias rgb dialog -m rgb rgb
dialog rgb {
  title "Добавить свой оттенок"
  size -1 -1 162 121
  option dbu
  icon sys\icons\ $+ %icons $+ \1.ico
  scroll "", 1, 10 20 8 68, range 0 255
  scroll "", 2, 36 20 8 68, range 0 255
  scroll "", 3, 62 20 8 68, range 0 255
  text "", 4, 9 8 10 8
  text "", 5, 35 8 10 8
  text "", 6, 61 8 10 8
  edit "", 7, 96 15 47 42, disable
  edit "", 8, 7 90 16 10, disable center
  edit "", 9, 33 90 16 10, disable center
  edit "", 10, 59 90 16 10, disable center
  button "Закрыть", 11, 130 108 30 10, cancel
  box "", 12, 2 0 79 106
  text "RGB", 15, 91 66 11 8
  text "", 16, 105 66 11 8, center
  text "", 17, 118 66 11 8, center
  text "", 18, 131 66 11 8, center
  text ",", 19, 116 66 2 8, center
  text ",", 20, 129 66 2 8, center
  text "(", 21, 103 66 2 8, center
  text ")", 22, 142 66 2 8, center
  box "", 23, 88 60 58 17
  box "", 24, 80 0 80 106
  box "", 25, 91 73 52 4
  button "Добавить", 13, 104 86 30 10
}
on *:dialog:rgb:init:*:{
  mdxload
  mdx SetColor $dname 4 background $rgb(255,0,0)
  mdx SetColor $dname 5 background $rgb(0,255,0)
  mdx SetColor $dname 6 background $rgb(0,0,255)
  mdx SetFont $dname 15,26,28,29 12 700 verdana
  mdx SetBorderStyle $dname 11,28,29 staticedge
}
on *:dialog:rgb:scroll:*:{
  if ($did == 1) {
    /set %rgbred $did(1).sel
    did -ra rgb 8 %rgbred
    did -ra rgb 16 %rgbred
    colorup
  }
  if ($did == 2) {
    /set %rgbgreen $did(2).sel
    did -ra rgb 9 %rgbgreen
    did -ra rgb 17 %rgbgreen
    colorup
  }
  if ($did == 3) {
    /set %rgbblue $did(3).sel
    did -ra rgb 10 %rgbblue
    did -ra rgb 18 %rgbblue
    colorup
  }
}
on *:dialog:rgb:sclick:*:{
  if ($did == 11) {
    unset %rgbred
    unset %rgbgreen
    unset %rgbblue
    dialog -c rgb
  }
  if ($did == 13) {
    var %t = $?="Введите название нового оттенка"
    if (%t) {
      .write sys\popups\colours.txt %t $+ * $+ %rgbred $+ , $+ %rgbgreen $+ , $+ %rgbblue
      did -r dsopt 17
      var %w = 1
      while (%w <= $lines(sys\popups\Colours.txt)) {
        did -i dsopt 17 %w $gettok($read(sys\popups\Colours.txt,%w),1,42)
        inc %w
      }
      set %popupscolor $lines(sys\popups\Colours.txt)
      did -c dsopt 17 %popupscolor

      dialog -x rgb
    }
  }
}
alias colorup {
  mdx SetColor $dname 7 background $rgb(%rgbred,%rgbgreen,%rgbblue)
}
alias mixslovo { var %t = $1 | var %len = $len(%t) | var %x = 1 | while (%x <= %len) { :back | var %y = $rand(1,%len) | if ($istok(%was,%y,32) == $true) goto back | if ($istok(%was,%y,32) == $false) { var %was = %was %y | var %out = %out $+ $mid(%t,%y,1) } | inc %x } | return %out }
alias fav {
  if $dialog(fav) = $null { dialog -m fav fav }
}
dialog fav {
  title "Между никами должен быть пробел!"
  size -1 -1 187 50
  option dbu
  icon sys\icons\ $+ %icons $+ \1.ico
  edit "", 1, 4 3 178 10, autohs
  text "Напоминание: При включение скрипта ваш ник автоматически изменяется на прописанный в панели << Настройка ников >> !!! Там вы можете вкл/выкл эту функцию", 35, 2 15 180 200
  button "Настройка ников", 26, 95 30 75 15, flat
}
on *:dialog:fav:sclick:26: {
  /settingsfx
}
on *:dialog:fav:close:0: {
  if ($did(1).text) { set %nicks $did(1).text }
}
alias fav2 {
  if $dialog(fav2) = $null { dialog -m fav2 fav2 }
}
dialog fav2 {
  title ""
  size -1 -1 187 17
  option dbu
  icon sys\icons\ $+ %icons $+ \1.ico
  edit "", 1, 4 3 178 10
}
on *:dialog:fav2:close:0: {
  if ($did(1).text) { set %chanss $did(1).text }
}
alias adchan {
  if ($lines($setdir $+ servers.txt) != 0) {
    var %chan $1
    var %i = 1
    var %network = $2
    while (%i <= $lines($setdir $+ servers.txt)) {
      if ($readini($setdir $+ connect.ini,n,$read($setdir $+ servers.txt,%i),network) == %network) { 
        if (%chan !isin $readini($setdir $+ connect.ini,n,$read($setdir $+ servers.txt,%i),ajoin)) { nsc $read($setdir $+ servers.txt,%i) ajoin $readini($setdir $+ connect.ini,n,$read($setdir $+ servers.txt,%i),ajoin) $+ , $+ %chan | echo -a 4 Канал добавлен в автозаход сети %network | goto end } 
        if (%chan isin $readini($setdir $+ connect.ini,n,$read($setdir $+ servers.txt,%i),ajoin)) { nsc $read($setdir $+ servers.txt,%i) ajoin $remove($readini($setdir $+ connect.ini,n,$read($setdir $+ servers.txt,%i),ajoin), %chan $+ $chr(44)) | echo -a 4 Канал удален из автозахода сети %network }
        else { echo -a 4 Канал уже есть }      
      }
      inc %i
    }  
  }
  :end
}
alias checkchan {
  if ($lines($setdir $+ servers.txt) != 0) {
    var %chan $1
    var %i = 1
    while (%i <= $lines($setdir $+ servers.txt)) {
      if ($readini($setdir $+ connect.ini,n,$read($setdir $+ servers.txt,%i),network) == $network) { 
        if (%chan !isin $readini($setdir $+ connect.ini,n,$read($setdir $+ servers.txt,%i),ajoin)) { return ok | goto end }
        else { return neok }
      }
      inc %i
    }  

  }
  halt
  :end
}
alias doprog {
  var %q = 1 
  while (%q <= $lines($qlinktxt)) {
    if ($gettok($read($qlinktxt,%q),4,42) == 1) { run " $+ $gettok($read($qlinktxt,%q),2,42) $+ " }
    inc %q
  } 
}
alias nicks {
  if (!$dialog(nicks)) { dialog -ma nicks nicks } | else { dialog -av nicks }
}
alias more {
  if (!$dialog(dsopt)) { dialog -ma dsopt dsopt } | else { dialog -av dsopt }
}
alias adfoto { 
  var %foto = $dir="Выбирите Фото..." c:\*.jpg  
  var %foto " $+ %foto $+ " 
  if (%foto) {
    .background -adp %foto
  }
}
alias addwall { 
  var %foto = $dir="Выбирите файл..." c:\*.jpg  
  var %foto " $+ %foto $+ " 
  if (%foto) {
    .background -an %foto
  }
}

alias mdir {
  if (!$1) { run $mircdir }
  else { run $finddir($mircdir,$1,1) }
}
;================Topic center (C) Voron, some fix by _TRANE_
alias tc mk TopicModelator
dialog TopicModelator {
  title "Топики"
  size -1 -1 610 156
  option pixels
  icon $icl $+ tips.ico
  box "", 1, 5 43 600 40
  box "", 2, 5 77 600 50
  text "Текст Топика : ", 100, 15 57 100 15
  edit "", 101, 95 55 500 22, autohs
  check "Вкл / Выкл Стиль :", 103, 15 95 115 15
  combo 104, 133 92 158 206, drop
  button "Установить", 300, 508 95 87 22
  box "", 1000, 5 -1 600 50
  text "Канал:", 3, 302 95 37 16
  combo 4, 346 92 146 180, size drop
  button "Закрыть", 5, 528 131 75 19, cancel
  text "Осталось:", 6, 7 130 56 16
  text "", 7, 74 130 35 16
  text "символов", 8, 112 130 50 16
}
on 1:DIALOG:TopicModelator:init:0: { TopicExtract | reflen }
on 1:DIALOG:TopicModelator:close:0: { .timerTopicModelatorShow01position off | close -@TopicModelatorShow01 | TopicModelatorShow off | unset %chantopic }
alias TopicModelator { if ($dialog(TopicModelator) == $null)  dialog -m TopicModelator TopicModelator | else dialog -v TopicModelator }
alias TopicExtract {
  if ($active ischan) { did -ca TopicModelator 4 $chan($active) }
  var %nCount = 0
  while (%nCount < $lines(sys\txt\TopicIDX.txt)) {
    inc %nCount
    did -a TopicModelator 104 $read -l $+ %nCount sys\txt\TopicIDX.txt
  }
  var %k = 1
  while (%k <= $chan(0)) {
    if ($chan($active) != $chan(%k)) { did -i TopicModelator 4 %k $chan(%k) }
    inc %k
  }
  did -c TopicModelator 104 1
  if (%cTopicModelator.TargetTopic == $null) {  did -c TopicModelator 103 }
  else { did -ra TopicModelator 101 %cTopicModelator.TargetTopic }
  TopicModelatorShow on
  TopicModelatorShow refresh

}
alias reflen { if ($did(103).state == 1) { did -ra $d 7 $calc(308 - $calc($len($did(TopicModelator,101).text) + $len($read -l $+ $did(TopicModelator,104).sel sys\txt\Topic.txt))) } | if ($did(103).state == 0) { did -ra $d 7 $calc(308 - $calc($len($did(TopicModelator,101).text))) } }
on 1:DIALOG:TopicModelator:sclick:4: { set %chantopic $did(4).seltext  }
on 1:DIALOG:TopicModelator:edit:101: { TopicModelatorShow refresh | reflen }
on 1:DIALOG:TopicModelator:sclick:103: { TopicModelatorShow refresh | reflen }
on 1:DIALOG:TopicModelator:sclick:104: { TopicModelatorShow refresh | reflen }
on 1:DIALOG:TopicModelator:sclick:300: { 
  if ($did(101).text) {
    set %chantopic $did(4).text
    if ($server != $NULL ) { topic %chantopic $TopicModelatorBuild }
    window -a %chantopic
    unset %chantopic
  }
}
on 1:DIALOG:TopicModelator:sclick:301: { TopicModelatorShow off }
alias TopicModelatorShow {
  if ($1 == on) {
    window -c @TopicModelatorShow01
    window -hkdo +dL @TopicModelatorShow01 $calc($dialog(TopicModelator).x + 10) $calc($dialog(TopicModelator).y + 30) 592 36
    window -a @TopicModelatorShow01
    dialog -v TopicModelator
    .timerTopicModelatorShow01position -mo 0 250 TopicModelatorShow refreshposition
  }
  if ($1 == refresh) { 
    clear @TopicModelatorShow01
    echo @TopicModelatorShow01 $TopicModelatorBuild  $+ 
  }
  if ($1 == refreshposition) {
    window $iif($dialog(TopicModelator).active,-o,-u) @TopicModelatorShow01 $calc($dialog(TopicModelator).x + 10) $calc($dialog(TopicModelator).y + 30) 592 36
  }
  if ($1 == off) { unset %chantopic
    window -c @TopicModelatorShow01
    .timerTopicModelatorShow01position off
  }
}
alias TopicModelatorBuild {
  if ($did(TopicModelator,103).state) {
    var %cBuildTopic
    var %cBuildTopic = $read -l $+ $did(TopicModelator,104).sel sys\txt\Topic.txt
    var %cBuildTopic = $replace(%cBuildTopic,&looksharpCustomText,$did(TopicModelator,101).text)
    return %cBuildTopic
  }
  else return $iif($did(TopicModelator,101).text != $null,$did(TopicModelator,101).text,$LookVer)
}

;ЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇ
;;;;;;;;;;;;;;; >>>>>>>> Narkoman's Script by [StingeR] ver: 3.5   All Rights Reserved. Copyright Narkoman's™ 2008 <<<<<<<<<< ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;; >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> создатель - [StingeR] <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;; >>>>>>>>>>>>> Об ошибках пишите на: StingeRuleZ@mail.ru  <<<<<<<<<<<< ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 
;;;;;;;;;;;;;;; >>>>>>>>>>>>>>>>>>>>> Официальный сайт скрипта: http://chan456.ucoz.ru <<<<<<<<<<<<<<<<<<<<<<<<<<<< ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;ЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇ
