;IRcap8 7ad875304a1440b00b5c72c941cc5434
alias CCFG {
  if (!$s(1)) { .hmake -s CCFG | .hload CCFG "lng\ $+ %idioma $+ \ccfg.lnh" }
  %ccfg.canal = <global> | if $1 != $null { %ccfg.canal = $1 } | llenacanales
  guiwin @CCFG c c 482 360 $s(titl)
  %ccfg.pñ1 = 64 84 1 ccfgdatos $s(1) | if ($script(canalprot.mrc))  { %ccfg.pñ1 = %ccfg.pñ1 $+  $s(2) }
  %ccfg.tipoban = 0: *!user@host1: *!*user@host2: *!*@host3: *!*user@*.host4: *!*@*.host5: nick!user@host6: nick!*user@host7: nick!*@host8: nick!*user@*.host9: nick!*@*.host
  ccfg.lee 1 1 %ccfg.canal
  drawline @ccfg | window -wa @ccfg
  drawline @ccfg
  sss wina
}
alias -l S return $hget(ccfg,$1)

alias LLENACANALES { 
  unset %ccfg.canales | var %i = $findfile($mircdirusr,*.cch,0)
  while (%i > 0) { 
    %ccfg.canales = %ccfg.canales $+  $+ $chr(35) $+ $remove($nopath($findfile($mircdirusr,*.cch,%i)),.cch) | dec %i | if ($len(%ccfg.canales) > 600) { %i = 0 | %ccfg.canales = %ccfg.canales $+ -... } 
  }
  %ccfg.canales = <global> $+ $sorttok(%ccfg.canales,22)
}

alias CCFGDATOS {
  cuag @ccfg 16 84 448 260 $gettok(%gui.cc,1,32) | pestana @ccfg ccfg.pñ1
  %ccfg.bt = 216 34 8 CCFG+ +|240 34 8 CCFG- -|264 34 56 CCFGcopia $s(3) |380 34 68 CCFGayuda $s(4)
  %ccfg.cb = 64 38 132 ccfg.canal %ccfg.canales $+  $+ $s(5)
  if $1 == 1 {
    cuagr @ccfg 28 108 260 110 $s(6)
    cuagr @ccfg 28 244 260 84 $s(7)
    %ccfg.op = 40 196 ccf.100 $s(8) |40 124 ccf.101 $s(9) |40 148 ccf.103 $s(10) |40 304 ccf.32 $s(11) |40 256 ccf.33 $s(12) |40 280 ccf.34 $s(13) |40 172 ccf.105 $s(14) |304 142 ccf.35 $s(15) |304 166 ccf.4 $s(16) |304 214 ccf.38 $s(17) |304 190 ccf.2 $s(18)
    %ccfg.tx = 128 124 60 ccf.102|128 148 150 ccf.104|128 256 150 ccf.107|128 280 150 ccf.108|128 172 150 ccf.106
    %ccfg.cb = %ccfg.cb $+ |304 112 124 ccf.1 %ccfg.tipoban $+ ! $+ $s(19)
  }
  if $1 == 2 {
    cuagr @ccfg 364 244 88 68 $s(20)
    %ccfg.op = 44 112 ccf.6 $s(21) |44 128 ccf.8 $s(22) |44 144 ccf.10 $s(23) |44 160 ccf.15 $s(24) |44 176 ccf.17 $s(25) |44 204 ccf.19 $s(26) |44 220 ccf.20 $s(27) |44 236 ccf.36 $s(28) |44 264 ccf.13 $s(29) |44 280 ccf.37 $s(30) |44 296 ccf.12 $s(31) |216 112 ccf.25 $s(32) |216 128 ccf.26 $s(33) |216 144 ccf.27 $s(34) |216 160 ccf.28 $s(35) |216 176 ccf.21 $s(36) |216 204 ccf.22 $s(37) |216 220 ccf.23 $s(38) |216 236 ccf.24 $s(39) |216 268 ccf.2 $s(40) |216 252 ccf.39/CCFGlimcan $s(41) |376 254 ccf.29 $s(42) |376 270 ccf.30 $s(43) |376 286 ccf.31 $s(44)
    %ccfg.tx = 152 112 30 ccf.7|152 128 30 ccf.9|152 144 30 ccf.11|152 160 30 ccf.16|152 176 30 ccf.18|328 268 30 ccf.3 |424 112 30 ccf.5 $s(45) |328 252 30 ccf.40
    %ccfg.bt = %ccfg.bt $+ |152 260 12 elista_spam.txt_22_* !|152 292 12 elista_pc.prta_22_* !
    CCFGtri
    drawtext -rn @ccfg $gettok(%gui.cc,2,44) verdana 10 130 324 $s(46)
  }
  guidib @ccfg
}

