problème sur certaine commande
#7
Mais bien sûr que ça ne peut pas marcher, c'est complètement faux !
Alucard`68 a écrit :
tcl
if {$commande == ""} {
  switch -- $commande {
  "!biere" {
    putquick "PRIVMSG $chan :\0037$nick \00312se décapsule une bonne bière bien fraiche."
} else {
    putquick "PRIVMSG $chan :\0037$nick \00312offre une bonne bière bien fraiche à\0034 [lrange $arg 1 end] \00312."
}


Voici à quoi ça devrait ressembler :
tcl
if {$commande == ""} {
   switch -- $commande {
      "!biere" {
         if {[llength [split $arg]]==1} {
            putquick "PRIVMSG $chan :\0037$nick \00312se décapsule une bonne bière bien fraiche."
         } else {
            putquick "PRIVMSG $chan :\0037$nick \00312offre une bonne bière bien fraiche à\0034 [lrange $arg 1 end] \00312."
         }
      }
      default { putserv "PRIVMSG $chan :$commande est inconnu" }
   }
}


Avec ton code, tu mélange du switch et du else...
Répondre


Messages dans ce sujet
RE: problème sur certaine commande - par CrazyCat - 21/05/2012, 11:02

Atteindre :


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