[Script] Petit TCL de gestion
#31
Re ^^ Sad

j'ai un soucis il me fait planté l'egg l'erreur et a la ligne 7

donc celle la
TCL
namespace eval ::socks



je tes mis le code complet en pièce jointe
Site Web: Clic ici Nous rejoindres par mIRC -> Clic Ici
inutile d'avoir une grosse machine si il y'a un con deriere l'ecran Very Happy
Répondre Avertir
#32
..

Je regarde après mais la sa risque de chier pour toi.
Si tu détruit tout en moins de 5 minutes sa va être chiant..
Je pense ta voulut faire des trucs mais que tu as du mal compris certaines choses, donc ont en reparle après.

De plus je t'avais dit d'oublier le truc de modération hein !! "Tu n'a pas vue ?"
Et le tcl faut pas non plus lui mettre des truc de bombe etc.. un tcl de bombe, un autre de modération, et celui ci pour la gestion à la rigueur.

Ont en reparle après et je vais corrigé le code en te disant les erreurs. mais touche à plus rien ABSOLUMENT PLUS RIEN.
Jusqu'à que j'intervienne.
Vous interdisez les erreurs, vous empêchez ainsi la victoire.

Ma super kikoo-page loll
Répondre Avertir
#33
Re,

Demain, TCL modération mis à disposition en téléchargement, Ton code refait, et un tcl de bombe séparer du code que tu a fait.
PS : Evite les code de modération de Platine ils sont bugs Smile.

Demain je te refait tout ça au propre, avec des choses correctes et bien faites..
Avec des explications, mais avant tout je pense va falloir que tu comprenne certaines choses.
Tu n'a pas du tout comprendre "si tu a des questions même les plus stupides dis les moi", je t'aiderais à mieux comprendre.

C'est faisant des questions, et avec ça moi je ferait des exemples etc..
Et là tu comprendrais mieux je pense, Ne fonce pas tête baisser comme je l'ai fais y'a une époque.. Sois pas aussi stupide que moi, prend ton temps de comprendre, demande, poses des questions, demande de l'aide, fait des post, renseigne toi dans les codes, regarde le wiki..

Ont sera toujours là pour te guider et t'aider s'il le faut ! Alors fait pas le têtu :p
A demain pour repartir sur de très bonne bases avec 3 codes remis au propres.

PS : "Le code de modération" sera mis ici je vais peut-être le mettre en téléchargement mais pas sur.

NB : Les codes mirc aussi, faudrais je te file un lien de ceci demain.
Code TCL utilisé les codes couleurs propres au TCL.
Nous voyons tout cela demain Wink
Vous interdisez les erreurs, vous empêchez ainsi la victoire.

Ma super kikoo-page loll
Répondre Avertir
#34
ok pas de soucis on voie tout ca demain
Site Web: Clic ici Nous rejoindres par mIRC -> Clic Ici
inutile d'avoir une grosse machine si il y'a un con deriere l'ecran Very Happy
Répondre Avertir
#35
Bonjour,

Donc voici les code TCL, je vais te les mettre tous, ainsi que des liens dont 2 pour télécharger des tcl.
Premièrement, j'ai enlever tout ce qui et ta partie modération, car franchement je la trouver pas terrible, la maintenant tu aura un truc de correct.

Ensuite, tu utilise des trucs comme bière etc.. sache que CrazyCat, avais fait un tcl qui se nomme "Joke.tcl", il et parfait pour ce type de chose.
Donc tu ira le télécharger je te mais le lien plus bas.

Après pour ce qui et des couleurs dans t'es codes sous format "mirc", bof.. TCL doit avoir c'est propres couleurs !
Je vais donc te donner le lien d'un TCL de MenzAgitat, qui et très utilise et te dira quoi faire, tu lira la description et tu verra que le code et sympa pour les débutant.

Ensuite, pour ce qui et de l'identification à nickserv, je t'ai mis le code de CrazyCat, simple et efficace.
Je n'es pas toucher à ton truc de oper par contre.

Pour ce qui et du tcl de bombe, Idem dans un autre code tcl.
Lorsque tu fait un TCL, ne regroupe pas tout les tcl en un seul.. sinon sa risque de pas mal merder.
De plus la tu fait par exemple : aurore.tcl "Pour ce qui et la gestion des sockets, commande voice, kick..",
Joke.tcl "pour tout ce qui et !bière etc..",
Bombe.tcl "pour tout ce qui et de !bombe" etc..

Différencie t'es tcl, fait en plusieurs.
Maintenant un truc à savoir.

tu va rajouter dans le tcl de socket par exemple ceci :

TCL
bind pub n "!xdevoice" [namespace current]::xdevoice
proc xdevoice { nick handle uhost chan text } {
   putdcc $aurore(idx) ":$aurore(nick) MODE $chan -v $nick"
   putdcc $aurore(idx) ":$aurore(nick) NOTICE $nick Merci d'avoir animé $nick"
}



La le code va planter.. Pourquoi ?
tu appel la variable "$aurore", hors tu ne la déclara pas dans la proc.
Toi tu avais fait ceci :

TCL
bind pub n "!xdevoice" [namespace current]::xdevoice
proc xdevoice { nick handle uhost chan text } {
   global aurore
   putdcc $aurore(idx) ":$aurore(nick) MODE $chan -v $nick"
   putdcc $aurore(idx) ":$aurore(nick) NOTICE $nick Merci d'avoir animé $nick"
}



Là tu avais rajouter global, hors ceci et faux.
Tu ne fait pas global lorsque tu fait du namespace, car le namespace gère deja le global.
Comme si tu faisait "global botnick", pour ensuite appeler "$botnick".

Maintenant regarde comment ont fait :

TCL
bind pub n "!xdevoice" [namespace current]::xdevoice
proc xdevoice { nick handle uhost chan text } {
   variable aurore
   putdcc $aurore(idx) ":$aurore(nick) MODE $chan -v $nick"
   putdcc $aurore(idx) ":$aurore(nick) NOTICE $nick Merci d'avoir animé $nick"
}



Je ne fait que mettre "variable aurore", et sa résous ton soucis.

Bon maintenant voici le code socket refait :
TCL
#*************************************************#
# Système de sockets pour le réseaux Aurel-Tchat. #
# Fait par alias_angelius avec BaGrift.          #
#*************************************************#
 
