Central de Conexion

By eNkIL on Feb 12, 2010

un pequeño dialogo para conectar a undernet

::::::::::::::::::::::::::::
:::::: Coded By eNkIL ::::::
::::::::::::::::::::::::::::
::: Cambiale si sabes =) :::
::::::::::::::::::::::::::::

;Dialogo Conexion

menu menubar,channel,status { 
  Central de Conexion:conexion
  -
}

alias Conexion {
  if ($dialog(cconexion) == $null) { dialog -m cconexion cconexion } 
  else { .echo -a -Dialogo de Conexion Ejecutandose.. } 
}

dialog cconexion {
  title "Central de Conexión [AS2010] Undernet"
  size -1 -1 286 103
  option dbu
  box "Servidores", 1, 4 4 101 98
  list 2, 9 13 90 95
  box "Identd", 3, 111 4 85 37
  radio "Personal", 4, 115 16 33 8
  radio "Aleatorio", 5, 115 28 33 9
  edit "", 6, 148 14 45 10
  edit "" , 7, 148 27 45 10,read
  box "Nick", 8, 111 46 85 37
  text "Principal:", 9, 116 56 24 9
  text "Alternativo:", 10, 116 68 30 9
  edit $me , 11, 148 55 45 10, autohs
  edit $anick , 12, 148 67 45 10, autohs
  box "Al Iniciar Script", 13, 201 5 78 36
  check "Abrir esta central", 14, 208 15 50 8
  check "Auto Conectar", 15, 208 27 50 9
  button "Conectar", 16, 202 50 75 14
  button "Salvar y Cerrar", 18, 202 67 75 14, ok default
  box "", 19, 111 82 170 19
  text "- [ A p o c a l i p t i c  S c r i p t  2 0 1 0 ] -", 20, 150 90 170 10, disable
}

;Alias de Dialogo

alias -l CargarServidores { 
  var %numservidores = $lines($mircdir/scripts/servidores.txt)
  var %enlista = 1
  while (%enlista <= %numservidores) { 
    did -a cconexion 2 $read($mircdir/scripts/servidores.txt,%enlista)
    inc %enlista 
  }
}

alias -l SalvaInfo { 
  set %ServidorConecta $did(cconexion,2).seltext
  set %DC.IdSeleccionado $did(cconexion,4).state
  var %ident_a = $did(cconexion,6)
  var %ident_b = $did(cconexion,7)
  var %nick = $did(cconexion,11)
  var %anick = $did(cconexion,12)
  if (%nick && %nick != $me) .nick %nick
  elseif (!%nick) .nick AS2010
  if (%anick) .anick %anick
  else .anick AS2010^
  if (%DC.IdSeleccionado) {
    .identd on $iif(%ident_a,$ifmatch,as2010)
  }
  else {
    .identd on $iif(%ident_b,$ifmatch,as2010)
  }
  set %AS.Identd $iif(%ident_a,$ifmatch,as2010)
  set %MostrarAlInicio $did(cconexion,14).state
  set %ConectarAlInicio $did(cconexion,15).state
}

alias -l CargaInfo { 
  if (%DC.IdSeleccionado) { did -c cconexion 4 } | else { did -c cconexion 5 }
  if (%MostrarAlInicio) { did -c cconexion 14 }
  if (%ConectarAlInicio) { did -c cconexion 15 } 
  did -a cconexion 6 %AS.Identd
  did -a cconexion 7 $RndIdentd
  did -c cconexion 2 %AS.nServer
}

alias -l RndIdentd {
  return $rand(a,z) $+ $rand(a,z) $+ $rand(a,z) $+ $rand(0,9) $+ $rand(0,9) $+ $rand(0,9) $+ $rand(0,9)
}

;Eventos Dialogo

on 1:DIALOG:cconexion:*:*: {
  if ($devent == init) { 
    if ($did = 0) { 
      CargarServidores
      CargaInfo
    }
  }
  if ($devent == sclick) { 
    if ($did == 5) { did -r cconexion 7 | did -a cconexion 7 $rndidentd }
    if ($did == 16) { SalvaInfo | server %ServidorConecta } 
    if ($did == 18) { SalvaInfo }
  }
}

on *:start: { 
  ;DConexion
  if (%MostrarAlInicio) { Conexion }
  if (%ConectarAlInicio) {
    .identd on %AS.Identd
    .server %ServidorConecta
  }
}

on *:CONNECT:{
  ;DConexion
  var %tmp = $read(servers.txt,s,$server)
  set %AS.nServer $iif($readn,$ifmatch,1)
}

Comments

Sign in to comment.
eNkIL   -  Feb 12, 2010

ty man :) but thios script im making is in spanish but ill doit in english soon

 Respond  
napa182   -  Feb 12, 2010

maybe you should post them in an English version as well.

 Respond  
eNkIL   -  Feb 12, 2010

:) ty

 Respond  
Jethro   -  Feb 12, 2010

I think slub77's gonna like this. :p

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.