alias onedit.@ccfg .timerCCF -m 1 300 CCFG.GRABA
alias onCOMBO.@ccfg {
  if ($1 == ccfg.canal) {
    if (%ccfg.canal == ...) { var %a = $sfile(usr\*.cch) | %ccfg.canal = $remove($nopath(%a),.cch) }
    ccfg.lee 1 1 %ccfg.canal
  }
  else ccfg.graba
}
alias onOPT.@ccfg ccfg.graba
alias uclick.@ccfg if $gettok(%ccfg.pñ1,3,32) == 2 ccfgtrip

alias CCFG.LEE {
  if $3 == $null { .timer -m 1 100 ccfg.lee 1 1 <global> | return }
  drawline @ccfg
  var %a = usr\ $+ $xglob($3) | unset %ccf.* | %ccfg.canal = $3
  var %i = $readini %a i dat
  var %n = 1 | :L1 | var %nn = $gettok(%i,%n,44) | if %nn != $null { %ccf. [ $+ [ %n ] ] = %nn | inc %n | goto L1 }
  var %n = $numtok(%i,44) | while (%n > 1) { if (%n != 1) && (%n != 3) && (%n != 5) && (%n != 7) && (%n != 9) && (%n != 11) && (%n != 16) && (%n != 18) && (%n != 40) { var %nn = $gettok(%i,%n,44) | %ccf. [ $+ [ %n ] ] = $conv01(%nn) } | dec %n }
  %ccf.1 = $gettok(%ccfg.tipoban,$calc(%ccf.1 + 1),22)
  %ccf.100 = $readini %a i deop
  %ccf.101 = $readini %a i modos
  %ccf.102 = $readini %a i modos2
  %ccf.103 = $readini %a i topic
  %ccf.104 = $inichr($readini %a i topic2)
  %ccf.105 = $readini %a i hola
  %ccf.106 = $inichr($readini %a i hola2)
  %ccf.107 = $inichr($readini %a i saludo)
  %ccf.108 = $inichr($readini %a i despide)
  ccfgdatos $gettok(%ccfg.pñ1,3,32)
}

alias CCFG.GRABA {
  var %a = usr\ $+ $xglob(%ccfg.canal)
  var %i
  var %n = 1 | :L1 | var %nn = %ccf. [ $+ [ %n ] ]
  if (%n != 1) && (%n != 3) && (%n != 5) && (%n != 7) && (%n != 9) && (%n != 11) && (%n != 16) && (%n != 18) && (%n != 40) { var %nn = $conv01(%nn) }
  if (%n == 1) { %nn = $gettok(%nn,1,58) }
  %i = %i $+ %nn $+ , | inc %n | if %n <= 40 goto L1 
  writeini %a i dat %i
  if %ccfg.canal == <global> { %canalcfg.pro = $readini usr\canalglobal.ini i dat }
  if $me ison %ccfg.canal { set %cpo. $+ %ccfg.canal $+ .dat %i }

  writeini %a i deop %ccf.100
  writeini %a i modos %ccf.101
  writeini %a i modos2 %ccf.102
  writeini %a i topic %ccf.103
  writeini %a i topic2 $chrini(%ccf.104)
  writeini %a i hola %ccf.105
  writeini %a i hola2 $chrini(%ccf.106)
  writeini %a i saludo $chrini(%ccf.107)
  writeini %a i despide $chrini(%ccf.108)
}

alias CONV01 if $1 == 0 return off | if $1 == 1 return on | if $1 == off return 0 | if $1 == on return 1 | return 0

