<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-gb">
	<link rel="self" type="application/atom+xml" href="https://forum.eggheads.org/app.php/feed/topic/19087" />

	<title>egghelp/eggheads community</title>
	<subtitle>Discussion of eggdrop bots, shell accounts and tcl scripts.</subtitle>
	<link href="https://forum.eggheads.org/index.php" />
	<updated>2012-08-24T10:19:27-04:00</updated>

	<author><name><![CDATA[egghelp/eggheads community]]></name></author>
	<id>https://forum.eggheads.org/app.php/feed/topic/19087</id>

		<entry>
		<author><name><![CDATA[darksis]]></name></author>
		<updated>2012-08-24T10:19:27-04:00</updated>

		<published>2012-08-24T10:19:27-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=99931#p99931</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=99931#p99931"/>
		<title type="html"><![CDATA[i need help please about protection]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=99931#p99931"><![CDATA[
Hello i no very cool in tcl but i try very time to fix code and this no work in code i want put noticeflood nickflood and ctcpflood and if someone flood then bot set mode im and kick+ban this the code <div class="codebox"><p>Code: </p><pre><code>#################################   Moderation.tcl de Platine  ##       Debug par nOf          #################################################### Salon Logs  ###################set salonm "#Tchat"########################    CAPS mode     #########################-&gt; Expiration of detection for capitalization (in seconds) ?set expiration(majuscule) "180"#-&gt; Number of capital to detect ?set detect(majuscule) "10"#-&gt; How much warning before kick ?set avert(majuscule) "2"#-&gt; Warning messageset msg(majuscule) "Caution! Thank you not write in CAPITALS"#-&gt; Reason for kickset kick(majuscule) "Not to shout to be understood!"######################## mode REHEARSALS  #########################-&gt; Expiration of detection for rehearsals (in seconds) ?set expiration(repetition) "900"#-&gt; Number of repetition to detect ?set detect(repetition) "5"#-&gt; How much warning before kick ?set avert(repetition) "2"#-&gt; Warning messageset msg(repetition) "Caution! watch your rehearsals! The next time you will be expelled!"#-&gt; Reason for kickset kick(repetition) "No repetition!"####################      CTCP       #####################-&gt; Number of messages during a mass detection / floodset mass(ctcp) "4"#-&gt; Temp to rehash the reset to 0 mass / flood (in seconds)set mass(rehashctcp) "2"#-&gt; Temp for removal of the + m (in minutes)set mass(retraitm) "1"#-&gt; Reason kickbanset kick(ctcp) "Excluded Spam / Pub!"##################### Mode LANGUAGE  ######################-&gt; Expiration of detection for the language (in seconds) ?set expiration(mot) "300"#-&gt; How much warning before kickban ?set avert(mot) "1"#-&gt; Warning messageset msg(mot) "Monitors! your language! Next time it's out!"#-&gt; Reason kickbanset kick(mot) "Excluded 20 minutes! for Bad Language!"################## Mode SPAM  ###################-&gt; Expiration of detection for spam (in seconds) ?set expiration(spam) "120"#-&gt; How much warning before kickban ?set avert(spam) "0"#-&gt; Warning messageset msg(spam) "Avoid your spam! Next time it's out!"#-&gt; Reason kickbanset kick(spam) "Excluded Spam / Pub!"########################### Mode ANTI/MASSFLOOD ############################-&gt; Number of messages during a mass detection / floodset mass(flood) "4"#-&gt; Temp to rehash the reset to 0 mass / flood (in seconds)set mass(rehashflood) "2"#-&gt; Temp for removal of the + m (in minutes)set mass(retraitm) "1"#-&gt; Reason kickbanset kick(flood) "Excluded Spam / Pub!"########################## Mode ANTI/MASSJOIN ###########################-&gt; Number of join in a mass detection / joinset mass(join) "3"#-&gt; Temp to rehash the reset to 0 mass / join (in seconds)set mass(rehashjoin) "3"#-&gt; Temp for removal of the + i (in minutes)set mass(retraiti) "1"#-&gt; Reason kickbanset kick(join) "Excluded Spam / Pub!"################# Mode NICK ##################-&gt; Reason kickbanset kick(nick) "Please change your nickname or whatever you just took!"################# Blacklist ##################-&gt; Reason kickbanset kick(blacklist) "\02\[\002System B.A.V\02]\002 undesirable!!"################# Blacklist ##################-&gt; Reason kickbanset kick(notice) "No Notice Salon !"#########################################   End of Configuration TcL    ##########################################################################################  Creating variables and files .txt        ####         for the management of TcL         #################################################set fichier(modchan) "modchan.txt"set fichier(modmot) "modmot.txt"set fichier(modspam) "modspam.txt"set fichier(modnick) "modnick.txt"set fichier(protect) "protect.txt"set fichier(blacklist) "blacklist.txt"set fichiers [list $::fichier(modchan) $::fichier(modmot) $::fichier(modspam) $::fichier(modnick) $::fichier(protect) $::fichier(blacklist)]foreach txt $fichiers {     if ![file exists $txt] {         close [open $txt w+]     }}################################################### Recording chan badnick, badwords            ###################################################bind dcc m xhelp dcc:modproc dcc:mod {hand idx arg} {putdcc $idx "Tcl commands moderation:"putdcc $idx ""putdcc $idx "Gestion des chans א modיrer  :"putdcc $idx "\002.modchan\002 14 (To list the moderate chan)"putdcc $idx "\002.+modchan\002 &lt;#chan&gt;14 (Adds a moderate chan)"putdcc $idx "\002.-modchan\002 &lt;#chan&gt;14 (Removes a moderate chan)"putdcc $idx ""putdcc $idx "Management forbidden words  :"putdcc $idx "\002.modmot\002 14 (To list the banned words)"putdcc $idx "\002.+modmot\002 &lt;mot&gt;14 (Adds a forbidden word)"putdcc $idx "\002.-modmot\002 &lt;mot&gt;14 (Removes a banned word)"putdcc $idx ""putdcc $idx "No spam management :"putdcc $idx "\002.modspam\002 14 (To list spam banned)"putdcc $idx "\002.+modspam\002 &lt;spam&gt;14 (Adds a prohibited spam)"putdcc $idx "\002.-modspam\002 &lt;spam&gt;14 (Removes a banned spam)"putdcc $idx ""             putdcc $idx "ctcp :"putdcc $idx "\002.modctcp\002 14 (To list spam banned)"putdcc $idx "\002.+modctcp\002 &lt;spam&gt;14 (Adds a prohibited spam)"putdcc $idx "\002.-modctcp\002 &lt;spam&gt;14 (Removes a banned spam)"putdcc $idx ""putdcc $idx "Maintenance of nicknames allowed  :"putdcc $idx "\002.modnick\002 14 (To list the nicknames allowed)"putdcc $idx "\002.+modnick\002 &lt;nick&gt;14 (Adds a nick banned)"putdcc $idx "\002.-modnick\002 &lt;nick&gt;14 (Removes a banned nick)"putdcc $idx ""putdcc $idx "Management blacklist  :"putdcc $idx "\002.blacklist\002 14 (To list the blacklist)"putdcc $idx "\002.+blacklist\002 &lt;host&gt;14 (Adds a host to the blacklist)"putdcc $idx "\002.-blacklist\002 &lt;host&gt;14 (Removes a host to the blacklist)"putdcc $idx ""putdcc $idx "Management xtrusts (Anticlones if installed)  :"putdcc $idx "\002.xtrust\002 14 (Should list the hosts protected (exempt)"putdcc $idx "\002.+xtrust\002 &lt;host&gt;14 (Adds a host to exempt)"putdcc $idx "\002.-xtrust\002 &lt;host&gt;14 (Removes a host exempted)"putdcc $idx ""putdcc $idx "Management protection against moderation  :"putdcc $idx "\002.protect\002 14 (Should list the hosts protected)"putdcc $idx "\002.+protect\002 &lt;host&gt;14 (Adds a host protected)"putdcc $idx "\002.-protect\002 &lt;host&gt;14 (Removes a host protected)"putdcc $idx ""putdcc $idx "End of the list of commands tcl moderation."}##################### Procיdures ####################### Modיration ##bind pubm - * moderation  proc moderation { nick host handle channel arg } {     global modmajuscule modrepetition modmot modspam avert rpt     set arg [split $arg]     set msg [join [lrange [split $arg] 0 end]]     set hostv $nick!$host     set userhost [getchanhost $nick]     set userhost "*!*[string range $userhost [string first @ $userhost] e]"         regsub -all -- {\003[0-9]{0,2}(,[0-9]{0,2})?|\017|\037|\002|\026|\006|\007} $msg "" msg         regsub -all -- {\{|\}|\\{|[}{|]}} $msg "" msg     if {![verify:b $::fichier(modchan) $channel]} { return }     if {[verify:a $::fichier(protect) $hostv]} { return }     if {![info exists modmajuscule($host)]} { set modmajuscule($host) 0  utimer $::expiration(majuscule) [list unset modmajuscule($host)] }     set nombre 0     foreach x [split $msg {}] {     if [string match \[A-Z\] $x] { incr nombre }     }     if {$nombre &gt; $::detect(majuscule)} {     incr modmajuscule($host) 1     if {$::avert(majuscule) &lt; $modmajuscule($host)} {     putserv "KICK $channel $nick :$::kick(majuscule)"  set modmajuscule($host) 0  return }         putserv "NOTICE $nick :$::msg(majuscule)"}     if {[info exists rpt($nick)]} {     if {[lrange $rpt($nick) 2 end]  eq  "$msg"} {     set cnt [lindex $rpt($nick) 1]  incr cnt     set rpt($nick) "[lindex $rpt($nick) 0] $cnt [lrange $rpt($nick) 2 end]"     if {[lindex $rpt($nick) 1] &gt; $::detect(repetition)} {     if {![info exists modrepetition($host)]} { set modrepetition($host) 0  utimer $::expiration(repetition) [list unset modrepetition($host)] }     incr modrepetition($host) 1     if {$::avert(repetition) &lt; $modrepetition($host)} { putserv "KICK $channel $nick :$::kick(repetition)"  set modrepetition($host) 0  return }      putserv "NOTICE $nick :$::msg(repetition)"      unset rpt($nick)     }   } else {      set rpt($nick) "[expr [clock seconds] + 10] 1 $msg"  }   } else {     set rpt($nick) "[expr [clock seconds] + 10] 1 $msg" }     if {[verify:a $::fichier(modmot) $msg]} {     if {![info exists modmot($host)]} { set modmot($host) 0  utimer $::expiration(mot) [list unset modmot($host)] }     incr modmot($host) 1     if {$::avert(mot) &lt; $modmot($host)} {     putserv "MODE $channel +b $userhost" putserv "KICK $channel $nick :$::kick(mot)" set modmot($host) 0  return }         putserv "NOTICE $nick :$::msg(mot)"     }     if {[verify:a $::fichier(modspam) $msg]} {     if {![info exists modspam($host)]} { set modspam($host) 0 utimer $::expiration(spam) [list unset modspam($host)] }     incr modspam($host) 1     if {$::avert(spam) &lt; $modspam($host)} { putserv "MODE $channel +b $userhost" putserv "KICK $channel $nick :$::kick(spam)"  set modspam($host) 0  return }     putserv "NOTICE $nick :$::msg(spam)"}}## Mass Flood/join ##bind pubm - * massfloodbind join - * massjoinproc massflood { nick uhost handle chan arg } {   global massflood     set hostv $nick!$uhost   if {[verify:a $::fichier(protect) $hostv]} {   return   }   if {![verify:b $::fichier(modchan) $chan]} {   return   }   if {![info exists massflood($chan)]} {   set massflood($chan) 0    utimer $::mass(rehashflood) [list unset massflood($chan)]   }   incr massflood($chan) 1   if {$massflood($chan) eq "$::mass(flood)"} {       putserv "mode $chan +mi"       putserv "MODE $channel +b $userhost" putserv "KICK $channel $nick :$::kick(spam)"   timer $::mass(retraitm) [list putserv "mode $chan -mi"]   }}proc massjoin {nick host hand chan} {   global massjoin     set hostv $nick!$host   if {[verify:a $::fichier(protect) $hostv]} {   return   }   if {![verify:b $::fichier(modchan) $chan]} {   return   }   if {![info exists massjoin($chan)]} {   set massjoin($chan) 0    utimer $::mass(rehashjoin) [list unset massjoin($chan)]   }     incr massjoin($chan) 1   if {$massjoin($chan) eq "$::mass(join)"} {      putserv "mode $chan +i"       putserv "MODE $channel +b $userhost" putserv "KICK $channel $nick :$::kick(spam)"  timer $::mass(retraiti) [list putserv "mode $chan -i"]   }}bind notc - * noticechanproc noticechan {nick host handle text chan} {set hostv $nick!$hostif {[verify:a $::fichier(protect) $hostv]} {return}if {![verify:b $::fichier(modchan) $chan]} {return}putquick "MODE $chan +b $userhost"putquick "kick $chan $nick :$::kick(notice)"}bind ctcp - * ctcpchanproc ctcpchan {nick host handle text chan} {set hostv $nick!$hostif {[verify:a $::fichier(protect) $hostv]} {return}if {![verify:b $::fichier(modchan) $chan]} {return}putserv "mode $chan +mi"putquick "MODE $chan +b $userhost"putquick "kick $chan $nick :$::kick(ctcp)" timer $::mass(retraitm) [list putserv "mode $chan -mi"]}## Ajout des Spams ##bind dcc m +modspam +modspambind dcc n -modspam -modspambind dcc m  modspam modspamproc +modspam {hand idx arg} {set spam [lindex $arg 0]if {$spam eq ""} {putdcc $idx "\002Erreur :\002 .+modspam &lt;spam&gt;";putdcc $idx "\002Exemple :\002 .+modspam *.*.com*"; return}if {[verify:b $::fichier(modspam) $spam]} {putdcc $idx "\002Erreur :\002 $spam est dיjא enregistrי.";return}putdcc $idx "\002+modspam :\002 $spam a יtי mis dans la liste."ajouter:donnee $::fichier(modspam) $spam}proc -modspam {hand idx arg} {set spam [lindex $arg 0]if {$spam eq ""} {putdcc $idx "\002Erreur :\002 .-modspam &lt;spam&gt;"; return}if {![verify:b $::fichier(modspam) $spam]} {putdcc $idx "\002Erreur :\002 Le spam $spam n'est pas enregistrי.";return }putdcc $idx "\002-modspam :\002 $spam n'est plus enregistrי."effacer:donnee $::fichier(modspam) $spam}proc modspam {hand idx arg} {putdcc $idx "---\002 LISTE DES SPAMS \002---";liste:donnee $idx $::fichier(modspam)}bind pub o|o .+spam +spambind pub o|o .-spam -spambind pub o|o .spamlist pub:spamlistproc +spam {nick uhost handle chan text} {set motspam [lindex $text 0]if {$motspam eq ""} {putserv "PRIVMSG $chan :\002Erreur :\002 .+spam &lt;mot spam&gt;";putserv "PRIVMSG $chan :\002Exemple :\002 .+spam msn.com"; return}if {[verify:b $::fichier(modspam) $motspam]} {putserv "PRIVMSG $chan :\002Erreur :\002 $motspam est dיjא enregistrי.";return}putserv "PRIVMSG $chan :\02\[\002Systטme AntiSpam\02]\002 \02$motspam \002a יtי ajoutי א la liste."ajouter:donnee $::fichier(modspam) $motspam}proc -spam {nick uhost handle chan text} {set motspam [lindex $text 0]if {$motspam eq ""} {putserv "PRIVMSG $chan :\002Erreur :\002 .-bav &lt;motspam&gt;"; return}if {![verify:b $::fichier(modspam) $motspam]} {putserv "PRIVMSG $chan :\002Erreur :\02$motspam \002n'est pas dans la liste.";return }putserv "PRIVMSG $chan :\02\[\002Systטme AntiSpam\02]\002 \02$motspam \002 est supprimי de la liste."effacer:donnee $::fichier(modspam) $motspam}proc pub:spamlist {nick uhost hand chan args} {global motspam  set fp [open $::fichier(modspam) "r"]set fc -1  while {![eof $fp]} {   set data [gets $fp]   incr fc   if {$data !=""} {   putserv "PRIVMSG $nick :2Liste des Spams "   putserv "PRIVMSG $nick :4#$fc - $data"    }   unset data   }   close $fp   putserv "PRIVMSG $nick :2Fin de liste"   }## Ajout des Salons א Modיrer ##bind dcc n +modchan +modchanbind dcc n -modchan -modchanbind dcc n modchan modchanproc +modchan {hand idx arg} {set chan [lindex $arg 0]if {$chan eq ""||[string index $chan 0] ne "#"} {putdcc $idx "\002Erreur :\002 .+modchan &lt;#chan&gt;"; return}if {[verify:b $::fichier(modchan) $chan]} {putdcc $idx "\002Erreur :\002 $chan est dיjא modיrer.";return}putdcc $idx "\002+modchan :\002 $chan a יtי mis dans la liste."ajouter:donnee $::fichier(modchan) $chan}proc -modchan {hand idx arg} {set chan [lindex $arg 0]if {$chan eq ""||[string index $chan 0] ne "#"} {putdcc $idx "\002Erreur :\002 .-modchan &lt;#chan&gt;"; return}if {![verify:b $::fichier(modchan) $chan]} {putdcc $idx "\002Erreur :\002 Le chan $chan n'est pas modיrer.";return}putdcc $idx "\002-modchan :\002 $chan n'est plus modיrי."effacer:donnee $::fichier(modchan) $chan}proc modchan {hand idx arg} {putdcc $idx "---\002 LISTE DES CHANS MODֹRER \002---";liste:donnee $idx $::fichier(modchan)}##################### Moderation Salon #####################bind pub o|o .+chan +chanbind pub o|o .-chan -chanbind pub o|o .listchan pub:listchanproc +chan {nick uhost handle chan text} {set moderechan [lindex $text 0]if {$moderechan eq "" ||[string index $chan 0] ne "#"} {putserv "PRIVMSG $chan :\002Erreur :\002 .+chan &lt;#Salon&gt;";putserv "PRIVMSG $chan :\002Exemple :\002 .+chan #Radio"; return}if {[verify:b $::fichier(modchan) $moderechan]} {putserv "PRIVMSG $chan :\002Erreur :\002 $moderechan est dיjא enregistrי.";return}putserv "PRIVMSG $chan :\02\[\002Moderation Salon\02]\002 \02$moderechan \002a יtי ajoutי א la liste."ajouter:donnee $::fichier(modchan) $moderechan}proc -chan {nick uhost handle chan text} {set moderechan [lindex $text 0]if {$moderechan eq "" ||[string index $chan 0] ne "#"} {putserv "PRIVMSG $chan :\002Erreur :\002 .-chan &lt;#Salon&gt;"; return}if {![verify:b $::fichier(modchan) $moderechan]} {putserv "PRIVMSG $chan :\002Erreur :\02$moderechan \002n'est pas dans la liste.";return }putserv "PRIVMSG $chan :\02\[\002Moderation Salon\02]\002 \02$moderechan \002 est supprimי de la liste."effacer:donnee $::fichier(modchan) $moderechan}proc pub:listchan {nick uhost hand chan args} {global modchan  set fp [open $::fichier(modchan) "r"]set fc -1  while {![eof $fp]} {   set data [gets $fp]   incr fc   if {$data !=""} {   putserv "PRIVMSG $nick :2Liste des Salons"   putserv "PRIVMSG $nick :4#$fc - $data"    }   unset data   }   close $fp   putserv "PRIVMSG $nick :2Fin de liste"   }## Ajout des BadWords ##bind dcc n +modmot +modmotbind dcc n -modmot -modmotbind dcc n modmot modmotproc +modmot {hand idx arg} {      set mot [lindex $arg 0]    if {$mot eq ""} {    putdcc $idx "\002Erreur :\002 .+modmot &lt;mot&gt;"return}    if {[verify:b $::fichier(modmot) $mot]} {    putdcc $idx "\002Erreur :\002 $mot est dיjא enregistrי."    return}        putdcc $idx "\002+modmot :\002 $mot a יtי mis dans la liste."        ajouter:donnee $::fichier(modmot) $mot}proc -modmot {hand idx arg} {      set mot [lindex $arg 0]    if {$mot eq ""} {     putdcc $idx "\002Erreur :\002 .-modmot &lt;mot&gt;"return}    if {![verify:b $::fichier(modmot) $mot]} {     putdcc $idx "\002Erreur :\002 Le mot $mot n'est pas enregistrי."return}         putdcc $idx "\002-modmot :\002 $mot n'est plus enregistrי."         effacer:donnee $::fichier(modmot) $mot}proc modmot {hand idx arg} {       putdcc $idx "---\002 LISTE DES MOTS INTERDIT \002---"       liste:donnee $idx $::fichier(modmot)}bind pub o|o .+badmot +badmotbind pub o|o .-badmot -badmotbind pub o|o .badmotlist pub:badmotlistproc +badmot {nick uhost handle chan text} {set mot [lindex $text 0]if {$mot eq ""} {putserv "PRIVMSG $chan :\002Erreur :\002 .+badmot &lt;mot&gt;";putserv "PRIVMSG $chan :\002Exemple :\002 .+badmot con"; return}if {[verify:b $::fichier(modmot) $mot]} {putserv "PRIVMSG $chan :\002Erreur :\002 $mot est dיjא enregistrי.";return}putserv "PRIVMSG $chan :\02\[\002Systטme Badmot\02]\002 \02$mot \002a יtי ajoutי א la liste."ajouter:donnee $::fichier(modmot) $mot}proc -badmot {nick uhost handle chan text} {set mot [lindex $text 0]if {$mot eq ""} {putserv "PRIVMSG $chan :\002Erreur :\002 .-badmot &lt;mot&gt;"; return}if {![verify:b $::fichier(modmot) $mot]} {putserv "PRIVMSG $chan :\002Erreur :\02$mot \002n'est pas dans la liste.";return }putserv "PRIVMSG $chan :\02\[\002Systטme Badmot\02]\002 \02$mot \002 est supprimי de la liste."effacer:donnee $::fichier(modmot) $mot}proc pub:badmotlist {nick uhost hand chan args} {global modmot  set fp [open $::fichier(modmot) "r"]set fc -1  while {![eof $fp]} {   set data [gets $fp]   incr fc   if {$data !=""} {   putserv "PRIVMSG $nick :2Liste des Badmot"   putserv "PRIVMSG $nick :1#$fc - 4$data"    }   unset data   }   close $fp   putserv "PRIVMSG $nick :2Fin de liste"}## Ajout des Badnicks ##bind dcc n +modnick +modnickbind dcc n -modnick -modnickbind dcc n  modnick dcc:modnickproc +modnick {hand idx arg} {     set nick [lindex $arg 0]   if {$nick eq ""} {   putdcc $idx "\002Erreur :\002 .+modnick &lt;nick&gt;"   putdcc $idx "\002Exemple :\002 .+modnick *.*.com*"    return}    if {[verify:b $::fichier(modnick) $nick]} {   putdcc $idx "\002Erreur :\002 $nick est dיjא enregistrי."return}    putdcc $idx "\002+modnick :\002 $nick a יtי mis dans la liste."    ajouter:donnee $::fichier(modnick) $nick}proc -modnick {hand idx arg} {     set nick [lindex $arg 0]   if {$nick eq ""} {       putdcc $idx "\002Erreur :\002 .-modnick &lt;nick&gt;"   return   }   if {![verify:b $::fichier(modnick) $nick]} {       putdcc $idx "\002Erreur :\002 Le nick $nick n'est pas enregistrי."   return    }       putdcc $idx "\002-modnick :\002 $nick n'est plus enregistrי."       effacer:donnee $::fichier(modnick) $nick}proc dcc:modnick {hand idx arg} {      putdcc $idx "---\002 LISTE DES NICKS \002---"    liste:donnee $idx $::fichier(modnick)}bind pub o|o .+badnick +badnickbind pub o|o .-badnick -badnickbind pub o|o .badnicklist pub:badnicklistproc +badnick {nick uhost handle chan text} {set nick [lindex $text 0]if {$nick eq ""} {putserv "PRIVMSG $chan :\002Erreur :\002 .+badnick &lt;pseudo&gt;";putserv "PRIVMSG $chan :\002Exemple :\002 .+badnick h_pour_cam*!*@*"; return}if {[verify:b $::fichier(modnick) $nick]} {putserv "PRIVMSG $chan :\002Erreur :\002 $nick est dיjא enregistrי.";return}putserv "PRIVMSG $chan :\02\[\002Systטme Badnick\02]\002 \02$nick \002a יtי ajoutי א la liste."ajouter:donnee $::fichier(modnick) $nick}proc -badnick {nick uhost handle chan text} {set nick [lindex $text 0]if {$nick eq ""} {putserv "PRIVMSG $chan :\002Erreur :\002 .-badnick &lt;pseudo&gt;"; return}if {![verify:b $::fichier(modnick) $nick]} {putserv "PRIVMSG $chan :\002Erreur :\02$nick \002n'est pas dans la liste.";return }putserv "PRIVMSG $chan :\02\[\002Systטme badnick\02]\002 \02$nick \002 est supprimי de la liste."effacer:donnee $::fichier(modnick) $nick}proc pub:badnicklist {nick uhost hand chan args} {global modnick  set fp [open $::fichier(modnick) "r"]set fc -1  while {![eof $fp]} {   set data [gets $fp]   incr fc   if {$data !=""} {   putserv "PRIVMSG $nick :2Liste des Badnick"   putserv "PRIVMSG $nick :1#$fc - 4$data"    }   unset data   }   close $fp   putserv "PRIVMSG $nick :2Fin de liste"}bind join - "*" modnickproc modnick { nick uhost handle channel } {      set hostv $nick!$uhost   if {[verify:a $::fichier(protect) $hostv]} {   return   }   if {[string equal -nocase $nick $::botnick]} {   return   }   if {![verify:b $::fichier(modchan) $channel]} {   return   }   if {![verify:a $::fichier(modnick) $nick]} {   return   }   putserv "MODE $channel +b $nick*!*"   putserv "KICK $channel $nick :$::kick(nick)"}bind nick - * modnicksuiteproc modnicksuite { nick uhost handle chan newnick } {     set hostv $nick!$uhost   if {[verify:a $::fichier(protect) $hostv]} {   return   }   if {[string equal -nocase $nick $::botnick]} {   return   }   if {![verify:b $::fichier(modchan) $chan]} {   return   }   if {![verify:a $::fichier(modnick) $nick]} {   return   }       putserv "MODE $chan +b $newnick*!*"       putserv "KICK $chan $newnick :$::kick(nick)"}#Ajout dans la blackliste :bind dcc m +blacklist +blacklistbind dcc m -blacklist -blacklistbind dcc m blacklist dcc:blacklistbind pub o|o .+bav +bavbind pub o|o .-bav -bavbind pub o|o .bavlist pub:bavlistproc +bav {nick uhost handle chan text} {set host [lindex $text 0]set pseudo [lindex $text 0]if {$host eq "" } {putserv "PRIVMSG $chan :\002Erreur :\002 .+bav &lt;host&gt;";putserv "PRIVMSG $chan :\002Exemple :\002 .+bav *!*@0000000.com";putserv "PRIVMSG $chan :\002Exemple :\002 .+bav nOf*!*"; return}if {$pseudo eq "" || ![string match **!*@* $pseudo]} {putserv "PRIVMSG $chan :4Erreur :1.+bav 4&lt;host&gt; 1ou 4&lt;pseudo*!*@*&gt;";putserv "PRIVMSG $chan :1Exemple :4 .+bav *!*@0000000.com";putserv "PRIVMSG $chan :1Exemple :4 .+bav bOulet*!*@*"; return}if {[verify:b $::fichier(protect) $host]} {     putserv "PRIVMSG $chan :\4Refusי :\002 Tu ne peux pas Blacklistי un host ou pseudo protיgי."  putserv "PRIVMSG $::salonm :\0034\|Mode.Alerte.Admin\|\003\ \0034ATTENTION: \00314$nick \0034Host: \00314$uhost \0034a tentי de Blacklister \00314$pseudo \0034Host: \00314$host \0034sur: \00314$chan"  return 1 }if {[verify:b $::fichier(blacklist) $host]} {putserv "PRIVMSG $chan :\002Erreur :\002 $host est dיjא enregistrי.";return}putserv "PRIVMSG $chan :\02\[\002Systטme BAV\02]\002 \02$host \002א יtי mis dans la liste."ajouter:donnee $::fichier(blacklist) $host}proc -bav {nick uhost handle chan text} {set host [lindex $text 0]if {$host eq ""} {putserv "PRIVMSG $chan :\002Erreur :\002 .-bav &lt;host&gt;"; return}if {![verify:b $::fichier(blacklist) $host]} {putserv "PRIVMSG $chan :\002Erreur :\02$host \002n'est pas dans la liste.";return }putserv "PRIVMSG $chan :\02\[\002Systטme BAV\02]\002 \02$host \002 n'est plus BAV."effacer:donnee $::fichier(blacklist) $host}proc pub:bavlist {nick uhost hand chan args} {global blacklist  set fp [open $::fichier(blacklist) "r"]set fc -1  while {![eof $fp]} {   set data [gets $fp]   incr fc   if {$data !=""} {   putserv "PRIVMSG $nick :2Liste des Blacklistיs"   putserv "PRIVMSG $nick :1#$fc - 4$data"    }   unset data   }   close $fp   putserv "PRIVMSG $nick :2Fin de liste"}proc +blacklist {hand idx arg} {set host [lindex $arg 0]if {$host eq ""} {putdcc $idx "\002Erreur :\002 .+blacklist &lt;host&gt;";putdcc $idx "\002Exemple :\002 .+blacklist toto*!*@*.ru"; return}if {[verify:b $::fichier(blacklist) $host]} {putdcc $idx "\002Erreur :\002 $host est dיjא enregistrי.";return}putdcc $idx "\002+blacklist :\002 $host a יtי mis dans la liste."ajouter:donnee $::fichier(blacklist) $host}proc -blacklist {hand idx arg} {set host [lindex $arg 0]if {$host eq ""} {putdcc $idx "\002Erreur :\002 .-blacklist &lt;host&gt;"; return}if {![verify:b $::fichier(blacklist) $host]} {putdcc $idx "\002Erreur :\002 Le host $host n'est pas enregistrי.";return }putdcc $idx "\002-blacklist :\002 $host n'est plus enregistrי."effacer:donnee $::fichier(blacklist) $host}proc dcc:blacklist {hand idx arg} {putdcc $idx "\002 Liste des Ban א Vue";liste:donnee $idx $::fichier(blacklist)}bind join - "*" modblacklistproc modblacklist { nick host handle channel } { set hostv $nick!$hostset userhost [getchanhost $nick]set userhost "*!*[string range $userhost [string first @ $userhost] e]"set expire "expire le [clock format [expr 3600 + [clock second]] -format "%d/%m/%Y א %H:%M (GMT+1)"]"set heure "[clock format [clock seconds] -format "%Y/%m/%d %H:%M"]"if {[string equal -nocase $nick $::botnick]} {return}if {![verify:b $::fichier(modchan) $channel]} {return}if {![verify:a $::fichier(blacklist) $hostv]} {return}putquick "KICK $channel $nick :$::kick(blacklist) $expire"putquick "MODE $channel +b $nick*!*@*"putquick "MODE $channel +b $userhost"putserv "PRIVMSG $::salonm :\0034\|Mod.KickBan.Blacklist\|\003\ \0034KickBan pour: \00314$nick \0034Host: \00314$userhost \0034(Raison: \00314$::kick(blacklist) ($expire)\0034) \0034sur: \00314$channel" }## Ajout des Pseudos/Hosts א protיger ##bind dcc o|o +xprotect +xprotectbind dcc o|o -xprotect -xprotectbind dcc o|o  xprotect xprotectproc +xprotect {hand idx arg} {   set host [lindex $arg 0]   if {$host eq ""} {      putdcc $idx "\002Erreur :\002 .+protect &lt;host&gt;"      putdcc $idx "\002Exemple :\002 .+protect platine*!*@*"   return   }   if {[verify:b $::fichier(protect) $host]} {      putdcc $idx "\002Erreur :\002 $host est dיjא enregistrי."   return   }      putdcc $idx "\002+protect :\002 Le host $host est maintenant protיgי."      ajouter:donnee $::fichier(protect) $host}proc -xprotect {hand idx arg} {     set host [lindex $arg 0]     if {$host eq ""} {    putdcc $idx "\002Erreur :\002 .-protect &lt;host&gt;" return }     if {![verify:b $::fichier(protect) $host]} {    putdcc $idx "\002Erreur :\002 Le host $host n'est pas enregistrי."     return  }        putdcc $idx "\002-protect :\002 Le host $host n'est plus protיgי."        effacer:donnee $::fichier(protect) $host}proc xprotect {hand idx arg} {     putdcc $idx "---\002 LISTE DES PROTֹGֹ CONTRE LA MODERATION \002---"     liste:donnee $idx $::fichier(protect)}bind pub o|o .+protect +protectbind pub m .-protect -protectbind pub o|o .protectlist pub:protectlistproc +protect {nick uhost handle chan text} {set host [lindex $text 0]if {$host eq ""} {putserv "PRIVMSG $chan :\002Erreur :\002 .+protect &lt;pseudo/host&gt;";putserv "PRIVMSG $chan :\002Exemple :\002 .+protect nOf*!*@*"; return}if {[verify:b $::fichier(protect) $host]} {putserv "PRIVMSG $chan :\002Erreur :\002 $host est dיjא enregistrי.";return}putserv "PRIVMSG $chan :\02\[\002Systטme Protect\02]\002 \02$host \002a יtי ajoutי א la liste."ajouter:donnee $::fichier(protect) $host}proc -protect {nick uhost handle chan text} {set host [lindex $text 0]if {$host eq ""} {putserv "PRIVMSG $chan :\002Erreur :\002 .-protect &lt;pseudo/host&gt;"; return}if {![verify:b $::fichier(protect) $host]} {putserv "PRIVMSG $chan :\002Erreur :\02$host \002n'est pas dans la liste.";return }putserv "PRIVMSG $chan :\02\[\002Systטme Protect\02]\002 \02$host \002 est supprimי de la liste."effacer:donnee $::fichier(protect) $host}proc pub:protectlist {nick uhost hand chan args} {global protect  set fp [open $::fichier(protect) "r"]set fc -1  while {![eof $fp]} {   set data [gets $fp]   incr fc   if {$data !=""} {   putserv "PRIVMSG $nick :2Liste des Protיgיs"   putserv "PRIVMSG $nick :1#$fc - 4$data"    }   unset data   }   close $fp   putserv "PRIVMSG $nick :2Fin de liste"}######################## TRAITEMENT FICHIERs ########################proc verify:a {fichierss arg} {set liste [open $fichierss r]while {![eof $liste]} {gets $liste aregsub -all -- {\{|\}|\\{|[}{|]}} $a "" aif {$a ne ""} {if {[string match -nocase *$a* $arg]} {close $liste;return 1}}}close $listereturn 0}proc verify:b {fichierss arg} {set liste [open $fichierss r]while {![eof $liste]} {gets $liste aregsub -all -- {\{|\}|\\{|[}{|]}} $a "" aif {$a ne ""} {if {[string equal -nocase $a $arg]} {close $liste;return 1}}}close $listereturn 0}proc ajouter:donnee {fichierss arg} {set liste [open $fichierss a]puts $liste "$arg"close $liste}proc effacer:donnee {fichierss arg} {set fichier(back) "$fichierss.back"set load [open $fichier(back) w+]close $loadset liste [open $fichierss r]set bcloseback [open $fichier(back) a]while {![eof $liste]} {gets $liste aif {$a ne ""} {if {[string equal -nocase [lindex $a 0] $arg]} {} else {puts $bcloseback "[lindex $a]"}}}close $listeclose $bclosebackfile delete $fichierssfile rename $fichier(back) $fichierss}proc liste:donnee {idx fichierss} {set liste [open $fichierss r]set num 0while {![eof $liste]} {gets $liste aif {$a ne ""} {incr num 1;putdcc $idx "(\002$num\002) [lindex $a 0]"}}if {$num eq "0"} { putdcc $idx "Aucun enregistrement." }putdcc $idx "---\002 FIN DE LA LISTE \002--- Total (\002$num\002)";close $listeunset num}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12047">darksis</a> — Fri Aug 24, 2012 10:19 am</p><hr />
]]></content>
	</entry>
	</feed>