namespace eval ::socks {
   variable aurore
 
#********************#
# Service.Socket 1.0 #
#********************#
 
#**************************#
# Information link reseau. #
#**************************#
 
set aurore(serv) "Aurore.Aurel-Tchat.fr"
set aurore(ip) "91.121.193.88"
set aurore(port) "7000"
set aurore(pwdlink) "12345678"
set aurore(info) "Aurore Services"
 
#****************************#
# Configuration des sockets. #
#****************************#
 
set aurore(nick) "Aurore"
set aurore(identd) "Aurore"
set aurore(host) "Aurore.Aurel-Tchat.fr"
set aurore(nom) "Aurore Service Moderation"
 
#***************************#
# Salon de log des sockets. #
#***************************#
 
set aurore(log) "#Anonymes"
set aurore(salon) "#Accueil"
set aurore(staff) "#Staff"
set aurore(quit01) "Redemarage Aurore-Service."
set aurore(quit02) "Fermeture Aurore-Service."
 
#****************************************#
# Lancement de la procédure des sockets. #
#****************************************#
 
proc checkconnect {} {
   if {![info exists aurore(idx)]} { utimer 30 [namespace current]::checkconnect } else { xconnect:serv }
}
 
proc xconnect:serv {} {
   variable aurore
   if [catch {set aurore(idx) [connect $aurore(ip) $aurore(port)]} err] {
      putlog "Connection error :$err"
      return
   }
   putdcc $aurore(idx) "PASS $aurore(pwdlink)"
   putdcc $aurore(idx) "SERVER $aurore(serv) 1 [unixtime] :$aurore(info)"
   putdcc $aurore(idx) ":$aurore(serv) NICK $aurore(nick) '' '' $aurore(identd) $aurore(host) $aurore(serv) '' :$aurore(nom)"
   putdcc $aurore(idx) ":$aurore(nick) MODE $aurore(nick) +oOSqsw"
   putdcc $aurore(idx) ":$aurore(nick) JOIN $aurore(log)"
   putdcc $aurore(idx) ":$aurore(nick) JOIN $aurore(salon)"
   putdcc $aurore(idx) ":$aurore(nick) MODE $aurore(log) +ntsv $aurore(nick)"
   control $aurore(idx) [namespace current]::controling_server
   utimer 10 [namespace current]::verify
}
 
#***********************************#
# Verify si le serveur est Connecté #
#***********************************#
 
proc verify {} {
   variable aurore
   if [valididx [set [namespace current]::aurore(idx)]] {
      utimer 30 [namespace current]::verify
   } else {
      xconnect:serv
   }
}
 
proc controling_server {idx arg} {
   variable aurore
   set arg1 [lindex [split $arg " "] 0]
   set arg2 [lindex [split $arg " "] 1]
   set arg3 [lindex [split $arg " "] 2]
   set arg4 [lindex [split $arg " "] 3]
   set arg5 [lindex [split $arg " "] 4]
   set arg6 [lindex [split $arg " "] 5]
   set arg7 [lindex [split $arg " "] 6]
   set arg8 [lindex [split $arg " "] 7]
   set arg10 [string trim [lrange [split $arg " "] 3 end] :]
   if {$arg2=="PING"} {
      putdcc $aurore(idx) ":$aurore(serv) PONG $aurore(ip) :$aurore(serv)"
    }   
}
 
#**********************#
# Restart des sockets. #
#**********************#
 
bind evnt - prerestart [namespace current]::eva:restart
proc eva:restart {args} {
   variable aurore
   putdcc $aurore(idx) ":$aurore(serv) SQUIT $aurore(serv) :Restart Sockets."
   catch {close $aurore(idx)}
}
 
#********************#
# Rehash du Service. #
#********************#
 
bind dcc n xrehash [namespace current]::eggy:xrehash
proc eggy:xrehash {nick idx arg} {
   variable aurore
   putdcc $idx "\002Rehash de Aurore-Service et des fichiers\002"
   utimer 4 rehash
}
 
#*********************#
# Restart du Service. #
#*********************#
 
bind dcc n xrestart [namespace current]::eggy:xrestart
proc eggy:xrestart {nick idx arg} {
   variable aurore
   putdcc $idx "\002Redémarrage de Laura-service\002"
   if [valididx [set [namespace current]::aurore(idx)]] {
      putdcc $aurore(idx) ":$aurore(nick) QUIT :$aurore(quit01)"
      putdcc $aurore(idx) ":$aurore(serv) SQUIT :$aurore(serv)"
      catch {close $aurore(idx)}
      foreach kill [utimers] {
          if {[lindex $kill 1]=="[namespace current]::verify"} { killutimer [lindex $kill 2] }
      }
    }
    xconnect:serv
}
 
#*****************#
# Die du Service. #
#*****************#
 
bind dcc n xdie [namespace current]::eggy:xdie
proc eggy:xdie {nick idx arg} {
   variable aurore
    putdcc $idx "\002Arrêt de Aurore-Service\002"
    if [valididx [set [namespace current]::aurore(idx)]] {
       putdcc $aurore(idx) ":$aurore(nick) QUIT : $aurore(quit02)"
       putdcc $aurore(idx) ":$aurore(serv) SQUIT :$aurore(quit02)"
       catch {close $aurore(idx)}
       foreach kill [utimers] {
          if {[lindex $kill 1]=="[namespace current]::verify"} { killutimer [lindex $kill 2] }
       }
   }
}

#**********************#
# Xvoice pour anim	   #
#**********************#
 
bind pub n "!xvoice" [namespace current]::xvoice
proc xvoice { nick handle uhost chan text } {
   variable aurore
   putdcc $aurore(idx) ":$aurore(nick) MODE $chan +v $nick"
   putdcc $aurore(idx) ":$aurore(nick) NOTICE $nick Bonne Moderation !"
   putdcc $aurore(idx) ":$aurore(nick) NOTICE $nick Pour savoir mais commandes de modération tape !modere"
   putdcc $aurore(idx) ":$aurore(nick) NOTICE $nick Pence Bien a te devoice quand tu anim plus ! => !xdevoice Merci"
   putquick "SAJOIN $nick $aurore(staff)"
}

#********************#
# Xdevoice pour anim #
#********************#
 
bind pub n "!xdevoice" [namespace current]::xdevoice
proc xdevoice { nick handle uhost chan text } {
   variable aurore
   putdcc $aurore(idx) ":$aurore(nick) MODE $chan -v $nick"
   putdcc $aurore(idx) ":$aurore(nick) NOTICE $nick Merci d'avoir animé $nick"
}
 
#**************#
# Kick Pseudo. #
#**************#
 
bind pub n "!kick" [namespace current]::kick
proc kick { nick hand host chan arg } {
   variable aurore
   set nick [lindex $arg 0]
   putdcc $aurore(idx) ":$aurore(nick) KICK $chan $nick Merci de rester calme !"
   return 0
}
 
#*************#
# Ban Pseudo. #
#*************#
 
bind pub n "!kb" pub:kb
proc pub:kb { nick hand host chan arg } {
   variable aurore
    # Ici j'ai changer ton set, pour split sur un host.
   set nik [lindex [split $nick !] 0]
    # Ici je re split sur l'host.
   set host [lindex [split $nick !] 1]
    # Ici je re set arg, au cas ou plus tard faudra faire une modification.
   set arg [lindex [split $args] 1 end]
    # Maintenant ont ban sur le nick et le host.
   putdcc $aurore(idx) ":$aurore(nick) $chan +b $nik!$host"
   putdcc $aurore(idx) ":$aurore(nick) KICK $chan $nick Reste Cool Banni !"
}
 
#**************#
# Appel Ircop. #
#**************#
 
bind pub n "!appel" [namespace current]::appel
proc appel { nick uhost handle chan arg } {
   variable aurore
   putdcc $aurore(idx) ":$aurore(nick) PRIVMSG $aurore(log) $nick Appel un IRCop sur $chan"
   putdcc $aurore(idx) ":$aurore(nick) NOTICE $nick Les IRCops on ete appelé"
}
 
#****************#
# Help Commande. #
#****************#
 
bind pub X "!modere" [namespace current]::help
proc help { nick uhost handle chan arg } {
   variable aurore
   set commande [lindex $arg 1]
   set commande [stripcodes abcu [lindex $arg 0]]
   if {$commande == ""} {
      putdcc $aurore(idx) ":$aurore(nick) privmsg $nick :\00314Commande Help du Robot \002\0034$::botnick\002\0034"
      putdcc $aurore(idx) ":$aurore(nick) privmsg $nick :\017"
      putdcc $aurore(idx) ":$aurore(nick) privmsg $nick :\0034!xvoice\0034 \0031a utilisé que quand vous moderé sous peine de sanction!\0031"
      putdcc $aurore(idx) ":$aurore(nick) privmsg $nick :\0034!xdevoice\0034 \0031a faire quand vous avez fini de moderé !\0031"
      putdcc $aurore(idx) ":$aurore(nick) privmsg $nick :\0034!kick\0034 \0031sert a kické un user du salon !\0031"
      putdcc $aurore(idx) ":$aurore(nick) privmsg $nick :\0034!kb\0034 \0031Sert a kick/ban un user du salon !\0031"
      putdcc $aurore(idx) ":$aurore(nick) privmsg $nick :\0034!appel\0034 \0031sert a appelé les IRCop en cas de grosse perturbation sur le salon !\0031"
      putdcc $aurore(idx) ":$aurore(nick) privmsg $nick :\0034!chut\0034 \0031sert a coupé la parole a un user pendant 3minute !\0031"
      putdcc $aurore(idx) ":$aurore(nick) privmsg $nick :\00314Fin Help du Robot \002\0034$::botnick\002\0034"
   }
}
 
#****************************#
# Fin du Service Sockets 1.0 #
#****************************#
# connection 
[namespace current]::xconnect:serv
}
 
putlog "\0031Service Sockets 1.0 \0034Chargé."