alias CCFGtri {
  var %c1 = $gettok(%gui.cc,17,44) , %c2 = $gettok(%gui.cc,16,44) , %gtok = 1
  while (%gtok < 21) {
    var %a = $gettok(%ccfg.op,%gtok,124)
    var %x = $gettok(%a,1,32) , %y = $gettok(%a,2,32) | inc %y 7 | dec %x 5
    drawline -nr @ccfg %c1 1 %x %y $calc(%x - 8) $calc(%y - 4) $calc(%x - 8) $calc(%y + 4)
    drawline -nr @ccfg %c2 1 %x %y $calc(%x - 8) $calc(%y + 4)
    inc %gtok
  }
}
alias CCFGtrip {
  var %xm = $mouse.x | var %ym = $mouse.y
  var %gtok = 1 | while (%gtok < 21) {
    var %a = $gettok(%ccfg.op,%gtok,124)
    var %x = $gettok(%a,1,32) | var %y = $gettok(%a,2,32) | inc %y 2 | dec %x 14
    if $inrect(%xm,%ym,%x,%y,12,12) == $true { var %i = REPE MAXL EXCE CAPS COLO CTCP DOS FNET SPAM NOTI TACO MDEOP MBAN MKICK MJOIN FNICK MODO TOPIC SERVEROP CLON LJOIN | INFRAXcfg $gettok(%i,%gtok,32) }
    inc %gtok
  }
}

alias CCFGlimcan {
  if %ccf.39 == off && %ccfg.canal != <global> {
    .timerlimjoin $+ %ccfg.canal $+ . $+ $cid off
    if $me isop %ccfg.canal { mode %ccfg.canal -l }
  }
  if %ccf.39 == on && %ccfg.canal != <global> { limitajoins set %ccfg.canal }
}
alias CCFGglobal %ccfg.canal = <global> | ccfg.lee 1 1 %ccfg.canal | ; ggguilista reset @ccfg ccfg.ls1
alias CCFG+ var %a = #$$?=" $s(47) " | .copy usr\canalglobal.ini usr\ $+ $xglob(%a) | ccfg %a | ccfg.graba
alias CCFG- if (%ccfg.canal == $null) || (%ccfg.canal == <global>) return | var %a = $?!=" %ccfg.canal : $s(48) " | if %a == $true { remove usr\ $+ $xglob(%ccfg.canal) | unset %cpo. [ $+ [ %ccfg.canal $+ .* ] ] | ccfg }
alias CCFGcopia var %a = #$$?=" $s(49 ) " | .copy usr\ $+ $xglob(%ccfg.canal) usr\ $+ $xglob(%a) | ccfg %a | ccfg.graba
alias CCFGayuda ircapweb ayuda

on 1:close:@ccfg: ccfg.cierra
alias CCFG.cierra hfree ccfg | unset %ccfg.* %ccf.* %infrax.* | window -c @ccfg | window -c @ccfg1 | window -c @infrax | window -c @infrax1 | .unload -rs canalcfg.mrc









alias INFRAXCFG {
  %infrax.canal = %ccfg.canal
  %infrax.ti = $1
  %infrax.ni = 1
  %infrax.ls1 = 17 73 20 6 1 1 infraxcniv @infrax1 | window -c @infrax1 | window -hl @infrax1
  %infrax.pñ1 = 77 73 1 infraxdatos $s(50) $+  $+ $s(51) $+  $+ $s(52)
  leeinfrax %infrax.canal %infrax.ti %infrax.ni
  guiwin @Infrax c c 410 258
  cuagr @infrax 12 38 300 170 $s(53) $+ : $infraxnombre($1)
  infraxdatos 1
  guilista @infrax infrax.ls1
  drawline @infrax | window -wa @infrax
  infraxllenalista %infrax.ti
  titula @infrax %infrax.canal : %infrax.ti
  drawtext -ro @infrax $gettok(%gui.cc,2,44) verdana 11 19 55 $s(54)
}

