;IRcap8 9e32563012d1962998bdb5334a0b7a8c

alias IDIOMA.int {
  %base = es
  if %base == $1 { goto idiofin }
  porcentaje <ini> $calc($findfile("lng\ $+ %base $+ \",*.ini,0) + $findfile("lng\ $+ %base $+ \",*.lnh,0))
  var %i = 1
  :L0
  var %f = $nopath($findfile("lng\ $+ %base $+ \",*.*,%i))
  if (%f) {
    if $right(%f,3) == ini { porcentaje Processing %f | idioma.ini %base $1 %f }
    if $right(%f,3) == lnh { porcentaje Processing %f | idioma.hash %base $1 %f }
    inc %i
    goto L0
  }
  :idiofin
  if %setup.tmp.iditx != off {
    var %t = $gettok($nopath(%tematxt),1,45)
    if ($findfile(skin\,%t $+ - $+ $1 $+ .tti,1)) tematxt $remove($ifmatch,.tti,$mircdir) $gettok(%tematxt,2,32)
  }
  idioma.toltip $1 $2
  porcentaje <fin>
  dina.fin
}

alias IDIOMA.hash {
  if ($hget(base)) hfree base | .hmake -s BASE | hload BASE "lng\ $+ $1 $+ \ $+ $3 $+ "
  if ($hget(elegido)) hfree elegido | .hmake -s ELEGIDO | if ($exists("lng\ $+ $2 $+ \ $+ $3 $+ ")) hload ELEGIDO "lng\ $+ $2 $+ \ $+ $3 $+ "
  .remove "lng\ $+ $2 $+ \resultado.tmp"
  var %i = 1
  :L1
  var %ii = $read -l $+ %i "lng\ $+ $1 $+ \ $+ $3 $+ "
  if (%ii) {
    var %vo = $hget(BASE,%ii)
    var %vt = $hget(ELEGIDO,%ii)
    if (!%vt) { 
      if ($left(%vo,1) == !) { var %vt = !~ $+ $mid(%vo,2,9999) }
      else { var %vt = ~ $+ %vo }
    }
    write "lng\ $+ $2 $+ \resultado.tmp" %ii
    write "lng\ $+ $2 $+ \resultado.tmp" %vt
    inc %i 2
    goto L1
  }
  .remove "lng\ $+ $2 $+ \ $+ $3 $+ "
  .rename "lng\ $+ $2 $+ \resultado.tmp" "lng\ $+ $2 $+ \ $+ $3 $+ "
  hfree base | hfree elegido
}

alias IDIOMA.ini {
  var %sec =
  var %i = 1 , %eof = $lines("lng\ $+ $1 $+ \ $+ $3 $+ ")
  .remove "lng\ $+ $2 $+ \resultado.tmp"
  :L1
  var %a = $read("lng\ $+ $1 $+ \ $+ $3 $+ ",n,%i)
  if ($left(%a,1) == $chr(91)) { write "lng\ $+ $2 $+ \resultado.tmp" %a | var %sec = %a | goto L2 }
  if (%a) {
    var %valor = $gettok(%a,1,61)
    var %dest = $readini("lng\ $+ $2 $+ \ $+ $3 $+ ",n,$remove(%sec,$chr(91),$chr(93)),%valor)
    if (!%dest) { var %dest = ~ $+ $gettok(%a,2-,61) }
    write "lng\ $+ $2 $+ \resultado.tmp" %valor $+ = $+ %dest
  }
  :L2
  inc %i | if %i <= %eof goto L1
  .remove "lng\ $+ $2 $+ \ $+ $3 $+ "
  .rename "lng\ $+ $2 $+ \resultado.tmp" "lng\ $+ $2 $+ \ $+ $3 $+ "
  unset %a
}

alias IDIOMA.toltip {
  if $1 == $2 return
  var %i = 1 , %f1 = lng\ $+ $1 $+ \misc.ini , %f2 = lng\ $+ $2 $+ \misc.ini
  :L1
  var %l = $readini(%perfil,bar,%i)
  if (%l) {
    var %f = $gettok(%l,1,44) , %i2 = 1
    :L2
    var %l2 = $readini(%f2,tooltip,%i2)
    if (%l2) {
      if %l2 == %f { 
        var %r = $puttok(%l,$readini(%f1,tooltip,%i2),1,44)
        writeini %perfil bar %i %r
        goto L3 
      }
      inc %i2
      goto L2
    }
    :L3
    inc %i | goto L1
  }
  raya
}


alias CFG.GUARDA {
  var %tic = $ctime , %fi = " $+ $1- $+ " , %c = write %fi
  write -c %fi Configuración IRcap +8.x - # no editar #
  %c $date
  %c [VARIABLES]

  var %x = raznopriv fsn fsnu dcque.max dcque.umax dcv.max dcv.min mod^texto mod^ncomp autoaw away.nick away.seg away.tx1 away.tx2 away.aum
  %x = %x away.canal away.canalno spam.txt sfiltro cckikt avp dir.video dir.audio banner.mp3 razcontes pcpanel.c  pcpanel.p


  var %n = 1
  :L1
  var %i = $gettok(%x,%n,32) | if (!%i) goto L2
  %c %i % [ $+ [ %i ] ] | inc %n | goto L1
  :L2
  %c [GRUPOS]
  var %x = #cuac #mi^nick #mod^ncomp #mod^correc #mod^conv #mod^ascii #contadorkicks #hotlwhois
  var %n = 1
  :L3
  var %i = $gettok(%x,%n,32) | if (!%i) goto L4
  %c %i $group(%i) | inc %n | goto L3
  :L4
  %c [USUARIOS]
  var %n = 1
  :L5
  var %i = $ulist(*,%n) | if (!%i) goto L6
  %c $level(%i) %i $ulist(*,%n).info | inc %n | goto L5
  :L6
  %c [NOTIFY]
  var %n = 1
  :L7
  var %i = $notify(%n) | if (!%i) goto L8
  %c %i $+  $+ $notify(%n).note | inc %n | goto L7
  :L8
  %c [VARIOS]
  %c skin %skin

  echo -ste $logo $mg(cfg1,$calc($ctime - %tic),%fi)
  dina.fin
}

alias CFG.LEE {
  var %fi = " $+ $1- $+ "
  var %v = $read -l1 %fi | if ($left(%v,5) == /echo) { play -c $me %fi 0 | return }
  echo -ste $logo $mg(cfg2) ( %fi ) $read -l2 %fi
  var %n = 4
  :L1
  var %i = $read -l $+ %n %fi | inc %n
  if (!%i) || (%i == [GRUPOS]) goto L2
  if ($gettok(%i,2-999,32)) set % $+ [ $gettok(%i,1,32) ] $gettok(%i,2-999,32)
  goto L1
  :L2
  :L3
  var %i = $read -l $+ %n %fi | inc %n
  if (!%i) || (%i == [USUARIOS]) goto L4
  if ($group($gettok(%i,1,32))) { if $gettok(%i,2,32) == on .enable $gettok(%i,1,32) | else .disable $gettok(%i,1,32) }
  goto L3
  :L4
  :L5
  var %i = $read -l $+ %n %fi | inc %n
  if (!%i) || (%i == [NOTIFY]) goto L6
  .auser $gettok(%i,1,32) $gettok(%i,2,32) | .iuser $gettok(%i,2,32) $gettok(%i,3-999,32)
  goto L5
  :L6
  :L7
  var %i = $read -l $+ %n %fi | inc %n
  if (!%i) || (%i == [VARIOS]) goto L8
  var %ny = $gettok(%i,1,22)
  .notify %ny $iif($gettok(%i,2,22) != $false,$gettok(%i,2-,22))
  goto L7
  :L8
  if ($server) { notify }
  .play -ctVARIOS $me %fi 0
  echo -ste $logo $mg(cfg3)
  dina.fin
}

alias dina.fin .timerDINAFIN 1 1 .unload -rs $shortfn($script)
;EOF-dt