Le tcl de modération :
TCL
namespace eval moderation {
variable moderation

#Salon logs
set ::chanbotlog "#ircops"

#Rasion du kickban BAV
set ::raisonbav "\037\0031Blackliste - Indesirable !!\037\0031"

#Rasion du kickban Spam
set ::raisonspam "\037\0031Spam/Pub Interdit sur le Salon\0037\0031"

#Rasion du kickban Badword
set ::raisonbadword "\037\0031BadWord Détecté - Exclus pour mauvais langage !\0037\0031"

#Raison du kickban Badnick
set ::raisonbadnick "\037\0031BadNick Détecté - Veuillez changer votre pseudo que vous avez mis !\0037\0031"

#Raison du kickban BadHost
set ::raisonbadhost "\037\0031BadHost Détecté - Votre Host est Blacklisté ...\0037\0031"

#Raison du kickban BadRealName
set ::raisonbadname "\037\0031BadName Détecté - Votre RealName est Blacklisté ...\0037\0031"

##############
# Protection #
##############
 
bind dcc A +xprotect moderation::+xprotect
proc +xprotect {nick idx arg} {
 variable moderation
  set temp [lindex $arg 0]
 
  if {$temp=="" || ![string match *@* $temp]} {
    putdcc $idx "\2Utilisation:\2 .+xprotect <pseudo*!*@*> ou <*!*@host>"
    putdcc $idx "\0034Exemple:\2 .+xprotect toto*!*@* ou *!*@000000.fr"
    return 0
  }
  set x 0
  foreach data $moderation(data) {
    if {[lindex $data 0]=="PROTECT" && [string tolower [lindex $data 1]]==[string tolower [lindex $arg 0]]} {
      set x 1
    }
  }
  if !$x {
    lappend moderation(data) [list PROTECT $temp]
    putdcc $idx "\002$temp est ajouté à la liste des protégés"
  } else {
    putdcc $idx "\002Erreur:\002 $temp est déja dans la liste des protégés"
  }
}
 
 
bind dcc A -xprotect moderation::-xprotect
 proc -xprotect {nick idx arg} {
 variable moderation
 set temp [lindex $arg 0]
 
 if {$temp=="" || ![string match *@* $temp]} {
 putdcc $idx "\2Utilisation:\2 .-xprotect <pseudo*!*@*> ou <*!*@host>"
 putdcc $idx "\0034Exemple:\2 .-xprotect toto*!*@* ou ou *!*@000000.fr"
 return 0
 }
 
 set x 0
 set y 0
  foreach data $moderation(data) {
 
 if {[lindex $data 0]=="PROTECT" && [string tolower [lindex $data 1]]==[string tolower $temp]} {
 set moderation(data) [lreplace $moderation(data) $x $x]
 set y 1
 }
 incr x
 }
 if $y {
 putdcc $idx "\002$temp est supprimé de la liste des protégés"
 } else {
 putdcc $idx "\002$temp n'est pas dans la liste des protégés"
 }
}

# ici
bind pub L .+protect moderation::.+protect
proc .+protect {nick hand host chan arg} {
 variable moderation
 set temp [lindex $arg 0]
 
 if {$temp=="" || ![string match *@* $temp]} {
 putquick "NOTICE $nick :\2Utilisation:\2 .+protect <pseudo*!*@*> ou <*!*@host>"
 putquick "NOTICE $nick :\0034Exemple:\2 .+protect toto*!*@* ou *!*@000000.fr"
 return 0
 }
 
 set x 0
 foreach data $moderation(data) {
 if {[lindex $data 0]=="PROTECT" && [string tolower [lindex $data 1]]==[string tolower [lindex $arg 0]]} {
 set x 1
 }
 }
 
 if !$x {
 lappend moderation(data) "PROTECT [join $temp]"
 putquick "NOTICE $nick :\002$temp est ajouté à la liste des protégés"
 } else {
 putquick "NOTICE $nick :\002 $temp est déja dans la liste des protégés"
 }
}
 
 
bind pub L .-protect moderation::.-protect
 proc .-protect {nick hand host chan arg} {
 variable moderation
 set temp [lindex $arg 0]
 
 if {$temp=="" || ![string match *@* $temp]} {
 putquick "NOTICE $nick :\2Utilisation:\2 .-protect <pseudo*!*@*> ou <*!*@host>"
 putquick "NOTICE $nick :\0034Exemple:\2 .-protect toto*!*@* ou *!*@000000.fr"
 return 0
 }
 
 set x 0
 set y 0
 foreach data $moderation(data) {
 
 if {[lindex $data 0]=="PROTECT" && [string tolower [lindex $data 1]]==[string tolower $temp]} {
 set moderation(data) [lreplace $moderation(data) $x $x]
 set y 1
 }
 incr x
 }
 
 if $y {
 putquick "NOTICE $nick :\002$temp est supprimé de la liste des protégés"
 } else {
 putquick "NOTICE $nick :\002$temp n'est pas dans la liste des protégés"
 }
}
 
 
bind pub L .protectlist moderation::protectlist
proc protectlist {nick host hand chan arg} {
 variable moderation
  set x 0
  set d ""
  foreach data $moderation(data) {
    if {[lindex $data 0]!="PROTECT"} continue
    set x 1
    lappend d [lindex $data 1]
    if {[llength $d]==10} {
      putquick "NOTICE $nick :[join $d]"
      set d ""
    }
  }
  if {[llength $d]>0} {
    putquick "NOTICE $nick :[join $d]" 
    set d ""
  }
  if !$x {putquick "NOTICE $nick : Liste Protect vide."}
}

 
###########
# Badword #
###########
 
bind dcc A +xbadword moderation::+xbadword
proc +xbadword {nick idx arg} {
 variable moderation
 set temp [lindex $arg 0]
 
 if {$temp==""} {
 putdcc $idx "\2Utilisation:\2 .+xbadword <mot>"
 putdcc $idx "\0034Exemple:\2 .+xbadword connard"
 return 0
 }
 
 set x 0
 foreach data $moderation(data) {
 if {[lindex $data 0]=="BADWORD" && [string tolower [lindex $data 1]]==[string tolower [lindex $arg 0]]} {
 
 set x 1
 }
 }
 
 if !$x {
 lappend moderation(data) [list BADWORD $temp]
 putdcc $idx "\002$temp est ajouté à la liste des Badwords"
 } else {
 putdcc $idx "\002Erreur:\002 $temp est déja dans la liste des Badwords"
 }
}
 
 
bind dcc A -xbadword moderation::-xbadword
 proc -xbadword {nick idx arg} {
 variable moderation
 set temp [lindex $arg 0]
 
 if {$temp==""} {
 putdcc $idx "\2Utilisation:\2 .-xbadword <mot>"
 putdcc $idx "\0034Exemple:\2 .-xbadword connard"
 return 0
 }
 
 set x 0
 set y 0
 foreach data $moderation(data) {
 if {[lindex $data 0]=="BADWORD" && [string tolower [lindex $data 1]]==[string tolower $temp]} {
 set moderation(data) [lreplace $moderation(data) $x $x]
 
 set y 1
 }
 incr x
 }
 if $y {
 putdcc $idx "\002$temp est supprimé de la liste des Badwords"
 } else {
 putdcc $idx "\002$temp n'est pas dans la liste des Badwords"
 }
}
 
 
bind pub L .+badword moderation::.+badword
proc .+badword {nick hand host chan arg} {
 variable moderation
 set temp [lindex $arg 0]
 
 if {$temp==""} {
 putquick "NOTICE $nick :\2Utilisation:\2 .+badword <mot>"
 putquick "NOTICE $nick :\0034Exemple:\2 .+badword connard"
 return 0
 }
 
 set x 0
 foreach data $moderation(data) {
 if {[lindex $data 0]=="BADWORD" && [string tolower [lindex $data 1]]==[string tolower [lindex $arg 0]]} {
 
 set x 1
 }
 }
 if !$x {
 lappend moderation(data) [list BADWORD $temp]
 putquick "NOTICE $nick :\002$temp est ajouté à la liste des Badwords"
 } else {
 putquick "NOTICE $nick :\002 $temp est déja dans la liste des Badwords"
 }
}
 
 
bind pub L .-badword moderation::.-badword
 proc .-badword {nick hand host chan arg} {
 variable moderation
 set temp [lindex $arg 0]
 
 if {$temp==""} {
 putquick "NOTICE $nick :\2Utilisation:\2 .-badword <mot>"
 putquick "NOTICE $nick :\0034Exemple:\2 .-badword connard"
 return 0
 }
 
 set x 0
 set y 0
 foreach data $moderation(data) {
 if {[lindex $data 0]=="BADWORD" && [string tolower [lindex $data 1]]==[string tolower $temp]} {
 set moderation(data) [lreplace $moderation(data) $x $x]
 
 set y 1
 }
 incr x
 }
 if $y {
 putquick "NOTICE $nick :\002$temp est supprimé de la liste des Badwords"
 } else {
 putquick "NOTICE $nick :\002$temp n'est pas dans la liste des Badwords"
 }
}
 
 
 
bind pub L .badwordlist moderation::badwordlist
proc badwordlist {nick host hand chan arg} {
 variable moderation
  set x 0
  set d ""
  foreach data $moderation(data) {
    if {[lindex $data 0]!="BADWORD"} continue
    set x 1
    lappend d [lindex $data 1]
    if {[llength $d]==10} {
      puthelp "NOTICE $nick :[join $d]"
      set d ""
    }
  }
  if {[llength $d]>0} {
    puthelp "NOTICE $nick :[join $d]" 
    set d ""
  }
  if !$x {puthelp "NOTICE $nick : Liste BadWord vide."}
}

###########
# Badhost #
###########
 
bind dcc A +xbadhost moderation::+xbadhost
proc +xbadhost {nick idx arg} {
 variable moderation
 set temp [lindex $arg 0]
 
 if {$temp=="" || ![string match *@* $temp]} {
 putdcc $idx "\2Utilisation:\2 .+xbadhost <*!*@host>"
 putdcc $idx "\0034Exemple:\2 .+xbadhost *!*@*.biz"
 return 0
 }
 set x 0
 foreach data $moderation(data) {
 if {[lindex $data 0]=="BADHOST" && [string tolower [lindex $data 1]]==[string tolower [lindex $arg 0]]} {
 
 set x 1
 }
 }
 if !$x {
 lappend moderation(data) [list BADHOST $temp]
 putdcc $idx "\002$temp est ajouté à la liste des BadHosts"
 } else {
 putdcc $idx "\002Erreur:\002 $temp est déja dans la liste des BadHosts"
 }
}
 
 
bind dcc A -xbadhost moderation::dcc:-xbadhost
 proc dcc:-xbadhost {nick idx arg} {
 variable moderation
 set temp [lindex $arg 0]
 if {$temp=="" || ![string match *@* $temp]} {
 putdcc $idx "\2Utilisation:\2 .-xbadhost <*!*@host>"
 putdcc $idx "\0034Exemple:\2 .-xbadhost *!*@*.biz"
 return 0
 }
 
 set x 0
 set y 0
 foreach data $moderation(data) {
 if {[lindex $data 0]=="BADHOST" && [string tolower [lindex $data 1]]==[string tolower $temp]} {
 set moderation(data) [lreplace $moderation(data) $x $x]
 
 set y 1
 }
 incr x
 }
 if $y {
 putdcc $idx "\002$temp est supprimé des BadHosts"
 } else {
 putdcc $idx "\002$temp n'est pas dans la liste des BadHosts"
 }
}
 
 
bind pub L .+badhost moderation::.+badhost
proc .+badhost {nick hand host chan arg} {
 variable moderation
 set temp [lindex $arg 0]
 
 if {$temp=="" || ![string match *@* $temp]} {
 putquick "NOTICE $nick :\2Utilisation:\2 .+badhost <*!*@host>"
 putquick "NOTICE $nick :\0034Exemple:\2 .+badhost *!*@*.biz"
 return 0
 }
 set x 0
 foreach data $moderation(data) {
 if {[lindex $data 0]=="BADHOST" && [string tolower [lindex $data 1]]==[string tolower [lindex $arg 0]]} {
 
 set x 1
 }
 }
 if !$x {
 lappend moderation(data) [list BADHOST $temp]
 putquick "NOTICE $nick :\002$temp ajouté aux BadHosts"
 } else {
 putquick "NOTICE $nick :\002 $temp est déja dans la liste des BadHosts"
 }
}
 
 
bind pub L .-badhost moderation::.-badhost
 proc .-badhost {nick hand host chan arg} {
 variable moderation
 set temp [lindex $arg 0]
 
 if {$temp=="" || ![string match *@* $temp]} {
 putquick "NOTICE $nick :\2Utilisation:\2 .-badhost <*!*@host>"
 putquick "NOTICE $nick :\0034Exemple:\2 .-badhost *!*@*.biz"
 return 0
 }
 
 set x 0
 set y 0
 foreach data $moderation(data) {
 if {[lindex $data 0]=="BADHOST" && [string tolower [lindex $data 1]]==[string tolower $temp]} {
 set moderation(data) [lreplace $moderation(data) $x $x]
 
 set y 1
 }
 incr x
 }
 if $y {
 putquick "NOTICE $nick :\002$temp est supprimé des BadHosts"
 } else {
 putquick "NOTICE $nick :\002$temp n'est pas dans la liste des BadHosts"
 }
}
 
 
bind pub L .badhostlist moderation::badhostlist
proc badhostlist {nick host hand chan arg} {
 variable moderation
  set x 0
  set d ""
  foreach data $moderation(data) {
    if {[lindex $data 0]!="BADHOST"} continue
    set x 1
    lappend d [lindex $data 1]
    if {[llength $d]==10} {
      puthelp "NOTICE $nick :[join $d]"
      set d ""
    }
  }
  if {[llength $d]>0} {
    puthelp "NOTICE $nick :[join $d]" 
    set d ""
  }
  if !$x {puthelp "NOTICE $nick : Liste Badhost vide."}
}

 
 
##############
# Blackliste #
##############
 
bind dcc A +xblackliste moderation::+xblackliste
proc +xblackliste {nick idx arg} {
 variable moderation
 set temp [lindex $arg 0]
 
 if {$temp=="" || ![string match *@* $temp]} {
 putdcc $idx "\2Utilisation:\2 .+xblackliste <pseudo*!*@*> ou <*!*@host>"
 putdcc $idx "\0034Exemple:\2 .+xblackliste toto*!*@* ou *!*@000000.fr"
 return 0
 }
 set x 0
 foreach data $moderation(data) {
 if {[lindex $data 0]=="BLACKLISTE" && [string tolower [lindex $data 1]]==[string tolower [lindex $arg 0]]} {
 
 set x 1
 }
 }
 if !$x {
 lappend moderation(data) [list BLACKLISTE $temp]
 putdcc $idx "\002$temp est ajouté à la Blackliste"
 } else {
 putdcc $idx "\002Erreur:\002 $temp est déja dans la Blackliste"
 }
}
 
 
bind dcc A -xblackliste moderation::-xblackliste
 proc -xblackliste {nick idx arg} {
 variable moderation
 set temp [lindex $arg 0]
 
 if {$temp=="" || ![string match *@* $temp]} {
 putdcc $idx "\2Utilisation:\2 .-xblackliste <pseudo*!*@*> ou <*!*@host>"
 putdcc $idx "\0034Exemple:\2 .-xblackliste toto*!*@* ou *!*@000000.fr"
 return 0
 }
 
 set x 0
 set y 0
 foreach data $moderation(data) {
 if {[lindex $data 0]=="BLACKLISTE" && [string tolower [lindex $data 1]]==[string tolower $temp]} {
 set moderation(data) [lreplace $moderation(data) $x $x]
 
 set y 1
 }
 incr x
 }
 if $y {
 putdcc $idx "\002$temp est supprimé de la Blackliste"
 } else {
 putdcc $idx "\002$temp n'est pas dans la Blackliste"
 }
}
 
bind pub L .bavlist moderation::bav
proc bav {nick host hand chan arg} {
 variable moderation
  set x 0
  set d ""
  foreach data $moderation(data) {
    if {[lindex $data 0]!="BLACKLISTE"} continue
    set x 1
    lappend d [lindex $data 1]
    if {[llength $d]==10} {
      puthelp "NOTICE $nick :[join $d]"
      set d ""
    }
  }
  if {[llength $d]>0} {
    puthelp "NOTICE $nick :[join $d]" 
    set d ""
  }
  if !$x {puthelp "NOTICE $nick :bavlist vide."}
}
 
 
bind pub L .+bav moderation::.+bav
proc .+bav {nick hand host chan arg} {
 variable moderation
 set temp [lindex $arg 0]
 
 if {$temp=="" || ![string match *@* $temp]} {
 putquick "NOTICE $nick :\2Utilisation:\2 .+bav <pseudo*!*@*> ou <*!*@host>"
 putquick "NOTICE $nick :\0034Exemple:\2 .+bav toto*!*@* ou *!*@000000.fr"
 return 0
 }
 
 set x 0
 foreach data $moderation(data) {
 if {[lindex $data 0]=="BLACKLISTE" && [string tolower [lindex $data 1]]==[string tolower [lindex $arg 0]]} {
 
 set x 1
 
 }
 }
 
 if !$x {
 lappend moderation(data) "BLACKLISTE [join $temp]"
 putquick "NOTICE $nick :\002$temp est ajouté à la Blackliste"
 } else {
 putquick "NOTICE $nick :\002 $temp déja dans la Blackliste"
 }
 }
 
 
bind pub L .-bav moderation::.-bav
 proc .-bav {nick hand host chan arg} {
 variable moderation
 set temp [lindex $arg 0]
 
 if {$temp=="" || ![string match *@* $temp]} {
 putquick "NOTICE $nick :\2Utilisation:\2 .-bav <pseudo*!*@*> ou <*!*@host>"
 putquick "NOTICE $nick :\0034Exemple:\2 .-bav toto*!*@* ou *!*@000000.fr"
 return 0
 }
 
 set x 0
 set y 0
 foreach data $moderation(data) {
 if {[lindex $data 0]=="BLACKLISTE" && [string tolower [lindex $data 1]]==[string tolower $temp]} {
 set moderation(data) [lreplace $moderation(data) $x $x]
 set y 1
 }
 incr x
 }
 
 if $y {
 putquick "NOTICE $nick :\002$temp supprimé de la Blackliste"
 } else {
 putquick "NOTICE $nick :\002$temp n'est pas dans la Blackliste"
 }
}

 
 
########
# Spam #
########
 
bind dcc A +xspam moderation::+xspam
proc +xspam {nick idx arg} {
 variable moderation
 set temp [lindex $arg 0]
 
 if {$temp==""} {
 putdcc $idx "\2Utilisation:\2 .+xspam <mot>"
 putdcc $idx "\0034Exemple:\2 .+xspam www.*"
 return 0
 }
 set x 0
 foreach data $moderation(data) {
 if {[lindex $data 0]=="SPAM" && [string tolower [lindex $data 1]]==[string tolower [lindex $arg 0]]} {
 
 set x 1
 }
 }
 if !$x {
 lappend moderation(data) [list SPAM $temp]
 putdcc $idx "\002$temp est ajouté à la liste des Spams"
 } else {
 putdcc $idx "\002Erreur:\002 $temp est déja dans la liste des Spams"
 }
}
 
 
bind dcc A -xspam moderation::-xspam
 proc -xspam {nick idx arg} {
 variable moderation
 set temp [lindex $arg 0]
 
 if {$temp==""} {
 putdcc $idx "\2Utilisation:\2 .-xspam <mot>"
 putdcc $idx "\0034Exemple:\2 .-xspam www.*"
 return 0
 }
 
 set x 0
 set y 0
  foreach data $moderation(data) {
 
 if {[lindex $data 0]=="SPAM" && [string tolower [lindex $data 1]]==[string tolower $temp]} {
 set moderation(data) [lreplace $moderation(data) $x $x]
 set y 1
 }
 incr x
 }
 if $y {
 putdcc $idx "\002$temp est supprimé de la liste des Spams"
 } else {
 putdcc $idx "\002$temp n'est pas dans la liste des Spams"
 }
}
 
 
bind pub L .+spam moderation::.+spam
proc .+spam {nick hand host chan arg} {
 variable moderation
 set temp [lindex $arg 0]
 
 if {$temp==""} {
 putquick "NOTICE $nick :\2Utilisation:\2 .+spam <mot>"
 putquick "NOTICE $nick :\0034Exemple:\2 .+spam www.*"
 return 0
 }
 
 set x 0
 foreach data $moderation(data) {
 if {[lindex $data 0]=="SPAM" && [string tolower [lindex $data 1]]==[string tolower [lindex $arg 0]]} {
  set x 1
 }
 }
 
 if !$x {
 lappend moderation(data) [list SPAM $temp]
 putquick "NOTICE $nick :\002$temp est ajouté à la liste des Spams"
 } else {
 putquick "NOTICE $nick :\002 $temp est déja dans la liste des Spams"
 }
}
 
 
bind pub L .-spam moderation::.-spam
 proc .-spam {nick hand host chan arg} {
 variable moderation
 set temp [lindex $arg 0]
 
 if {$temp==""} {
 putquick "NOTICE $nick :\2Utilisation:\2 .-spam <mot>"
 putquick "NOTICE $nick :\0034Exemple:\2 .-spam *www*"
 return 0
 }
 
 set x 0
 set y 0
 foreach data $moderation(data) {
 
 if {[lindex $data 0]=="SPAM" && [string tolower [lindex $data 1]]==[string tolower $temp]} {
 set moderation(data) [lreplace $moderation(data) $x $x]
 set y 1
 }
 incr x
 }
 
 if $y {
 putquick "NOTICE $nick :\002$temp est supprimé de la liste des Spams"
 } else {
 putquick "NOTICE $nick :\002$temp n'est pas dans la liste des Spams"
 }
}
 
 
bind pub L .spamlist moderation::spamlist
proc spamlist {nick host hand chan arg} {
 variable moderation
  set x 0
  set d ""
  foreach data $moderation(data) {
    if {[lindex $data 0]!="SPAM"} continue
    set x 1
    lappend d [lindex $data 1]
    if {[llength $d]==10} {
      putquick "NOTICE $nick :[join $d]"
      set d ""
    }
  }
  if {[llength $d]>0} {
    putquick "NOTICE $nick :[join $d]" 
    set d ""
  }
  if !$x {putquick "NOTICE $nick : Liste Spam/Pub vide."}
}

 
 
###########
# BADNICK #
###########
 
bind dcc A +xbadnick moderation::+xbadnick
proc +xbadnick {nick idx arg} {
 variable moderation
 set temp [lindex $arg 0]
 
 if {$temp==""} {
 putdcc $idx "\2Utilisation:\2 .+xbadnick <pseudo>"
 putdcc $idx "\0034Exemple:\2 .+xbadnick h-ch-f"
 return 0
 }
 set x 0
 foreach data $moderation(data) {
 if {[lindex $data 0]=="BADNICK" && [string tolower [lindex $data 1]]==[string tolower [lindex $arg 0]]} {
 
 set x 1
 }
 }
 if !$x {
 lappend moderation(data) [list BADNICK $temp]
 putdcc $idx "\002$temp est ajouté en badnick"
 } else {
 putdcc $idx "\002Erreur:\002 $temp est déja en Badnick"
 }
}
 
 
bind dcc A -xbadnick moderation::-xbadnick
 proc -xbadnick {nick idx arg} {
 variable moderation
 set temp [lindex $arg 0]
 
 if {$temp==""} {
 putdcc $idx "\2Utilisation:\2 .-xbadnick <pseudo>"
 putdcc $idx "\0034Exemple:\2 .-xbadnick h-ch-f"
 return 0
 }
 
 set x 0
 set y 0
 foreach data $moderation(data) {
 if {[lindex $data 0]=="BADNICK" && [string tolower [lindex $data 1]]==[string tolower $temp]} {
 set moderation(data) [lreplace $moderation(data) $x $x]
 
 set y 1
 }
 incr x
 }
 if $y {
 putdcc $idx "\002$temp est supprimé des Badnicks"
 } else {
 putdcc $idx "\002$temp n'est pas dans les Badnicks"
 }
}
 
bind pub L .badnicklist moderation::badnicklist
proc badnicklist {nick host hand chan arg} {
 variable moderation
  set x 0
  set d ""
  foreach data $moderation(data) {
    if {[lindex $data 0]!="BADNICK"} continue
    set x 1
    lappend d [lindex $data 1]
    if {[llength $d]==10} {
      puthelp "NOTICE $nick :[join $d]"
      set d ""
    }
  }
  if {[llength $d]>0} {
    puthelp "NOTICE $nick :[join $d]" 
    set d ""
  }
  if !$x {puthelp "NOTICE $nick :BadnickListe vide."}
}
 
 
bind pub L .+badnick moderation::.+badnick
proc .+badnick {nick hand host chan arg} {
 variable moderation
 set temp [lindex $arg 0]
 
 if {$temp==""} {
 putquick "NOTICE $nick :\2Utilisation:\2 .+badnick <pseudo>"
 putquick "NOTICE $nick :\0034Exemple:\2 .+badnick h-ch-f"
 return 0
 }
 
 set x 0
 foreach data $moderation(data) {
 if {[lindex $data 0]=="BADNICK" && [string tolower [lindex $data 1]]==[string tolower [lindex $arg 0]]} {
 
 set x 1
 }
 }
 
 if !$x {
 lappend moderation(data) "BADNICK [join $temp]"
 putquick "NOTICE $nick :\002$temp est ajouté en Badnick"
 } else {
 putquick "NOTICE $nick :\002 $temp est déja en Badnick"
 }
}
 
 
bind pub L .-badnick moderation::.-badnick
 proc .-badnick {nick hand host chan arg} {
 variable moderation
 set temp [lindex $arg 0]
 
 if {$temp==""} {
 putquick "NOTICE $nick :\2Utilisation:\2 .-badnick <pseudo>"
 putquick "NOTICE $nick :\0034Exemple:\2 .-badnick h-ch-f"
 return 0
 }
 
 set x 0
 set y 0
 foreach data $moderation(data) {
 if {[lindex $data 0]=="BADNICK" && [string tolower [lindex $data 1]]==[string tolower $temp]} {
 set moderation(data) [lreplace $moderation(data) $x $x]
 set y 1
 }
 incr x
 }
 
 if $y {
 putquick "NOTICE $nick :\002$temp est supprimé des Badnicks"
 } else {
 putquick "NOTICE $nick :\002$temp n'est pas dans les Badnicks"
 }
}
 
 
bind pub L .badnicklist moderation::badnicklist
proc badnicklist {nick host hand chan arg} {
 variable moderation
  set x 0
  set d ""
  foreach data $moderation(data) {
    if {[lindex $data 0]!="BADNICK"} continue
    set x 1
    lappend d [lindex $data 1]
    if {[llength $d]==10} {
      putquick "NOTICE $nick :[join $d]"
      set d ""
    }
  }
  if {[llength $d]>0} {
    putquick "NOTICE $nick :[join $d]" 
    set d ""
  }
  if !$x {putquick "NOTICE $nick : Liste Badnick vide."}
}

 
 
#############
# EXTENSION #
#############
 
bind pub L .addanim moderation::.addanim
proc .addanim {nick hand host chan arg} {
 variable moderation
 set temp [lindex $arg 0]
 
 if {$temp=="" || ![string match *@* $temp]} {
 putquick "NOTICE $nick :\2Utilisation:\2 .addanim <pseudo*!*@*>"
 putquick "NOTICE $nick :\0034Exemple:\2 .addanim toto*!*@*"
 return 0
 }
 
 set x 0
 foreach data $moderation(data) {
 if {[lindex $data 0]=="EXTENSION" && [string tolower [lindex $data 1]]==[string tolower [lindex $arg 0]]} {
 set x 1
 }
 }
 
 if !$x {
 lappend moderation(data) "EXTENSION [join $temp]"
 putquick "NOTICE $nick :\002$temp est ajouté à la liste"
 } else {
 putquick "NOTICE $nick :\002 $temp est déja dans la liste"
 }
}
 
 
bind pub L .delanim moderation::.delanim
 proc .delanim {nick hand host chan arg} {
 variable moderation
 set temp [lindex $arg 0]
 
 if {$temp=="" || ![string match *@* $temp]} {
 putquick "NOTICE $nick :\2Utilisation:\2 .delanim <pseudo*!*@*>"
 putquick "NOTICE $nick :\0034Exemple:\2 .delanim toto*!*@*"
 return 0
 }
 
 set x 0
 set y 0
 foreach data $moderation(data) {
 
 if {[lindex $data 0]=="EXTENSION" && [string tolower [lindex $data 1]]==[string tolower $temp]} {
 set moderation(data) [lreplace $moderation(data) $x $x]
 set y 1
 }
 incr x
 }
 
 if $y {
 putquick "NOTICE $nick :\002$temp est supprimé de la liste"
 } else {
 putquick "NOTICE $nick :\002$temp n'est pas dans la liste"
 }
}
 
 
bind pub L .extensionlist moderation::extensionlist
proc extensionlist {nick host hand chan arg} {
 variable moderation
  set x 0
  set d ""
  foreach data $moderation(data) {
    if {[lindex $data 0]!="EXTENSION"} continue
    set x 1
    lappend d [lindex $data 1]
    if {[llength $d]==10} {
      putquick "NOTICE $nick :[join $d]"
      set d ""
    }
  }
  if {[llength $d]>0} {
    putquick "NOTICE $nick :[join $d]" 
    set d ""
  }
  if !$x {putquick "NOTICE $nick : Liste Extension vide."}
}

 
 
 
###############
# BADREALNAME #
###############
 
bind dcc A +xbadname moderation::+xbadname
proc +xbadname {nick idx arg} {
 variable moderation
 set temp [lindex $arg 0]
 
 if {$temp==""} {
 putdcc $idx "\2Utilisation:\2 .+xbadname <realname>"
 return 0
 }
 set x 0
 foreach data $moderation(data) {
 if {[lindex $data 0]=="BADNAME" && [string tolower [lindex $data 1]]==[string tolower [lindex $arg 0]]} {
 
 set x 1
 }
 }
 if !$x {
 lappend moderation(data) [list BADNAME $temp]
 putdcc $idx "\002$temp est ajouté en BadRealName"
 } else {
 putdcc $idx "\002Erreur:\002 $temp est déja en BadRealName"
 }
}
 
 
bind dcc A -xbadname moderation::-xbadname
 proc -xbadname {nick idx arg} {
 variable moderation
 set temp [lindex $arg 0]
 
 if {$temp==""} {
 putdcc $idx "\2Utilisation:\2 .-xbadname <realname>"
 return 0
 }
 
 set x 0
 set y 0
 foreach data $moderation(data) {
 if {[lindex $data 0]=="BADNAME" && [string tolower [lindex $data 1]]==[string tolower $temp]} {
 set moderation(data) [lreplace $moderation(data) $x $x]
 
 set y 1
 }
 incr x
 }
 if $y {
 putdcc $idx "\002$temp est supprimé des BadRealNames"
 } else {
 putdcc $idx "\002$temp n'est pas dans les BadRealNames"
 }
}
 
bind pub L .+badname moderation::.+badname
proc .+badname {nick hand host chan arg} {
 variable moderation
 set temp [lindex $arg 0]
 
 if {$temp==""} {
 putquick "NOTICE $nick :\2Utilisation:\2 .+badname <realname>"
 return 0
 }
 
 set x 0
 foreach data $moderation(data) {
 if {[lindex $data 0]=="BADNAME" && [string tolower [lindex $data 1]]==[string tolower [lindex $arg 0]]} {
 
 set x 1
 }
 }
 
 if !$x {
 lappend moderation(data) "BADNAME [join $temp]"
 putquick "NOTICE $nick :\002$temp est ajouté en BadRealName"
 } else {
 putquick "NOTICE $nick :\002 $temp est déja en BadRealName"
 }
}
 
 
bind pub L .-badname moderation::.-badname
 proc .-badname {nick hand host chan arg} {
 variable moderation
 set temp [lindex $arg 0]
 
 if {$temp==""} {
 putquick "NOTICE $nick :\2Utilisation:\2 .-badname <realname>"
 return 0
 }
 
 set x 0
 set y 0
 foreach data $moderation(data) {
 if {[lindex $data 0]=="BADNAME" && [string tolower [lindex $data 1]]==[string tolower $temp]} {
 set moderation(data) [lreplace $moderation(data) $x $x]
 set y 1
 }
 incr x
 }
 
 if $y {
 putquick "NOTICE $nick :\002$temp est supprimé des BadRealNames"
 } else {
 putquick "NOTICE $nick :\002$temp n'est pas dans les BadRealNames"
 }
}
 
bind pub L .badnamelist moderation::badnamelist
proc badnamelist {nick host hand chan arg} {
 variable moderation
  set x 0
  set d ""
  foreach data $moderation(data) {
    if {[lindex $data 0]!="BADNAME"} continue
    set x 1
    lappend d [lindex $data 1]
    if {[llength $d]==10} {
      putquick "NOTICE $nick :[join $d]"
      set d ""
    }
  }
  if {[llength $d]>0} {
    putquick "NOTICE $nick :[join $d]" 
    set d ""
  }
  if !$x {putquick "NOTICE $nick : Liste RealName vide."}
}

 
#ici
 
set moderation(file) [file join scripts moderation.db]
if ![file exists $moderation(file)] {
  catch {open $moderation(file) w+} p
  catch {close $p}
}
bind evnt - save moderation::moderation_save_file
proc moderation_save_file {type} {
 variable moderation
  if {$moderation(data)==""} return
  catch {open $moderation(file) w+} p
  foreach data $moderation(data) {
     if {$data!=""} {puts $p $data}
  }
  catch {close $p}
  putlog "sauvegarde de moderation.db"
}
set moderation(data) ""
catch {open $moderation(file) r} p
while {![eof $p]} {
  lappend moderation(data) [gets $p]
}
catch {close $p}
 
proc mirc:strip {text} {
  regsub -all -- "\003(\[0-9\]\[0-9\]?(,\[0-9\]\[0-9\]?)?)?" $text "" text
  set text [string map -nocase [list \002 "" \017 "" \026 "" \037 ""] $text]
  return $text
} 
 
proc hostcomp {host1 host2} {
  string match -nocase [string map {"\[" "." "\]" ","} [join $host1]] [string map {"\[" "." "\]" ","} [join $host2]]
}
 
proc getdata {type arg} {
 variable moderation
  set arg [split $arg]
  foreach data $moderation(data) {
    switch $type {
      BADNICK {
        if {[lindex $data 0]=="BADNICK" && [string match -nocase *[lindex $data 1]* $arg]} {return 1}
      }
      BADWORD {
        foreach a $arg {
          if {[lindex $data 0]=="BADWORD" && [string match -nocase [lindex $data 1] $a]} {return 1}
        }
      }
      BADIDENT {
        if {[lindex $data 0]=="BADIDENT" && [string match -nocase *[lindex $data 1]* $arg]} {return 1}
      }
      BADHOST {
        if {[lindex $data 0]=="BADHOST" && [hostcomp [lindex $data 1] $arg]} {return 1}
      }
      BADNAME {
        if {[lindex $data 0]=="BADNAME" && [string match -nocase *[lindex $data 1]* $arg]} {return 1}
      }
      BLACKLISTE {
        if {[lindex $data 0]=="BLACKLISTE" && [hostcomp [lindex $data 1] $arg]} {return 1}
      }
      PROTECT {
        if {[lindex $data 0]=="PROTECT" && [hostcomp [lindex $data 1] $arg]} {return 1}
      }
      EXTENSION {
         if {[lindex $data 0]=="EXTENSION" && [hostcomp [lindex $data 1] $arg]} {return 1}
      }
	  SPAM {
        foreach a $arg {
          if {[lindex $data 0]=="SPAM" && [string match -nocase [lindex $data 1] $a]} {return 1}
        }
      }
    }
  }
  return 0
}
 
bind join - * moderation::joinchan
 
proc joinchan {nick host hand chan} {
  variable iswho 
  variable raison
  set host [getchanhost $nick $chan]
  set host "*!*[string range $host [string first @ $host] e]"  
  if [getdata PROTECT $nick!$host] return
  if [getdata EXTENSION $nick!$host] return
  if [getdata BLACKLISTE $nick!$host] {putquick "MODE $chan +b $host"; putquick "KICK $chan $nick : $::raisonbav"; putquick "notice Robot :Oui \0034B.A.V. Detect:\2 \03pour $nick!$host sur $chan\03"} 
  if [getdata BADNICK $nick] {putquick "MODE $chan +b $host"; putquick "KICK $chan $nick : $::raisonbadnick"; putquick "notice Robot :Oui \0034Badnick Detect:\2 \03pour $nick sur $chan\03 ---> \0034Pseudo Bani:\2 $nick"}
  if [getdata BADHOST $nick!$host] {putquick "MODE $chan +b $host"; putquick "KICK $chan $nick : $::raisonbadhost"; putquick "notice Robot :Oui \0034Badhost Detect:\2 \03pour $nick sur $chan\03 ---> \0034Host Bani:\2 $host"}  
     set iswho $chan
     putserv "who $nick"
  }
 
bind raw - 352 moderation::who
 proc who {f k a} {
  variable iswho
  variable raison
  if {$iswho!=""} {
    set nick [lindex $a 5]
    set host *![lindex $a 2]@[lindex $a 3]
    set chan $iswho
  set host [getchanhost $nick $chan]
  set host "*!*[string range $host [string first @ $host] e]"  
  if [getdata PROTECT $nick!$host] return
  if [getdata BADNAME [lrange [lindex [split $a :] 1] 1 end]] {putquick "MODE $chan +b $host"; putquick "KICK $chan $nick : $::raisonbadname"; putquick "notice Robot :Oui \0034Badname Detect:\2 \03pour $nick sur $chan\03 ---> \0034Realname Bani:\2 [lrange [lindex [split $a :] 1] 1 end]"}
    set iswho ""
   }
 }
 
 
 
 
 
 
bind pubm - * moderation::badspam
 
proc badspam { nick host hand chan arg } {
  set arg [mirc:strip $arg]
  set arg [stripcodes bcruag $arg]
  set host [getchanhost $nick $chan]
  set host "*!*[string range $host [string first @ $host] e]"  
  if [getdata PROTECT $nick!$host] return
  if [getdata SPAM $arg] {putquick "MODE $chan +b $host"; putquick "KICK $chan $nick : $::raisonspam"; putquick "notice Robot :Oui \0034Spam/Pub Detect:\2 \03pour $nick sur $chan\03 ---> \0034Spam/Pub Bani:\2 $arg"}    
  if [getdata BADWORD $arg] {putquick "MODE $chan +b $host"; putquick "KICK $chan $nick : $::raisonbadword"; putquick "notice Robot :Oui \0034Badword Detect:\2 \03pour $nick sur $chan\03 ---> \0034Mot Bani:\2 $arg"}
}
 
bind nick - * moderation::newnick
 
proc newnick {nick host hand arg newnick} {
   if [getdata PROTECT $nick!$host] return
   if [getdata EXTENSION $nick!$host] return
   foreach chan [channels] {
   if {[onchan $newnick $chan] && [getdata BADNICK $newnick]} {
   set host [getchanhost $nick $chan]
   set host "*!*[string range $host [string first @ $host] e]"  
   putquick "MODE $chan +b $host"; putquick "KICK $chan $newnick : $::raisonbadnick"; putquick "notice Robot :Oui \0034On-AiR Detect:\2 \03pour $nick sur $chan\03"}  
  }
}
 
}



