un welcome.
#2
salut,

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 !"
}


C'est en reconnaissant ses erreurs que l'on progresse Wink
Répondre Avertir


Messages dans ce sujet
un welcome. - par aliasangelius - 23/06/2011, 17:51
RE: un welcome. - par djkenny - 23/06/2011, 18:29
RE: un welcome. - par aliasangelius - 23/06/2011, 19:19
RE: un welcome. - par fedora - 23/06/2011, 19:23
RE: un welcome. - par aliasangelius - 23/06/2011, 19:50
RE: un welcome. - par djkenny - 23/06/2011, 20:33
RE: un welcome. - par aliasangelius - 23/06/2011, 20:38
RE: un welcome. - par CrazyCat - 23/06/2011, 22:13

Atteindre :


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