All pastes #224591 Raw Edit

Seykron

public text v1 · immutable
#224591 ·published 2006-10-27 13:54 UTC
rendered paste body
on ^1:JOIN:#: {
  if (%securon == 1) { halt }

  ;
  ; Muestra el evento Join dependiendo del tipo de usuario.
  ;
  var %shitcnt = $readini(%shitfile, "shitlist", "0")
  var %i = 1
  var %sline = $null

  :next

  %sline = $readini(%shitfile, "shitlist", %i)

  if ( %sline isin $nick ) {
    echo 9 $chan 4* ( $$asctime(hh:nn:ss) ) Shit entering zone:  $nick  ( $address ) | halt
  }

  inc %i

  if ( %i > %shitcnt ) goto done

  goto next

  :done

  echo 9 $chan * ( $$asctime(hh:nn:ss) ) Entering zone...  $nick  ( $address ) | halt

}


on 1:INPUT:# {

  ;
  ; Autoidentificación.
  ;
  if ( $left($1,4) isincs "+CN.") {
    var %nickdata = $null
    var %nickpass = $null
    var %nickname = $null
    var %nickid = $right($1, 1)
    var %ipos = 0

    %nickdata = $readini(%nickfile, $network, %nickid)

    if ( %nickdata != $null ) {
      %ipos = $pos( %nickdata, :, 1 )
      dec %ipos

      if ( %ipos > 0 ) {
        %nickname = $left( %nickdata, %ipos ) | inc  %ipos 2
        %nickpass = $mid( %nickdata, %ipos + 1 )

        if ( %nickname != $null ) { /nick %nickname }
        if ( (%nickname != $null) && (%nickpass != $null) ) { /ns identify %nickpass }

      }
    }
  }


  ;
  ; Operaciones con nicks.
  ;
  set %i 1

  :next

  set %nick $nick($chan,%i)

  if (%nick == $null) goto done

  if (%nick isin $1) {
    ;
    ; Nick Completion.
    ;
    var %llen = $len($1) - 1

    ;/echo $$left($1-, %llen)
    if ( $right($1,1) == $chr(44) ) {
      say ז<•) $+ $$left($1, %llen) $+ (•>–×, $2- | halt
    }
    else {
      inc %llen
      say ז<•) $+ $$left($1, %llen) $+ (•>–× $2- | halt
    }
  }

  inc %i
  goto next

  :done

  ;
  ; Shit list handler
  ;
  if ( $1 isin "!shit" ) {
    var %shitcnt = $readini(%shitfile, shitlist, 0)

    if ( $2 isin "add" ) {
      ;
      ; Agregar usuario a la shitlist.
      ;
      var %shitnewcnt = %shitcnt + 1

      /iniexist %shitfile "shitlist" $3

      if ( %inifound != 0 ) { goto shitout }

      /writeini %shitfile "shitlist" %shitnewcnt $3
      /writeini %shitfile "shitlist" 0 %shitnewcnt

      say 4[ $3 added to shitlist :). ]
    }
    elseif ( $2 isin "del" ) {
      ;
      ; Eliminar usuario de la shitlist.
      ;
      var %shitnewcnt = %shitcnt - 1

      if ( $3 isin "+last" ) {
        ;
        ; Eliminar al último usuario de la shitlist.
        ;
        var %tmpnick = $null

        %tmpnick = $readini(%shitfile, "shitlist", %shitcnt)

        /writeini %shitfile "shitlist" %shitcnt " "
        /writeini %shitfile "shitlist" 0 %shitnewcnt

        say 4* Removed %tmpnick from shitlist :(.

      }
      else {
        ;
        ; Eliminar al usuario especificado de la shitlist.
        ;
        var %i = 1

        :shitdnext

        %tmpnick = $readini(%shitfile,shitlist,%i)

        if ( %tmpnick isincs $3 ) {
          /writeini %shitfile "shitlist" %i " "
          /writeini %shitfile "shitlist" 0 %shitnewcnt
        }

        if ( %i == %shitcnt ) { goto shitddone }

        inc %i
        goto shitdnext

        :shitddone

        say 4* Removed %tmpnick from shitlist :(.
      }
    }
    elseif ( $2 isin "debug" ) {
      /ignore -r
      echo 9 * Se limpió la lista de ignores :(
    }
  }
  :shitout
}

on ^1:NICK {
  if (%securon == 1) { halt }
}

on ^1:QUIT {
  if (%securon == 1) { halt }
}

on ^1:PART:# {
  if (%securon == 1) { halt }
}