;IRcap8 97f3ebce2aa8c374fe01d92fe55d9e35

alias -l S return $hget(setup,$1)
alias -l MG return $replace($readini(lng\ $+ %idioma $+ \setup.ini,setup,$1),&1,$2,&2,$3,&3,$4,&4,$5)

alias setSKINS3 {
  if $1 == 2 {
    %setup.ls1 = 132 76 88 14 1 0 setupskin @hash1 | window -c @hash1 | window -hls @hash1
    cuagr @setup 250 238 320 36 $s(187)
    %setup.op = 260 204 setup.skin.tm $s(188) |408 204 setup.skin.w $s(189) |260 252 setup.skin.c $s(190) |344 252 setup.skin.f $s(191) |440 252 setup.skin.b $s(192)
    %setup.bt = 390 160 90 sskin_url $s(193) |510 160 40 sskin_masinfo $s(194) |132 288 96 sskin_load $s(195) |252 288 304 ircapweb_skins $s(196)
    sskin info %setup.skin
  }
  if $1 == 3 {
    %setup.tmp.tcolor = 
    %setup.ls1 = 132 76 88 12 1 0 setuptma @hash1
    window -c @hash1 | window -hls @hash1
    cuagr @setup 252 284 184 28 $s(197)
    %setup.pñ2 = 268 92 1 tematxtab $s(198) $+  $+ $s(80)
    %setup.cb = 132 264 96 setup.tmp.tcolor - $+ $s(204)
    tematxtab 1
  }
  if $1 == 4 {
    unset %setup.tmp1 %setup.tmp2 %setup.tmp3 | %setup.tmpdico = $mircdirskin\ $+ %skin $+ \
    cuagr @setup 132 104 440 204 $s(205)
    %setup.ls1 = 144 136 332 7 1 0 ssstbar_click @hash1 0,20,40,180
    %setup.op = 400 76 bar.lag/sskin_plbar $s(206) |512 76 bar.ply/sskin_plbar $s(207) |136 72 m.barra/sskin_bar $s(208)
    %setup.tx = 228 268 164 setup.tmp1 $s(209) |228 284 164 setup.tmp2 $s(210)
    %setup.bt = 400 280 12 sstbar_+ +|432 280 12 sstbar_- -|464 280 88 sstbar_edita $s(211) |504 132 50 sstbar_sube $s(212) |504 156 50 sstbar_baja $s(213) |400 244 12 sstbar_ico !|464 244 88 ssstbar_pre $s(214)
    guitgrid @Setup %setup.ls1 nºico $+ $s(209) $+  $+ $s(210)
  }
  if $1 == 5 {
    %setup.ls1 = 240 136 112 8 1 0 return @hash1
    cuagr @setup 176 120 344 168 $s(215)
    %setup.op = 136 72 #sidebar/sskin_sbarra $s(216)
    %setup.bt = 240 256 8 sssbar2_+ +|268 256 8 sssbar2_- -|384 132 50 sssbar2_arriba $s(212) |384 156 50 sssbar2_abajo $s(213)
    sssbar llena
  }

  if $1 == 6 {
    unset %setup.tmp1 %setup.tmp2 %setup.tmp3
    %setup.pñ2 = 160 138 1 privbar $s(284)
    cuagr @setup 132 104 440 204 $s(285)
    %setup.ls1 = 144 144 332 7 1 0 privbar_sel @hash1 0,80
    %setup.op = 136 72 #paner/sskin_paner $s(208)
    %setup.tx = 228 268 164 setup.tmp1 $s(209) |228 284 164 setup.tmp2 $s(210)
    %setup.bt = 400 280 12 privbar_+ +|432 280 12 privbar_- -|464 280 88 privbar_edita $s(211) |504 138 46 privbar_sube $s(212) |504 164 46 privbar_baja $s(213) |464 250 88 privbar_pre $s(214)
    drawtext -rn @setup $gettok(%gui.cc,2,44) verdana 10 216 252 $s(286)
    privbar llena
    pestana @setup setup.pñ2
  }

  if $1 == 7 {
    %setup.nlw = 11 | %setup.nlis = off | %setup.tmp1 = 147 100
    cuag @setup 140 90 140 176 gui $s(217)
    %setup.op = 300 100 skinafin $s(218) |300 130 skinbtex $s(219)
    %setup.tx = 544 160 24 skinr $s(220)
    DIBCOLOR | DIBNLIST
  }
  muestrasetup
  if $1 == 2 { var %i = 1 | :L1 | var %s = $finddir($mircdirskin,*.,%i,1) | if (%s) { if (temastxt !isin %s) && ($readini(%s $+ \skin.ini,skin,ver) >= 8.0) aline -l @hash1 $nopath(%s) | inc %i | goto L1 } | guilista @setup setup.ls1 | drawline @setup }
  ;  if $1 == 3 { var %idi = *- $+ %idioma $+ .tti | if %setup.skin.lg == on { var %idi = *.tti } | var %i = 1 | :L2 | var %a = $remove($nopath($findfile($mircdirskin,%idi,%i,3)),.tti) | if (%a) { aline -l @hash1 %a | inc %i | goto L2 } | guilista @setup setup.ls1 | var %a = $gettok(%tematxt,1,32) $+ .tti | stxtma info %a | drawline @setup }
  if $1 == 3 { var %i = 1 | :L2 | var %a = $remove($nopath($findfile($mircdirskin,*.tti,%i,3)),.tti) | if (%a) { if (%setup.skin.lg == on) { aline -l @hash1 %a } | else if (- $+ %idioma isin %a) || (- !isin %a) { aline -l @hash1 %a } | inc %i | goto L2 } | guilista @setup setup.ls1 | var %a = $gettok(%tematxt,1,32) $+ .tti | stxtma info %a | drawline @setup }
  if $1 == 4 { sssTbar lista }
}

