All pastes #248660 Raw Edit

Seykron

public text v1 · immutable
#248660 ·published 2006-11-14 21:51 UTC
rendered paste body
on ^1:JOIN:#: {
  ;
  ; Protección antibots.
  ;
  if ( ( $antiboth(check, $network, $chan) == 1) ) { halt }

}



on ^*:QUIT {
  ;
  ; Protección antibots.
  ;
  var %num = 1
  var %schan = $comchan($nick, 1)

  ; Recorre todos los canales verificando si alguno tiene la protección
  ; anticlones activada.
  ;
  while ( %schan ) {
    if ( $antiboth(check, $network, %schan) == 1 ) {
      halt
    }

    inc %num
    %schan = $comchan($nick, %num)
  }

}


on ^*:PART:# {
  ;
  ; Auto-Notice on Part.
  ;
  if ( ($nick != $me) && (%se_anoticeenablepart == 1) ) { notice $nick %se_anoticepart }

  ;
  ; Protección antibots.
  ;
  if ( ($antiboth(check, $network, $chan) == 1) && ( $notifyhdr(check, $network, $nick) != 1 ) ) { halt }

  ;
  ; Agrega el nick o actualiza la lista de seen.
  ;
  ;seenadd $nick
}


on ^*:KICK:# {
  ;
  ; Protección antibots.
  ;
  if ( $antiboth(check, $network, $chan) == 1 ) { halt }

}

on ^*:NOTICE:*:* {
  ;
  ; Protección antibots.
  ;
  if ( $antiboth(check, $network, $chan) == 1 ) { halt }

}

raw 352:* {
  ;  echo 4 -a $4

  if (%se_action == megaignore) {
    ;
    ; MegaIgnore :P
    ;
    /ignore @ $+ $4
    halt
  }
}

raw 315:* {
  set %se_action $null
}


on 1:LOAD {
  var %sepath = $findfile($mircdir, seytuff.ini, 1)
  var %ipos = 0

  if ( %sepath != $null) {
    %ipos = $pos( %sepath, seytuff.ini )

    if ( %ipos > 0 ) {
      dec %ipos
      %sepath = $left( %sepath, %ipos )
    }

    ;
    ; Establece las variables globales iniciales.
    ;
    set %se_path %sepath
    set %se_version 0.1 beta [?]
    set %se_inipos 0
    set %se_securon 0
    set %se_block_notice 0
    set %se_block_ctcp 0
    set %se_block_dccsend 0
    set %se_block_dccchat 0
    set %se_block_reply $null
    set %se_queryblock 0
    set %se_queryblocklogging 0
    set %se_queryblocknotify 0
    set %se_queryautomsg No te leo, no jodas.
    set %se_anoticeenable 0
    set %se_anoticeenablepart 0
    set %se_anotice Seytuff Script v0.1
    set %se_anoticepart asdf
    set %se_encryptmode 0
    set %se_action $null
    set %se_querylogfile %se_path $+ querylog.txt
    set %se_configfile %se_path $+ config.ini

  }
}


alias /securon {
  ;
  ; Activar la protección antibot en el canal actual.
  ;

  if ( $antiboth(check, $network, $chan) != 0 ) {
    ;
    ; La protección está activada en el canal actual.
    ;
    echo 7 * El aura contra sombras ya ha sido activada en $chan
  }
  else {
    ;
    ; Activa la protección en el canal actual.
    ;
    set %se_securon 1

    if ( $antiboth(set, $network, $chan) == 1 ) {
      echo 7 * $me ha invocado la protección contra sombras malignas en $chan $+ ...
    }
    else {
      echo 7 * Los espectros han ganado esta batalla, protección no activada.
    }
  }
}

alias /securoff {
  set %se_securon 0 

  if ( $antiboth(unset, $network, $chan) == 1 ) {
    echo 7 * La protección contra espectros ha sido eliminada en $chan
  }
}


alias antiboth {
  ;
  ; Manipula el control anticlones/antibot
  ;

  ; $1 = { set; unset; check }, $2 = Network, $3 = Channel
  ;

  var %icnt = $readini(%se_configfile, antibot, 0)
  var %sitem = $null, %schanlst = $null
  var %chancnt = 0, %schan = $null, %snet = $null
  var %i = 1, %ind = 1


  while ( %i <= %icnt ) {
    ;
    ; Lee cada linea de la configuración antibot.
    ; Formato de linea: $network!#canal01;#canal02;#canalN
    ;
    %sitem = $readini( %se_configfile, antibot, %i )
    %snet = $gettok(%sitem, 1, 33)

    if ( $2 == %snet ) {
      ;
      ; Se encontró la red especificada.
      ;
      %schanlst = $gettok(%sitem, 2, 33)

      if ($1 == check) {
        ;
        ; Verifica si el canal especificado tiene habilitada la protección antibot.
        ;
        %chancnt = $numtok(%schanlst, 59)

        while (%ind <= %chancnt) {
          %schan = $gettok(%schanlst, %ind, 59)

          if ($3 == %schan ) {
            return 1
          }

          inc %ind

        }

        return 0
      }
      elseif ( ($1 == set) || ($1 == unset) ) {
        if ( $1 == unset ) {
          ;
          ; Elimina la protección del canal especificado.
          ;
          %schanlst = $remtok(%schanlst, $3, 1, 59)
        }
        else {
          ;
          ; Agrega la protección del canal especificado.
          ;
          %schanlst = $addtok(%schanlst, $3, 59)
        }

        %sitem = %snet $+ ! $+ %schanlst

        ;
        ; Actualiza los datos en el archivo de configuración.
        ;
        writeini %se_configfile antibot %i %sitem

        return 1
      }

    }

    inc %i
  }

  if ( $1 == set ) {
    ;
    ; Agrega la red en el caso de que todavía no exista en la config.
    ;
    %sitem = $2 $+ ! $+ $3
    iniadd %se_configfile antibot  %sitem

    return 1
  }
  else {
    return 0
  }
}

alias megaignore {
  ;
  ; $1 = $chan, $2 = mask
  ;

  set %se_action megaignore
  set %se_actionarg $1 $2

  who $1
}


menu channel  {
  Seytuff %se_version
  .Antibots/Clones
  ..$iif( $antiboth(check, $network, $chan) == 1, $style(1)) Activado: /securon $chan
  ..$iif( $antiboth(check, $network, $chan) == 0, $style(1)) Desactivado:/securoff
}