Auto join

By eNkIL on Apr 09, 2010

xD

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

;Autojoin

on 1:connect:{
  ;AutoJoin
  if (%mostrar.ajoin) { ajoin }
  if (%ajoin) {
    var %x = 1
    while ( %x <= $lines($mircdirscripts/ajoin.txt)) {
      join $read($mircdirscripts/ajoin.txt,%x)
      inc %x
    }
  }
}

menu menubar,channel,status { 
  Auto Join:ajoin
  -
}

alias ajoin {
  if ($dialog(ajoin) == $null) { dialog -m ajoin ajoin } 
  else { .echo -a -Dialogo de Auto Join Ejecutandose.. } 
}

dialog ajoin {
  title "[AS2016] Auto Join"
  size -1 -1 150 87
  option dbu
  box "Lista de Auto Join", 1, 1 0 55 85
  list 2, 3 8 50 75
  box "Configuraciones", 3, 57 0 92 85
  edit "", 4, 59 8 60 10
  check "Activar", 5, 121 8 25 10
  button "<Agregar", 6, 59 19 42 10
  button "Entrar", 7, 105 19 42 10 
  button "Borrar", 8, 59 31 42 10
  check "Mostrar al Conectar", 9, 75 43 60 10
  button "Cerrar", 10, 59 55 89 10, ok
  text "-[Apocaliptic Script 2016]-", 11, 73 72 89 10, disable
}

;Alias Ajoin

alias carga.ajoin {
  var %x = 1
  while ( %x <= $lines($mircdirscripts/ajoin.txt)) {
    did -a ajoin 2 $read($mircdirscripts/ajoin.txt,%x)
    inc %x
  }  
  set %chan $active
  did -a ajoin 4 %chan
  if (%ajoin) did -c ajoin 5
  if (%mostrar.ajoin) did -c ajoin 9
  elseif ($did(ajoin,4).text) {
    var %najoin $read($mircdirscripts/ajoin.txt,w,$did(ajoin,4).text)
    if (%najoin == $did(ajoin,4).text) { 
      did -rab ajoin 4 En lista
    }
    unset %chan
  }
}

alias canal.nuevo {
  if (!$did(ajoin,4).text) {
    noop $input(NO escribiste ningun canal.,uwo,[AS2010] Error!)
  }    
  elseif ($left($did(4).text,1) != $chr(35)) { 
    noop $input(Escribe el canal como el ejemplo: #canal.,uwo,[AS2010] Error!)
    did -r ajoin 4
  }
  elseif ($did(ajoin,4).text) {
    var %najoin $read($mircdirscripts/ajoin.txt,w,$did(ajoin,4).text)
    if (%najoin == $did(ajoin,4).text) { 
      noop $input(Ese canal ya existe.,uwo,[AS2010] Error!)
      did -r ajoin 4 
    }
    else {
      .write $mircdirscripts/ajoin.txt $did(4).text 
      did -r ajoin 2,4
      var %x = 1
      while ( %x <= $lines($mircdirscripts/ajoin.txt)) {
        did -a ajoin 2 $read($mircdirscripts/ajoin.txt,%x)
        inc %x
      }
    }
  }
}

alias borra.canal { 
  if (!$did(ajoin,4).text) && (!$did(ajoin,2).seltext) {
    noop $input(Ningun canal fue seleccionado o escrito.,uwo,[AS2010] Error!) 
  }
  elseif ($left($did(ajoin,4).text,1) != $chr(35)) && (!$did(2).seltext) { 
    noop $input(Escribe el canal como el ejemplo: #canal.,uwo,[AS2010] Error!)
    did -r ajoin 4
  }
  elseif ($did(ajoin,4).text) && (!$did(ajoin,2).seltext) {
    var %dajoin $read($mircdirscripts/ajoin.txt,w,$did(ajoin,4).text) 
    if (%dajoin != $did(ajoin,4).text) {
      $input(Ese canal no esta en la lista!.,ouw,[AS2010] Error!)
      did -r ajoin 4
    }
    elseif ($did(ajoin,4).text) && (!$did(ajoin,2).seltext) {
      var %dajoin $read($mircdirscripts/ajoin.txt,w,$did(ajoin,4).text) 
      if (%dajoin == $did(ajoin,4).text) {
        write -dl [ $+ [ $readn ] ] $mircdirscripts/ajoin.txt  
        did -r ajoin 4,2 
        var %x = 1
        while ( %x <= $lines($mircdirscripts/ajoin.txt)) {
          did -a ajoin 2 $read($mircdirscripts/ajoin.txt,%x)
          inc %x
        }
      }
    }
  }
  elseif ($did(ajoin,2).seltext) && (!$did(ajoin,4).text) {
    var %dajoin $read($mircdirscripts/ajoin.txt,w,$did(ajoin,2).seltext) 
    if (%dajoin == $did(ajoin,2).seltext) {
      write -dl [ $+ [ $readn ] ] $mircdirscripts/ajoin.txt  
      did -r ajoin 2 
      var %x = 1
      while ( %x <= $lines($mircdirscripts/ajoin.txt)) {
        did -a ajoin 2 $read($mircdirscripts/ajoin.txt,%x)
        inc %x
      }
    }
  }
}

;Eventos Dialogo

on *:dialog:ajoin:*:*: { 
  if ($devent == init) {
    if ($did = 0) { carga.ajoin }
  }
  if ($devent == sclick) {
    if ($did = 5) { set %ajoin $did($dname,5).state }
    if ($did = 6) { canal.nuevo }
    if ($did = 7) { 
      if ($left($did(4).text,1) != $chr(35)) { 
        noop $input(Escribe el canal como el ejemplo: #canal.,uwo,[AS2010] Error!)
      }
      else { 
        .join $did($dname,4).text 
      }
    }
    if ($did = 8) { borra.canal }
    if ($did = 9) { set %mostrar.ajoin $did($dname,9).state }
  }
  if ($devent == dclick) {
    if ($did = 2) { .join $did($dname,2).seltext }
  }
}

Comments

Sign in to comment.
troll   -  Apr 21, 2011

english?

 Respond  
eNkIL   -  Jan 12, 2011

es un away :S

 Respond  
meluygas   -  Oct 10, 2010

para q es esto ? .. nececito un redirectin para justin me podes ayudar ?

 Respond  
blackvenomm666   -  Apr 10, 2010

ummmm bit bigger than neccesary but meh looks good

 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.