Le tcl de oper :
TCL
#******#
# OPER #
#******#

### config ###
## Mettre ici le nick d'ircop de votre Robot##
set opernick  "Aurore"
## Mettre ici le password de l'oline de votre robot##
set password "12345678"

#################################
##           BIND              ##
#################################
 
bind raw - "001" opernick

#################################
##            Proc             ##
#################################
 
proc opernick {from key text} {
    global opernick password
    putserv "OPER $opernick $password"
    putserv "WALLOPS :Je Suis Désormais Un IRCOP"
    return 0
}

#********************#
# Register NickServ  #
#********************#
 
namespace eval AnopIdent {
    variable nickserv "NickServ"
    variable chanserv "ChanServ"
    variable nspass "12345678"
 
    bind notc - "*IDENTIFY*" AnopIdent::ident
}
proc AnopIdent::ident {nick uhost handle text {dest ""}} {
   if {$dest == ""} { set dest $::botnick }
   if {[string tolower $nick]!=[string tolower $AnopIdent::nickserv]} { return 0 }
   putserv "PRIVMSG $AnopIdent::nickserv :identify $AnopIdent::nspass"
   return 0
}
putlog "Initialization loaded"
[/tcl
 
Le tcl de bombe :
[tcl]
# bombe.tcl
# !bomb <pseudo>
# !cut <couleur>
 
 
bind pub - !bomb bombe:pub
bind pub - !cut cut:pub
 
set fils(couleur) {
      jaune
      rouge
      marron
      bleu
      vert
      noir
      violet
      orange
      gris
      cyan
      blanc
      fushia
}
 
set bombe(set) 0
set bombe(nick) ""
set bombe(kickeur) ""
set bombe(good) ""
set bombe(list) ""
set bombe(timer) ""
set bombe(chan) ""
set bombe(antifloodt) ""
set bombe(antiflood) 0
set bombe(antiflood2) 0
 
proc antiflood:bomb {chan} {
      global bombe
      if {$bombe(antiflood) >= 3} {
            if {$bombe(antiflood2) == 1} { return 0 }
            putserv "PRIVMSG $chan :Contrôle de flood activé pour la commande !bomb : pas plus de 3 requête(s) toutes les 200 secondes."
            set bombe(antiflood2) 1
            set bombe(antifloodt) [utimer 200 {set bombe(antiflood) 0 ; set bombe(antiflood2) 0}]
            return 0
      } else {
            incr bombe(antiflood)
      }
}
 
proc filtout {chan text} {
      if [string match "*c*" [getchanmode $chan]] {
            return [stripcodes abcgru $text]
      } else {
            return $text
      }
}
 
proc bombe:pub {nick uhost hand chan arg} {
      global fils bombe botnick
      if {[string tolower [lindex $arg 0]] == [string tolower $botnick]} {
            putkick $chan $nick [filtout $chan "\00313O\0031wned \00313<3"]
            return 0
      }
      if {$bombe(set) == 1} {
            set msg [filtout $chan "\00314Bombe \| \0034Le jeu est deja en cours d'utilisation."]
            putserv "PRIVMSG $chan :$msg"
            return 0
      }
      if {[lindex $arg 0] == ""} {
            set msg [filtout $chan "\00314Bombe\003 \| !bomb PSEUDO"]
            putserv "PRIVMSG $chan :$msg"
            return 0
      }
      if {![antiflood:bomb $chan]} { return 0 }
 
      set bombe(set) 1
      set bombe(nick) [lindex $arg 0]
      set bombe(kickeur) $nick
      set cdf [rand 4]
      incr cdf
      set x 0      
      set bombe(chan) $chan
      set bombe(timer) [utimer 30 {putkick $bombe(chan) $bombe(nick) [filtout $bombe(chan) "\002Boum !!!\002 Temps écoulé !"]; set bombe(set) 0}]
       while {$x<=$cdf} {
            if {$x == 0} { set bombe(list) "" }
             set bombe(list) "$bombe(list) [lindex $fils(couleur) [rand [llength $fils(couleur)]]]"
 
             incr x
       }
      set bombe(good) [lindex $bombe(list) [rand [llength $bombe(list)]]]
      putlog "$bombe(list) + $bombe(good)"
      set msg [filtout $chan "\00314Bombe \| \0031Attention\0034 $bombe(nick) \0031Tu dois couper le bon fil tu as 30 secondes :\0034 $bombe(list) \0031( !cut couleur )"]
    putserv "PRIVMSG $chan :$msg"
}
 
 
proc cut:pub {nick uhost hand chan arg} {
      global bombe
      if {$bombe(set) == 1} {
            if {$nick == $bombe(nick)} {
                  if {[lindex $arg 0] == $bombe(good)} {
                        set msg [filtout $chan "\00314Bombe \| \0031Joli\0034 $nick !! Tu as trouvé le bon fil \0031:D"]
                        putserv "PRIVMSG $chan :$msg"
                  } else {
                        set msg 
                        putkick $chan $nick [filtout $chan "\00314Boum !! Dtc !! Le bon fil était\0034 $bombe(good)"]
                  }
                  set bombe(set) 0
                  killutimer $bombe(timer)
            } else {
                  set msg [filtout $chan "\00314Bombe\003 \| C'est a $bombe(nick) de couper le fil !"]
                  putserv "PRIVMSG $chan :$msg"
            }
      }
}
 
putlog "\[bomb\] a été chargé."



Maintenant les liens des codes.

Jokes.tcl :
http://scripts.eggdrop.fr/details-Jokes-s71.html

Pour transformer les codes couleurs en TCL :
http://scripts.eggdrop.fr/details-mIRC+2...-s136.html

Maintenant, j'ai enlever ton code de shun, car j'ai trouver un code tcl idem de MenzAgitat bien plus sympa.
Test et tu verra, qu'il et plus sympa que le shun ce code ci :
http://scripts.eggdrop.fr/details-Auto+S...-s167.html

Tu fait tout celà ensuite tu test le tout, et SURTOUT ne mélange pas tout les codes TCL ensemble.
Nous sommes là pour vous aidez, mais essayer de nous aidez en retour en ne faisant pas ce genres de choses lol..

Si tu ne comprend pas certaines choses, que tu aurais un doute, ou que tu serais pas faire ou autres choses..
Surtout n'hésite pas, demande je serait content de pouvoir t'aider, au contraire je ne demande que cela d'aider.
Et c'est en posant des questions, en essayant ou autres, que l'ont apprend.
Tu fait des erreurs ce n'es pas grave, Mais HESITE PAS ! à poser des questions Smile

Voila bon test avec tout les codes transmis, avec un beau code de moderation etc.
Vous interdisez les erreurs, vous empêchez ainsi la victoire.

Ma super kikoo-page loll
Répondre Avertir
#36
salut Alias :p

Merci pour tes code je vais testé tout ca merci encore a toi pour tout.

Re, Sad
Il me detecte une erreur hors j'ai rien touché voicis l'erreur =>

Code :
5|13:19:08| [SNotice] Cancelling link [@0:0:0:0:0:ffff:91.121.193.88.50951], invalid numeric

Je voie pas d'ou cela peux venir
Site Web: Clic ici Nous rejoindres par mIRC -> Clic Ici
inutile d'avoir une grosse machine si il y'a un con deriere l'ecran Very Happy
Répondre Avertir
#37
Change ceci :
TCL
putdcc $aurore(idx) "SERVER $aurore(serv) 1 [unixtime] :$aurore(info)"



Par cela :
TCL
putdcc $aurore(idx) "SERVER $aurore(serv) 1 [unixtime] [unixtime] J09 ACAA\] +s :$aurore(info)"



Et dit moi si sa fonctionne
Vous interdisez les erreurs, vous empêchez ainsi la victoire.

Ma super kikoo-page loll
Répondre Avertir
#38
La il me sors plus d'erreur mais il ce connecté toujour pas ...
Site Web: Clic ici Nous rejoindres par mIRC -> Clic Ici
inutile d'avoir une grosse machine si il y'a un con deriere l'ecran Very Happy
Répondre Avertir
#39
Bon, Faisont sa dans l'ordre.

Lorsque tu es sur ton server, tu reçois une notice "comme quoi le link se fait ?".
Et tu appel quoi par il se connecte pas ?
Sois précis sinon je pourrais pas t'aider avec si peux d'informations, comme si tu faisait un TCl et que je te disait "sa fonctionne pas".

Sois explicite Smile
Vous interdisez les erreurs, vous empêchez ainsi la victoire.

Ma super kikoo-page loll
Répondre Avertir
#40
ben c simple l'erreur avais disparu mais le robot ce connecté pas au serveur.

et la l'erreur viens de revenir ... je comprend plus rien la lol je suis perdu Sad
Site Web: Clic ici Nous rejoindres par mIRC -> Clic Ici
inutile d'avoir une grosse machine si il y'a un con deriere l'ecran Very Happy
Répondre Avertir
#41
Bon, retire tout les tcl du bot "de ta config".
Ensuite tu kill la pid de ton eggdrop, puis tu le relance.

Une fois ceci fait, dit moi si sa se connect ou pas.

PS : ton nom de réseau exact c'est quoi ?
Vous interdisez les erreurs, vous empêchez ainsi la victoire.

Ma super kikoo-page loll
Répondre Avertir
#42
irc.aurel-tchat.fr voila mon reseaux Smile
Site Web: Clic ici Nous rejoindres par mIRC -> Clic Ici
inutile d'avoir une grosse machine si il y'a un con deriere l'ecran Very Happy
Répondre Avertir
#43
Ah ! et aussi, dans la config de ton unreal "si c'est ce type de réseau que tu as".
Dans les informations link tu quoi ?

copie moi ce que tu as "sans mettre les mot de passe", juste les nom de link je veux voir.
Vous interdisez les erreurs, vous empêchez ainsi la victoire.

Ma super kikoo-page loll
Répondre Avertir
#44
voila mon link

Code:
Code :
link Socket.Aurel-Tchat.fr {
    username *;
    hostname 91.121.193.88;
    bind-ip *;
    port 7000;
    hub *;
    password-connect "******";
    password-receive "*******";
    class servers;
};
Site Web: Clic ici Nous rejoindres par mIRC -> Clic Ici
inutile d'avoir une grosse machine si il y'a un con deriere l'ecran Very Happy
Répondre Avertir
#45
Ah ben forcément que sa fonctionne pas..

Change sa :
TCL
set aurore(serv) "Aurore.Aurel-Tchat.fr"



Par sa :
TCL
set aurore(serv) "Socket.Aurel-Tchat.fr"



Sa devrais fonctionner après je pense.
Essaye et dit moi ce que cela donne.
Vous interdisez les erreurs, vous empêchez ainsi la victoire.

Ma super kikoo-page loll
Répondre Avertir


Atteindre :


Utilisateur(s) parcourant ce sujet : 1 visiteur(s)
Tchat 100% gratuit -Discutez en toute liberté