alias INFRAXDATOS {
  cuag @infrax 67 73 330 170 gui | pestana @infrax infrax.pñ1
  %infrax.bt = 20 160 20 infrax+ +|20 183 20 infrax- -|20 217 20 infraxreset rset
  if $1 == 1 {
    cuagr @infrax 77 93 310 35 $s(55)
    cuagr @infrax 77 143 310 90 $s(56)
    %infrax.op = 87 103 infrax.1 $s(57) |187 103 infrax.1b $s(58) |87 163 infrax.2 $s(59) |128 163 infrax.4 $s(60) |87 203 infrax.6 $s(61)
    %infrax.tx = 208 163 33 infrax.5 $s(62) |157 203 220 infrax.7
    %infrax.cb = 246 163 122 infrax.3 %ccfg.tipoban $+ ! $+ $s(63)
  }
  if $1 == 2 {
    %infrax.op = 75 93 infrax.8 $s(64) |75 133 infrax.10 $s(65) |75 193 infrax.12 $s(66)
    %infrax.tx = 187 93 190 infrax.9 |187 133 190 infrax.11b |187 193 190 infrax.13b
    %infrax.cb = 187 153 50 infrax.11 /notice/msg $+ $s(67) |187 213 60 infrax.13 /notice/msg/Onotice/Omsg $+ $s(67)
  }
  if $1 == 3 {
    %infrax.op = 75 113 infrax.14 $s(68) |275 113 infrax.16 $s(69) |75 163 infrax.18 $s(70)
    %infrax.tx = 217 113 46 infrax.15 |347 113 33 infrax.17 $s(62) |78 183 310 infrax.19
    %infrax.cb =
  }
  guidib @infrax
}

alias LEEINFRAX {
  var %a = $readini usr\ $+ $xglob($1) $2 $3
  %infrax.1b = off
  %infrax.1 = $gettok(%a,1,172) | if %infrax.1 == 2 { %infrax.1b = on | %infrax.1 = on } | if %infrax.1 == 1 { %infrax.1b = off | %infrax.1 = on } | if %infrax.1 == 0 { %infrax.1 = off }
  %infrax.2 = $conv01($gettok(%a,2,172))
  %infrax.3 = $gettok(%a,3,172)
  %infrax.4 = $conv01($gettok(%a,4,172))
  %infrax.5 = $gettok(%a,5,172)
  %infrax.6 = $conv01($gettok(%a,6,172))
  %infrax.7 = $inichr($gettok(%a,7,172))
  %infrax.8 = $conv01($gettok(%a,8,172))
  %infrax.9 = $inichr($gettok(%a,9,172))
  %infrax.10 = $conv01($gettok(%a,10,172))
  %infrax.11 = $gettok($gettok(%a,11,172),1,32)
  %infrax.11b = $inichr($gettok($gettok(%a,11,172),2-99,32))
  %infrax.12 = $conv01($gettok(%a,12,172))
  %infrax.13 = $gettok($gettok(%a,13,172),1,32)
  %infrax.13b = $inichr($gettok($gettok(%a,13,172),2-99,32))
  %infrax.14 = $conv01($gettok(%a,14,172))
  %infrax.15 = $gettok(%a,15,172)
  %infrax.16 = $conv01($gettok(%a,16,172))
  %infrax.17 = $gettok(%a,17,172)
  %infrax.18 = $conv01($gettok(%a,18,172))
  %infrax.19 = $gettok(%a,19,172)
}

alias GRABAINFRAX {
  if %infrax.1 == off { var %a = 0 }
  if %infrax.1 == on { var %a = 1 | if %infrax.1b == on { var %a = 2 } }
  %a = %a $+ $chr(172) $+ $conv01(%infrax.2)
  %a = %a $+ $chr(172) $+ $x32(%infrax.3)
  %a = %a $+ $chr(172) $+ $conv01(%infrax.4)
  %a = %a $+ $chr(172) $+ $x32(%infrax.5)
  %a = %a $+ $chr(172) $+ $conv01(%infrax.6)
  %a = %a $+ $chr(172) $+ $x32($chrini(%infrax.7))
  %a = %a $+ $chr(172) $+ $conv01(%infrax.8)
  %a = %a $+ $chr(172) $+ $x32($chrini(%infrax.9))
  %a = %a $+ $chr(172) $+ $conv01(%infrax.10)
  %a = %a $+ $chr(172) $+ $x32(%infrax.11) $x32($chrini(%infrax.11b))
  %a = %a $+ $chr(172) $+ $conv01(%infrax.12)
  %a = %a $+ $chr(172) $+ $x32(%infrax.13) $x32($chrini(%infrax.13b))
  %a = %a $+ $chr(172) $+ $conv01(%infrax.14)
  %a = %a $+ $chr(172) $+ $x32(%infrax.15)
  %a = %a $+ $chr(172) $+ $conv01(%infrax.16)
  %a = %a $+ $chr(172) $+ $x32(%infrax.17)
  %a = %a $+ $chr(172) $+ $conv01(%infrax.18)
  %a = %a $+ $chr(172) $+ $x32(%infrax.19)
  writeini usr\ $+ $xglob($1) $2 $3 %a
}

