Scripting
Bonjour / Bonsoir,

Bienvenue sur ce forum.

Merci, de vous connectez si vous ne l'êtes pas.

Merci, de vous enregistrez si vous ne l'êtes pas. Ceci prend même pas une minute.

Cordialement,

Dylan

Rejoignez le forum, c’est rapide et facile

Scripting
Bonjour / Bonsoir,

Bienvenue sur ce forum.

Merci, de vous connectez si vous ne l'êtes pas.

Merci, de vous enregistrez si vous ne l'êtes pas. Ceci prend même pas une minute.

Cordialement,

Dylan
Scripting
Vous souhaitez réagir à ce message ? Créez un compte en quelques clics ou connectez-vous pour continuer.
Le Deal du moment : -20%
-200€ Smart TV LG 65″ 4K QNED MiniLED
Voir le deal
799 €

IrcOp Detect

Aller en bas

IrcOp Detect Empty IrcOp Detect

Message  Dylan Mar 29 Déc - 4:56

Code:
# IRCop Detect v1.1

# *Description:
#  Détecte l'arrivée d'un ircop sur un channel, ou scan à tout moment.

# *Commandes:
#  -pub: !ircops

#####################################################################
## Configuration du Script ##########################################
#####################################################################

# Détection des IRC Operators à leur arrivée (0=non, 1=oui) :
set operscan(status) 1

# Channels concernés :
set operscan(chans) "*"

# Préfixe des commandes du Bot :
set operscan(command) "!"

# Anti flood sur les commandes du Bot x:y (x=nombre de fois, y=secondes) :
set operscan(flood) 5:10

# Ignorer l'utilisateur après son flood (0=non, 1=oui) :
set operscan(ignore) 1

# Si oui, combien de temps (en minutes) :
set operscan(ignoretime) 1

# Laisser faire les utilisateurs ayant certains flags :
set operscan(ignflags) "fmnov|fmnov"

#####################################################################
#####################################################################
#####################################################################

proc operscan:flood:init {} {
global operscan operscanflood
set operscan(floodnum) [lindex [split $operscan(flood) :] 0]
set operscan(floodtime) [lindex [split $operscan(flood) :] 1]
set i [expr $operscan(floodnum) - 1]
while {$i >= 0} {
  set operscanflood($i) 0
  incr i -1
}
}
operscan:flood:init

proc operscan:flood {nick uhost} {
global operscan operscanflood botnick
if {$operscan(floodnum) == 0} {
  return 0
}
set i [expr $operscan(floodnum) - 1]
while {$i >= 1} {
  set operscanflood($i) $operscanflood([expr $i - 1])
  incr i -1
}
set operscanflood(0) [unixtime]
if {[expr [unixtime] - $operscanflood([expr $operscan(floodnum) - 1])] <= $operscan(floodtime)} {
  if {$operscan(ignore)} {
      newignore [join [maskhost *!*[string trimleft $uhost ~]]] $botnick "Flood" $operscan(ignoretime)
  }
  return 1
} {
  return 0
}
}

bind join -|- * operscan:join
proc operscan:join {nick uhost hand channel} {
global operscan operchan botnick
if {(([lsearch -exact [string tolower $operscan(chans)] [string tolower $channel]] != -1) || ($operscan(chans) == "*")) && (![matchattr $hand b]) && ($nick != $botnick)} {
  if {$operscan(status)&&($nick != $botnick)} {
      set operchan($nick) $channel
      putserv "USERHOST $nick"
  }
}
}

bind raw -|- 302 operscan:raw
proc operscan:raw {from key arg} {
global operscan operchan
set arg "[lindex $arg 1]"
set nick [lindex [split "$arg" :=*] 1]
if {($operscan(status)) && ([info exists operchan($nick)]) && ([string match *\\* [lindex [split "$arg" =] 0]])} {
  set channel $operchan($nick)
  puthelp "PRIVMSG $channel :$nick est un IRC Operator !"
  unset operchan($nick)
  return 1
}
}

bind pub -|- $operscan(command)ircops operscan:pub:ircops
proc operscan:pub:ircops {nick uhost hand channel arg} {
global ircops operscan
if ![matchattr $nick $operscan(ignflags) $channel] {
  if {[operscan:flood $nick $uhost]} {
      return 0
  }
}
set ircops(notice) $nick
set ircops(total) 0
set chan [lindex $arg 0]
if ![string length $chan] {
  set chan $channel
}
if ![validchan $chan] {
  putserv "NOTICE $ircops(notice) :Je ne suis pas sur $chan."
  return 0
}
putserv "WHO $chan"
return 1
}

bind RAW -|- 352 operscan:raw:ircops
bind RAW -|- 315 operscan:raw:ircops:end

proc operscan:raw:ircops {from keyword arg} {
global ircops
if [info exists ircops(notice)] {
  set ircops(channel) [lindex $arg 1]
  set ircops(oper) [lindex $arg 5]
  set ircops(host) [lindex $arg 2]@[lindex $arg 3]
  set ircops(flag) [lindex $arg 6]
  if {[string index $ircops(flag) 1] == "*"} {
      putserv "NOTICE $ircops(notice) :$ircops(oper) ($ircops(host)) est IRC Operator sur $ircops(channel)."
      incr ircops(total)
      return 1
  }
}
}

proc operscan:raw:ircops:end {from keyword arg} {
global ircops operscan
if [info exists ircops(notice)] {
  set ircops(channel) [lindex $arg 1]
  putserv "NOTICE $ircops(notice) :Fin de $operscan(command)ircops sur $ircops(channel) ($ircops(total) au total)."
  unset ircops
  return 1
}
}

putlog "IRCop Detect v1.1 by Neon loaded!"
Dylan
Dylan
Administrateur

Messages : 221
Date d'inscription : 23/11/2009
Age : 29
Localisation : Chez moi ...

https://scripting.forumactif.com

Revenir en haut Aller en bas

Revenir en haut

- Sujets similaires

 
Permission de ce forum:
Vous ne pouvez pas répondre aux sujets dans ce forum