01/06/2011, 21:00
tcl
if {[regexp -nocase {expression} $text]!=""} {
putserv "KICK $chan $nick :Attention tu viens d'être kické pour avoir dit le mot interdit oui ou Non :bete:"
}
if {[regexp -nocase {expression} $text]!=""} {
putserv "KICK $chan $nick :Attention tu viens d'être kické pour avoir dit le mot interdit oui ou Non :bete:"
}
# Badword Kick by KuNgFo0
set badwords {
"*oui*"
"*non*"
}
# Kick MSG
set badword_msg "Bad Word"
# Channels
set badword_chans "#conceptionl"
bind pubm - * pubm_badword
putlog "badword loaded"
proc pubm_badword {nick uhost hand chan arg} {
global badwords badword_msg badword_chans botnick
set arg [stripcodes uacgbr $arg]
if {(([lsearch -exact [string tolower $badword_chans] [string tolower $chan]] != -1) || ($badword_chans == "*")) && (![matchattr $hand b]) && ($nick != $botnick)} {
foreach badword [string tolower $badwords] {
if {[string match -nocase $badword $arg]} {
putserv "KICK $chan $nick :$badword_msg"
return
}
}
}
}
fedora a écrit :en recherchant un peut sur le site,je suis tomber sur le code de Dj_KennY qui fait un peut ce que tu recherche.j'ai ajouter un foreach.
tcl
namespace eval speak { # variable contenant les mots à reconnaitre # on pourras utiliser des wildchar * ? variable bonjour {oui non} setudef flag OuiNon } bind pubm - * speak::bonjour proc speak::bonjour {nick host hand chan text} { # on déclare les variable bonjour variable bonjour if {[channel get $chan OuiNon]} { # on debug le texte et on met tout en minuscules set text [stripcodes abcru $text] set text [string tolower $text] # on test si on trouve le texte dans la variable bonjour foreach mot $text { if {[lsearch -exact $bonjour $mot] != -1} { putserv "KICK $chan $nick :Attention tu viens d'être kické pour avoir dit le mot interdit oui ou Non :bete:" # on ferme les \} qu on a ouvert plus haut } } } }
pour l'activer tape en pl .chanset #salon +OuiNon
essaye de tester comme sa voir. perso j'ai tester est sa fonctionne ...
bind pub - !ouinon ouinon
proc ouinon {nick host hand chan arg} {
global botnick
channel set $chan +OuiNon
putserv "PRIVMSG $::chanback :Oui non activé par $nick."
}
snip74 a écrit :Re all,
Tiens je viens de m'apercevoir qu'il y avait un truc qui va pas :/
avec la variable :
{oui 'o u i' non 'n o n' nan 'n a n' oué 'o u é' oue 'o u e' ouais 'o u a i s' ouai 'o u a i' yes 'y e s' ouep 'o u e p'}
quand une personne tape a f par exemple sa le kick voila l'exemple :
[13:11] <Franck> toute a fais
[13:11] * Franck was kicked by Nioui-Ninon (Attention tu viens d'être kické pour avoir dit le mot interdit oui ou Non :bete
après avoir fait des testes voila se que sa donne :
[13:35] <snip74> af
[13:35] <snip74> a f
[13:35] * You were kicked by Nioui-Ninon (Attention tu viens d'être kické pour avoir dit le mot interdit oui ou Non :bete
Cordialement Stéphane
namespace eval speak {
# variable contenant les mots à reconnaitre
# on pourras utiliser des wildchar * ?
variable bonjour {oui non}
setudef flag OuiNon
}
bind pubm - * speak::bonjour
proc speak::bonjour {nick host hand chan text} {
# on déclare les variable bonjour
variable bonjour
if {[channel get $chan OuiNon]} {
# on debug le texte et on met tout en minuscules
set text [stripcodes abcru $text]
set text [string tolower $text]
# on test si on trouve le texte dans la variable bonjour
foreach mot $text {
if {[lsearch -exact $bonjour $mot] != -1} {
putserv "KICK $chan $nick :Attention tu viens d'être kické pour avoir dit le mot interdit oui ou Non :bete:"
# on ferme les \} qu on a ouvert plus haut
}
}
if {[regexp -nocase {expression} $text]!=""} {
putserv "KICK $chan $nick :Attention tu viens d'être kické pour avoir dit le mot interdit oui ou Non :bete:"
}
}
}
[00:23:40] <@popcorn> C koi ce delire
[00:23:40] [Kick] popcorn kické de #accueil par tyrex : Attention tu viens d'être kické pour avoir dit le mot interdit oui ou Non :bete:
[00:36:36] <@loulou> oupssssssss
[00:36:37] [Kick] loulou kické de #accueil par tyrex : Attention tu viens d'être kické pour avoir dit le mot interdit oui ou Non :bete:
if {[regexp -nocase {expression} $text]!=""} {