alias infraxllenalista {
  clear @infrax1 | var %n = 1 | :L1 | var %a = $readini usr\ $+ $xglob(%infrax.canal) %infrax.ti %n | if %a == $null { guilista @infrax infrax.ls1 | drawline @infrax | return }
  aline @infrax1 %n | inc %n | goto L1
}

alias infraxcniv %infrax.ni = $2 | leeinfrax %infrax.canal %infrax.ti %infrax.ni | infraxdatos $gettok(%infrax.pñ1,3,32)

alias onedit.@infrax .timerCCF -m 1 300 X987
alias oncombo.@infrax .timerCCF -m 1 300 X987
alias onOPT.@infrax .timerCCF -m 1 300 X987

alias -l X987 grabainfrax %infrax.canal %infrax.ti %infrax.ni
alias -l X32 if ($1- == $null) return $chr(127) | else return $1-
alias -l Xdef return 0¬0¬9 : nick!*@*.host¬0¬30¬0¬¬0¬¬0¬/notice ¬0¬/Onotice ¬0¬m¬0¬30¬0¬
alias -l XGLOB if ($1 == <global>) return canalglobal.ini | else return $remove($1,$chr(35),.cch) $+ .cch

alias INFRAX+ {
  var %n = 1 | :L1 | var %a = $readini usr\ $+ $xglob(%infrax.canal) %infrax.ti %n
  if %a == $null { writeini usr\ $+ $xglob(%infrax.canal) %infrax.ti %n $Xdef | infraxllenalista %infrax.ti | infraxcniv 1 %n | ggguilista sel @infrax infrax.ls1 %infrax.ni | return }
  inc %n | goto L1
}
alias INFRAX- {
  var %n = $slinea(%infrax.ls1) | if (%n == 1) || (%n == $null) { fallo | return }
  :L1 | var %n2 = $readini usr\ $+ $xglob(%infrax.canal) %infrax.ti $calc(%n + 1)
  if (%n2 != $null) { writeini usr\ $+ $xglob(%infrax.canal) %infrax.ti %n %n2 | inc %n | goto L1 }
  remini usr\ $+ $xglob(%infrax.canal) %infrax.ti %n
  infraxllenalista %infrax.ti | infraxcniv 1 1 | ggguilista sel @infrax infrax.ls1 %infrax.ni
}
alias INFRAXreset {
  if %infrax.canal == <global> return
  var %a = usr\ $+ $xglob(%infrax.canal)
  remini %a %infrax.ti
  var %n = 1 | :L1 | var %nn = $readini usr\canalglobal.ini %infrax.ti %n | if %nn != $null { writeini %a %infrax.ti %n %nn | inc %n | goto L1 }
  infraxcfg %infrax.ti
}

alias INFRAXnombre {
  goto $1
  :REPE | return $s(71)
  :MAXL | return $s(72)
  :EXCE | return $s(73)
  :CAPS | return $s(74)
  :COLO | return $s(75)
  :CTCP | return $s(76)
  :DOS | return $s(77)
  :FNET | return $s(78)
  :SPAM | return $s(79)
  :NOTI | return $s(80)
  :TACO | return $s(81)
  :MDEOP | return $s(82)
  :MBAN | return $s(83)
  :MKICK | return $s(84)
  :MJOIN | return $s(85)
  :FNICK | return $s(86)
  :MODO | return $s(87)
  :TOPIC | return $s(88)
  :SERVEROP | return $s(89)
  :CLON | return $s(90)
}

;EOF-dt
