23/06/2011, 18:29
salut,
j me permet de simplifier légèrement ton code qui contient pas mal de superflus
j me permet de simplifier légèrement ton code qui contient pas mal de superflus
tcl
setudef flag WS
set ::phrases {
"Bonjour bienvenue sur le salon !"
"Hello tu es le bienvenue pose toi tranquil"
"salut tu es sur le salon alors soit la bienvenue à toi !"
}
bind join - "*" wj
proc wj {nick uhost handle chan} {
if {![channel get $chan WS] || [isbotnick $nick]} return
set ::phrase [lindex $::phrases [rand [llength $::phrases]]]
putserv "PRIVMSG $chan :\0034 $::phrase\0031"
}
bind pub o "!won" won
proc won { nick host hand chan arg } {
if ![channel get $chan WS] {
channel set $chan +WS
putquick "PRIVMSG $chan :Welcome Activé sur $chan !"
return
}
putquick "PRIVMSG $chan :Welcome déjà Activé sur $chan !"
}
bind pub o "!woff" woff
proc woff { nick host hand chan arg } {
if [channel get $chan WS] {
channel set $chan -WS
putquick "PRIVMSG $chan :Welcome Désactivé sur $chan !"
return
}
putquick "PRIVMSG $chan :Welcome déjà Désactivé sur $chan !"
}