[script]
n0=menu menubar {
n1=  Стилизатор
n2=  .$iif(%Style5,$style(1)) Английские буквы:if (%Style5) { unset %Style5 } | else { set %Style5 on }
n3=  .$iif(%Style7,$style(1)) Шепелявить:if (%Style7) { unset %Style7 } | else { set %Style7 on }
n4=  .$iif(%Style8,$style(1)) Без Shift (7  ?;1  !):if (%Style8) { unset %Style8 } | else { set %Style8 on }
n5=  .$iif(%Style9,$style(1)) Ставить точку.:if (%Style9) { unset %Style9 } | else { set %Style9 on }
n6=  .$iif(%Style10,$style(1)) Первая большая:if (%Style10) { unset %Style10 } | else { set %Style10 on }
n7=  .$iif(%Style11,$style(1)) © $me:if (%Style11) { unset %Style11 } | else { set %Style11 on }
n8=  .-
n9=  .$iif(%Style6,$style(1)) Автозамена!:dialog -m AutoReplace AutoReplace
n10=}
n11=on *:INPUT:* {
n12=  if (!$ctrlenter) {
n13=    haltdef
n14=    StyleSay $1-
n15=  }
n16=}
n17=;======== Обработка введенного текста
n18=alias StyleSay {
n19=  if ($left($1-,1) == /) { $1- | halt }
n20=  set %StyleSay $1-
n21=  ;=== вырезает цвета из сообщения, если комната не пропускает их (+c)
n22=  if ($chan && $poscs($chan($chan).mode,c)) { set %StyleSay $strip(%StyleSay,c)) }
n23=  if (%Style2) { set %StyleSay $Style2(%StyleSay) }
n24=  elseif (%Style1) { set %StyleSay $Style1(%StyleSay) }
n25=  if (%Style4) { set %StyleSay $Style4(%StyleSay) }
n26=  elseif (%Style3) { set %StyleSay $Style3(%StyleSay) }
n27=  if (%Style5) { set %StyleSay $Style5(%StyleSay) }
n28=  if (%Style6) { set %StyleSay $Style6(%StyleSay) }
n29=  if (%Style7) { set %StyleSay $replace(%StyleSay,р,л,ж,з,ч,с,ш,с) }
n30=  if (%Style8 && $right(%StyleSay,1) == 7) { set %StyleSay $left(%StyleSay,$calc($len(%StyleSay)-1)) $+ ? }
n31=  if (%Style8 && $right(%StyleSay,1) == 1) { set %StyleSay $left(%StyleSay,$calc($len(%StyleSay)-1)) $+ $chr(33) }
n32=  if ($right(%StyleSay,1) != $chr(33) && %Style9 && $right(%StyleSay,1) != $chr(63) && $right(%StyleSay,1) != $chr(46) && $right(%StyleSay,1) != $chr(133) && $right(%StyleSay,1) != $chr(58)) { set %StyleSay %StyleSay $+ $chr(46) }
n33=  if (%Style10) { set %StyleSay $Style10(%StyleSay) }
n34=  if (%Style11) { set %StyleSay %StyleSay © $me }
n35=  if (%StyleSay) msg $active %StyleSay
n36=}
n37=;======== Стили (алиасы)
n38=alias -l Style1 {
n39=  unset %tmp | set %i 1
n40=  While ($mid($1-,%i,1)) {
n41=    if ($mid($1-,%i,1) == $chr(32)) { set %tmp %tmp $chr(32) }
n42=    elseif ($calc(%i / 2) != $round($calc(%i / 2),0)) { set %tmp %tmp $+ $iif($asc($mid($1-,%i,1)) > 223,$chr($calc($asc($mid($1-,%i,1)) - 32)),$upper($mid($1-,%i,1))) }
n43=    else { set %tmp %tmp $+ $iif($asc($mid($1-,%i,1)) > 191 && $asc($mid($1-,%i,1)) < 224,$chr($calc($asc($mid($1-,%i,1)) + 32)),$lower($mid($1-,%i,1))) }
n44=    inc %i
n45=  }
n46=  unset %i | return %tmp
n47=}
n48=alias -l Style2 {
n49=  unset %tmp | set %i 0
n50=  While ($mid($1-,%i,1)) {
n51=    inc %i
n52=    if ($mid($1-,%i,1) == $chr(32)) { set %tmp %tmp $chr(32) }
n53=    if ($rand(0,1) == 1) { set %tmp %tmp $+ $iif($asc($mid($1-,%i,1)) > 223,$chr($calc($asc($mid($1-,%i,1)) - 32)),$upper($mid($1-,%i,1))) }
n54=    else { set %tmp %tmp $+ $iif($asc($mid($1-,%i,1)) > 191 && $asc($mid($1-,%i,1)) < 224,$chr($calc($asc($mid($1-,%i,1)) + 32)),$lower($mid($1-,%i,1))) }
n55=  }
n56=  unset %i | return %tmp
n57=}
n58=alias -l Style3 {
n59=  unset %tmp | set %i 0
n60=  While ($mid($1-,%i,1)) {
n61=    inc %i
n62=    if ($mid($1-,%i,1) == $chr(32)) { set %tmp %tmp $chr(32) }
n63=    set %tmp %tmp $+  $+ $rand(0,15) $+ $mid($1-,%i,1)
n64=  }
n65=  unset %i | return %tmp
n66=}
n67=alias -l Style4 {
n68=  unset %tmp | set %i 0
n69=  While ($mid($1-,%i,1)) {
n70=    inc %i
n71=    if ($mid($1-,%i,1) == $chr(32)) { set %tmp %tmp $chr(32) }
n72=    set %tmp %tmp $+  $+ $rand(0,15) $+ , $+ $rand(0,15) $+ $mid($1-,%i,1)
n73=  }
n74=  unset %i | return %tmp
n75=}
n76=alias -l Style5 { return $replace($1-,a,a,б,b,в,v,г,g,д,d,е,e,ё,io,ж,zh,з,z,и,i,й,i,к,k,л,l,м,m,н,n,о,o,п,p,р,r,с,s,т,t,у,u,ф,f,х,x,ц,c,ч,4,ш,sh,щ,sh,ы,i,ь,',э,e,ъ,',ю,iu,я,ia) }
n77=
n78=
n79=;======== Cтиль Автозамена
n80=alias -l Style6 {
n81=  set %i 1 | set %tmp $1-
n82=  While (%Style.AutoReplace. [ $+ [ %i ] ]) {
n83=    if ($gettok(%Style.AutoReplace. [ $+ [ %i ] ],1,44) == 2) {
n84=      set %tmp $replace(%tmp,$gettok(%Style.AutoReplace. [ $+ [ %i ] ],2,44),$gettok(%Style.AutoReplace. [ $+ [ %i ] ],3,44))
n85=    }
n86=    elseif ($gettok(%Style.AutoReplace. [ $+ [ %i ] ],1,44) == 0) {
n87=      if ($1 == $gettok(%Style.AutoReplace. [ $+ [ %i ] ],2,44) && !$2) { set %tmp $gettok(%Style.AutoReplace. [ $+ [ %i ] ],3,44) }
n88=    }
n89=    elseif ($gettok(%Style.AutoReplace. [ $+ [ %i ] ],1,44) == 1) {
n90=      set %tmp $reptok(%tmp,$gettok(%Style.AutoReplace. [ $+ [ %i ] ],2,44),$gettok(%Style.AutoReplace. [ $+ [ %i ] ],3,44),1,32)
n91=    }
n92=    inc %i
n93=  }
n94=  return %tmp
n95=}
n96=alias -l Style10 { return $Style1($left($1,1)) $+ $iif($mid($1-,2,$calc($len($1-)-1)),$ifmatch) }
n97=;======== Диологовое окно для стиля Автозамена
n98=dialog AutoReplace {
n99=  title "Авто замена"
n100=  size -1 -1 316 515
n101=  option pixels, AutoReplace
n102=  box "", 10, 0 0 310 470,  disable hide
n103=  edit "", 1, 10 40 295 20,
n104=  list 6, 10 210 295 295,  hsbar vsbar
n105=  button "Добавить", 3, 20 110 75 27,
n106=  button "Изменить", 5, 120 110 75 27,disable
n107=  edit "", 2, 10 80 295 20,
n108=  text "Слово:", 7, 10 20 75 14,
n109=  text "Заменить на:", 8, 10 60 85 14,
n110=  button "Удалить", 4, 220 110 75 27,
n111=  radio "Заменять если слово одно", 11, 20 150 275 14,
n112=  radio "Заменять все слова", 12, 20 170 275 14,
n113=  radio "Заменять все символы", 13, 20 190 275 14,
n114=  check "Включить", 9, 200 20 75 14,
n115=}
n116=on *:dialog:AutoReplace:init:*: {
n117=  did -f $dname 6
n118=  did -t $dname 3
n119=  set %Style.AutoReplace 1
n120=  While (%Style.AutoReplace. [ $+ [ %Style.AutoReplace ] ]) {
n121=    did -a $dname 6 %Style.AutoReplace. [ $+ [ %Style.AutoReplace ] ]
n122=    inc %Style.AutoReplace
n123=  }
n124=  if (%Style6) { did -c $dname 9 }
n125=}
n126=on *:dialog:AutoReplace:sclick:*: {
n127=  if ($did == 3 && $did(1) && $did(2)) {
n128=    if ($did(11).state) set %tmp 0
n129=    elseif ($did(12).state) set %tmp 1
n130=    elseif ($did(13).state) set %tmp 2
n131=    did -a $dname 6 %tmp $+ , $+ $did(1) $+ , $+ $did(2)
n132=    set %Style.AutoReplace. [ $+ [ %Style.AutoReplace ] ] %tmp $+ , $+ $did(1) $+ , $+ $did(2)
n133=    inc %Style.AutoReplace
n134=  }
n135=  if ($did == 4) {
n136=    set %tmp $calc($did(6).sel + 1)
n137=    did -d $dname 6 $did(6).sel
n138=    While (%Style.AutoReplace. [ $+ [ %tmp ] ]) {
n139=      set %Style.AutoReplace. [ $+ [ $calc(%tmp - 1) ] ] %Style.AutoReplace. [ $+ [ %tmp ] ]
n140=      inc %tmp
n141=    }
n142=    unset %Style.AutoReplace. [ $+ [ $calc(%tmp - 1) ] ]
n143=  }
n144=  if ($did == 6) {
n145=    did -r $dname 1,2
n146=    did -a $dname 1 $gettok($did($did,$did(6).sel),2,44)
n147=    did -a $dname 2 $gettok($did($did,$did(6).sel),3,44)
n148=    if ($gettok($did($did,$did(6).sel),1,44) == 0) { did -c $dname 11 | did -u $dname 12,13 }
n149=    elseif ($gettok($did($did,$did(6).sel),1,44) == 1) { did -c $dname 12 | did -u $dname 11,13 }
n150=    elseif ($gettok($did($did,$did(6).sel),1,44) == 2) { did -c $dname 13 | did -u $dname 11,12 }
n151=  }
n152=  if ($did == 9) {
n153=    if ($did(9).state == 1) { set %Style6 on }
n154=    else { unset %Style6 }
n155=  }
n156=}