alias TEMATXTAB {
  cuag @setup 252 92 320 155 gui
  pestana @setup setup.pñ2
  %setup.op = 260 292 setup.skin.c $s(200) |344 292 setup.skin.f $s(201) |260 254 setup.skin.lg/setSKINS3_3 $s(201b)
  %setup.bt = 132 288 96 stxtma_load $s(202) |444 288 116 ircapweb_temas $s(203)
  if $1 == 1 {
    var %a = $gettok(%tematxt,1,32) $+ .tti | stxtma info %a | guidib @setup
  }
  if $1 == 3 {
    drawline @setup
  }
  if $1 == 2 {
    %setup.op = %setup.op $+ |270 110 tma.addr $s(263) |270 140 #tm.lusers $s(268)
    if $group(#tm.alin) { %setup.op = %setup.op |270 170 #tm.alin/sskin_recatema $s(280) }
    guidib @setup
  }
}

alias sSKIN {
  goto $1
  :info
  cuagi @setup 250 74 320 114 gui Skin
  if $2- == $null return
  var %f = $mircdirskin\ $+ $2- $+ \skin.ini , %c = $gettok(%gui.cc,6,44) , %dt = drawtext -rcon @setup %c Arial 9 260
  drawtext -rcon @setup %c Arial 11 260 80 306 99 $readini %f SKIN nombre $iif($2- == %skin,( $mg(instal) ))
  %dt 94 306 99 $mg(autor) $readini %f SKIN autor
  %dt 106 306 99 $mg(email) $readini %f SKIN email
  %dt 118 306 99 $mg(url) $readini %f SKIN url
  %dt 130 306 99 $mg(stipo) $readini %f SKIN ver
  %dt 142 306 99 $readini %f SKIN com
  guidibbt @setup %setup.bt
  return
  :mail
  var %skmail = $readini $mircdirskin\ $+ %skin $+ \skin.ini SKIN email | if %skmail != $null { loads irmail | dmail %skmail }
  return
  :url
  var %skurl = $readini $mircdirskin\ $+ %skin $+ \skin.ini SKIN url | if %skurl != $null { url %skurl }
  return
  :masinfo
  var %skin.leem = $mircdirskin\ $+ %skin $+ \leeme.txt
  if $exists(%skin.leem) == $false { var %skin.leem = $mircdirskin\ $+ %skin $+ \readme.txt }
  if $exists(%skin.leem) == $false { var %skin.leem = $?!=" $mg(noleeme) " | return }
  run %skin.leem
  return
  :load
  setupskin 2 x $sline(@hash1,1) | return
  :whois
  %wdonde = -s | if %setup.wd == on { %wdonde = -a } | return
  :modos
  loads ezkritu | MEZKRIBE | return
  :snoti | if %@noti == on { window -k @sNotices } | else { window -c @snotices } | return
  :paner | if $group(#paner) == on { panerini on } | else { panerini off } | return
  :bar | if %m.barra == off bar off | else bar | if $group(#sidebar) == on sbarra redib | window -a @Setup | return
  :sbarra 
  if $group(#sidebar) == off { window -h @sba 0 40 0 100 | .timerSBA.* off | unset %sba.* | sssbar cierra } 
  else { /sssbar carga | sbarra }
  window -a @Setup | return
  :plbar | if %m.barra == on bar | return
  :recatema | tematxt %tematxt
}

alias SETUPSKIN {
  if $1 == 1 { sskin info $3- }
  if ($1 == 2) && ($3 != $null) { %setup.skin = $3- | skin $3- | %setup.fondo = "skin\ $+ %skin $+ \setup.png" | drawpic -cn @setup 0 0 %setup.fondo | setup.cls | setupmenu.dib %apartado | setskins2 2 | window -a @setup }
}

alias sTXTMA {
  goto $1
  :info
  if $gettok(%setup.pñ2,3,32) != 1 return
  cuagi @setup 260 100 304 72 gui
  if $2- == $null return
  var %c = $gettok(%gui.cc,6,44) , %dt = drawtext -rcon @setup %c Arial 9 270
  drawtext -rcon @setup %c Arial 11 270 108 290 99 $nopath($remove($2-,.tti)) $iif($remove($nopath($2-),.tti) == $nopath($gettok(%tematxt,1,32)),( $mg(instal) ))
  %dt 124 290 99 $mg(autor) $readini $2- INFO autor
  %dt 136 290 99 $mg(temaver) $readini $2- INFO ver
  %dt 154 290 99 $readini $2- INFO desc
  return
  :load
  setuptma 2 x $sline(@hash1,1)
}

alias SETUPTMA {
  var %a = $3- $+ .tti | %a = $findfile($mircdirskin,%a,1,3))
  if $1 == 1 { stxtma info %a | setuptxtcolor %a }
  if ($1 == 2) && ($3 != $null) { tematxt $remove(%a,.tti,$mircdir) $findtok($gettok(%setup.cb,5-,32),%setup.tmp.tcolor,22) | if $gettok(%setup.pñ2,3,32) == 2 tematxtab 2 | window -a @setup }
}

alias setuptxtcolor {
  var %i = 1 , %t
  :L1
  var %n = $readini($1-,color $+ %i,n)
  if (%n) {
    %t = %t $+ %n $+ 
    inc %i
    goto L1
  }
  %setup.tmp.tcolor = $gettok(%t,1,22) | %setup.tmp.tcolori = 1
  %setup.cb = 132 264 96 setup.tmp.tcolor %t $+  $+ $s(204)
  guidib @setup
}

alias DIBCOLOR {
  var %i = 0 , %x = $calc($gettok(%setup.tmp1,1,32) + 116) , %y = $gettok(%setup.tmp1,2,32)
  :L1
  drawrect -nf @setup 1 1 %x %y 8 8
  drawrect -nf @setup %i 1 %x %y 7 7
  inc %y 10 | inc %i | if %i < 16 goto L1
}
alias DIBNLIST {
  drawrect -nfd @setup $colour(listbox) 1 %setup.tmp1 109 157 4 4
  var %x = $calc($gettok(%setup.tmp1,1,32) + 10) , %y = $calc($gettok(%setup.tmp1,2,32) + 2)
  var %t = $mg(nlist) , %i = 1 , %l = %skinl $+ , $+ $colour(listbox text)
  :L1
  var %a = $gettok(%t,%i,124) | if (%a) {
    drawtext -npc @setup 1 arial 11 %x %y 130 15  $+ $gettok(%l,%i,44) $+ , $+ $colour(listbox) %a
    inc %i | inc %y 14 | goto L1
  }
  drawtext -npc @setup 1 arial 12 $gettok(%setup.tmp1,1,32) $calc($gettok(%setup.tmp1,2,32) - 12 + $calc(%setup.nlw * 14)) 130 15  $+ $colour(listbox text) $+ , $+ $colour(listbox) >
  drawline @setup
}

alias paner return

alias SSSBAR {
  goto $1
  :llena
  window -c @hash1 | window -hl @hash1 | var %i = 2 | :L1 | var %a = $gettok(%sbarra,%i,32) | if (%a) { aline @hash1 $remove(%a,sba.) | inc %i 2  | goto L1 } | return
  :cierra
  var %i = 1 | :L3 | if ($script(%i)) { if (sba. isin $script(%i)) { var %w = $gettok($script(%i),-2,46) | window -c @sba1. $+ %w | window -c @sba2. $+ %w | .unload -rs " $+ $script(%i) $+ " } | else { inc %i } | goto L3 }
  .timerSBA.* off
  return
  :carga
  var %i = 2 | :L4 | var %a = $gettok(%sbarra,%i,32) | if (%a) { .load -rs "s\sbar\ $+ %a $+ .mrc" | inc %i 2 | goto L4 }
}

alias SSSBAR2 {
  goto $1
  :arriba | var %a = $sline(@hash1,1).ln | if (!%a) || (%a == 1) return | var %aa = $calc(%a - 1)
  %a = $calc(%a * 2) | var %t = $gettok(%sbarra,%a,32) $gettok(%sbarra,$calc(%a + 1),32)
  %sbarra = $deltok(%sbarra,%a,32) | %sbarra = $deltok(%sbarra,%a,32)
  dec %a 2 | %sbarra = $instok(%sbarra,$gettok(%t,1,32),%a,32) | %sbarra = $instok(%sbarra,$gettok(%t,2,32),$calc(%a + 1),32)
  sbarset fix
  if ($isalias(sbarra)) { sbarra redib } | sssbar llena | sline @hash1 %aa | muestrasetup | return

  :abajo | var %a = $sline(@hash1,1).ln | if (!%a) || (%a == $line(@hash1,0)) return | var %aa = $calc(%a + 1)
  %a = $calc(%a * 2) | var %t = $gettok(%sbarra,%a,32) $gettok(%sbarra,$calc(%a + 1),32)
  %sbarra = $deltok(%sbarra,%a,32) | %sbarra = $deltok(%sbarra,%a,32)
  inc %a 2 | %sbarra = $instok(%sbarra,$gettok(%t,1,32),%a,32) | %sbarra = $instok(%sbarra,$gettok(%t,2,32),$calc(%a + 1),32)
  sbarset fix
  if ($isalias(sbarra)) { sbarra redib } | sssbar llena | sline @hash1 %aa | muestrasetup | return
  :+ | var %i = 1 , %m | unset %setup.tmp1
  while ($findfile(s\sbar\,sba.*.mrc,%i,1)) { 
    %setup.tmp1 = %setup.tmp1  $+  $+ $nopath($ifmatch) | var %n = $remove($nopath($ifmatch),sba.,.mrc)
    if ($readini(lng\ $+ %idioma $+ \misc.ini,sba,%n)) { %n = $ifmatch } | %m = %m  $+  $+ %n | inc %i  
  }
  smenu sssbar2_++ 140 %m | return
  :++
  sbarset + $remove($gettok(%setup.tmp1,$2,22),.mrc,sba.)
  sssbar llena | muestrasetup | window -a @setup | return
  :- 
  if ($sline(@hash1,1)) sbarset - $ifmatch
  sssbar llena | muestrasetup | window -a @setup | return
  :reset | sssbar cierra
}

alias SSSTBAR {
  goto $1
  :lista | window -c @hash1 | window -hl @hash1 | var %i = 1 | :Lt1 | var %c = $readini %perfil bar %i | if (%c) { aline @hash1 %i $+ $chr(8) $+ #/# $+ $gettok(%c,2,44) $+ $chr(8) $+ $gettok(%c,1,44) $+ $chr(8) $+ $gettok(%c,3,44) | inc %i | goto Lt1 } | guilista @setup setup.ls1 | drawline @setup | return
  :guarda
  remini %perfil bar | var %i = 1 | :L2 | var %a = $line(@hash1,%i) | if (%a) { writeini %perfil bar %i $replace($gettok(%a,3,8),$chr(44),$chr(184)) $+ , $+ $mid($gettok(%a,2,8),4,999) $+ , $+ $gettok(%a,4,8) | inc %i | goto L2 }
  :click
  %setup.tmp1 = $gettok($1-,3,8) | %setup.tmp2 = $gettok($1-,4,8) | %setup.tmp3 = $mid($gettok($1-,2,8),4,999) | veico | refres | return
  :pre
  var %a = $?!=" $mg(icoreset) " | if (!%a) return
  var %c = writeini %perfil bar , %i = lng\ $+ %idioma $+ \misc.ini
  remini %perfil bar
  %c 1 $readini(%i,tooltip,1) $+ ,skin-server.png,serverz
  %c 2 $readini(%i,tooltip,2) $+ ,skin-away.png,away -set·B·
  %c 3 $readini(%i,tooltip,3) $+ ,skin-wri.png,f3 setescritu
  %c 4 $readini(%i,tooltip,4) $+ ,skin-log.png,vlog
  %c 5 $readini(%i,tooltip,5) $+ ,skin-mod.png,modulos
  %c 6 $readini(%i,tooltip,6) $+ ,skin-tool.png,util G
  %c 7 $readini(%i,tooltip,7) $+ ,skin-ulist.png,loadu g-ulista
  %c 8 $readini(%i,tooltip,8) $+ ,skin-dcc.png,loadu g-dccs
  %c 9 $readini(%i,tooltip,9) $+ ,skin-irc.png,com-irc
  %c 10 $readini(%i,tooltip,10) $+ ,skin-web.png,ircapweb
  %c 11 $readini(%i,tooltip,11) $+ ,skin-help.png,ircapweb ayuda
  bar
  setSKINS3 4
}

alias SSTBAR {
  goto $1
  :sube
  var %l = $sline(@hash1,1).ln | if (!%l) || (%l == 1) return
  var %a = $line(@hash1,%l) , %b = $line(@hash1,$calc(%l - 1))
  rline @hash1 %l %b | rline @hash1 $calc(%l - 1) %a | sline @hash1 $calc(%l - 1)
  ssstbar guarda | bar | guilista @setup setup.ls1 | drawline @setup | return
  :baja
  var %l = $sline(@hash1,1).ln | if (!%l) || (%l == $line(@hash1,0)) return
  var %a = $line(@hash1,%l) , %b = $line(@hash1,$calc(%l + 1))
  rline @hash1 %l %b | rline @hash1 $calc(%l + 1) %a | sline @hash1 $calc(%l + 1)
  ssstbar guarda | bar | guilista @setup setup.ls1 | drawline @setup | return
  :+
  var %a = $valibar | if %a == no return | else %a = $calc($line(@hash1,0) + 1) $+ $chr(8) $+ %a
  aline @hash1 %a | ssstbar guarda | bar | guilista @setup setup.ls1 | drawline @setup | return
  :-
  var %l = $sline(@hash1,1).ln | if (!%l) return
  dline @hash1 %l | ssstbar guarda | bar | guilista @setup setup.ls1 | drawline @setup | return
  :edita
  var %a = $valibar | if %a == no return | else %a = $sline(@hash1,1).ln $+ $chr(8) $+ %a
  rline @hash1 $sline(@hash1,1).ln %a | ssstbar guarda | bar | guilista @setup setup.ls1 | drawline @setup | return
  :ico
  var %s = skin\ $+ %skin $+ \ , %i = $sfile(%setup.tmpdico $+ \*.*,$mg(icosel))
  if ($right(%i,3) !isin ico exe png bmp jpg) { fallo | return }
  %setup.tmpdico = $nofile(%i)
  %i = $remove(%i,$mircdir,%s)
  %setup.tmp3 = %i
  veico | refres
}

alias -l valibar {
  var %a = #/# $+ %setup.tmp3 $+ $chr(8) $+ %setup.tmp1 $+ $chr(8) $+ %setup.tmp2
  if (%setup.tmp1 == $null) ||  (%setup.tmp2 == $null) ||  (%setup.tmp3 == $null) { fallo | return no } | else return %a
}
alias -l veico {
  cuagi @setup 228 248 164 16 gui
  drawrect -nfr @setup $gettok(%gui.cc,1,44) 1 200 247 16 16
  if (!%setup.tmp3) return
  drawtext -rcn @setup $gettok(%gui.cc,6,44) Verdana 9 234 249 154 16 %setup.tmp3
  if (.ico isin %setup.tmp3) || (.exe isin %setup.tmp3) { 
    var %ff = %setup.tmp3 | if $left(%ff,5) == skin- { %ff = skin\ $+ %skin $+ \ $+ %ff } | if $exists(%ff) { drawpic -nsm @setup 200 247 16 16 " $+ %ff $+ " }
  }
  if (.bmp isin %setup.tmp3) || (.png isin %setup.tmp3) || (.jpg isin %setup.tmp3) { 
    var %ff = %setup.tmp3 | if $left(%ff,5) == skin- { %ff = skin\ $+ %skin $+ \ $+ %ff } | if $exists(%ff) { drawpic -nstm @setup $rgb(0,255,0) 200 247 16 16 " $+ %ff $+ " }
  }
}

alias PRIVBAR {
  var %t = $gettok(%setup.pñ2,3,32)
  if $1 == 1 || $1 == llena { var %p = %pcpanel.p | goto llena }
  if $1 == 2 { var %p = %pcpanel.c | goto llena }
  goto $1
  :llena
  window -c @hash1 | window -hl @hash1 | var %i = 1 | :L1 | var %a = $gettok(%p,%i,22) | if (%a) && (%a !=  •) { aline @hash1 %a $+ $chr(8) $+  $gettok(%p,$calc(%i + 1),22) | inc %i 2  | goto L1 }
  unset %setup.tmp1 %setup.tmp2 | if $1 != llena { guilista @setup setup.ls1 | drawline @setup } | return
  :sel | %setup.tmp1 = $gettok($sline(@hash1,1),1,8) | %setup.tmp2 = $gettok($sline(@hash1,1),2-,8) | guidib @setup | return
  :+ | if (!%setup.tmp1) || (!%setup.tmp2) { fallo | return } | aline @hash1 %setup.tmp1 $+ $chr(8) $+ %setup.tmp2 | goto llenavar
  :- | if (!$sline(@hash1,1)) return | dline @hash1 $sline(@hash1,1).ln | goto llenavar
  :edita | if (!%setup.tmp1) || (!%setup.tmp2) || (!$sline(@hash1,1)) { fallo | return } | rline @hash1 $sline(@Hash1,1).ln %setup.tmp1 $+ $chr(8) $+ %setup.tmp2 | goto llenavar
  :pre
  if %t == 2 { %pcpanel.c = Setup_ca config &2Topicelitopic &2@Ppanerop &2 &1KickBan_ca pckickban &2 &1•return }
  else { %pcpanel.p = Whoisw &1Queryq &1Chatdcc chat &1Senddcc send &1Pingctcp &1 pingMP3zplay &3Botscbots 2 &2 &1 }
  .timer -m 1 300 privbar %t | .timer -m 1 500 privbar llenavar | return
  :sube
  var %l = $sline(@hash1,1).ln | if (!%l) || (%l == 1) return
  var %a = $line(@hash1,%l) , %b = $line(@hash1,$calc(%l - 1))
  rline @hash1 %l %b | rline @hash1 $calc(%l - 1) %a | sline @hash1 $calc(%l - 1)
  goto llenavar
  :baja
  var %l = $sline(@hash1,1).ln | if (!%l) || (%l == $line(@hash1,0)) return
  var %a = $line(@hash1,%l) , %b = $line(@hash1,$calc(%l + 1))
  rline @hash1 %l %b | rline @hash1 $calc(%l + 1) %a | sline @hash1 $calc(%l + 1)
  :llenavar
  unset %setup.tmp1 %setup.tmp2 | guilista @setup setup.ls1 | guidib @setup | drawline @setup
  var %a , %i = 1 | while ($line(@hash1,%i)) { %a = %a $+ $replace($ifmatch,$chr(8),) $+ $chr(22) | inc %i }
  if %t == 1 { %pcpanel.p = %a } | else { %pcpanel.c = %a $+ •return }
  if $group(#paner) == on { panerini off | panerini on }
}


;EOF-dt
