Communauté Eggdrop

Version complète : erreur avec un putkick
Vous consultez actuellement la version basse qualité d’un document. Voir la version complète avec le bon formatage.
Bonsoir à tous Smile

Alors voulant faire les choses bien en modifiant mes "putserv "PRIVMSG chanserv kick..." par un "putkick" voila que je tombe sur une erreur voici le code :
tcl
set cs "ChanServ"
set chanlog "#Services"
set vhostexempt {
 *@domain.tld
}
 
bind pub o !kr kickraison
bind pub o !kflood kickflood
 
proc kickraison { nick host hand channel text } {
 global cs chanlog vhostexempt
 set args [split $text]
 set victim [lindex $args 0]
 set reason [join [lrange $args 1 end]]
 if { ![onchan $victim $channel] } {
   putserv "PRIVMSG $channel :\0034$victim \00312n'est pas là \0037$nick"
return 0
 }
 set vichost [getchanhost $victim $channel]
 set protec 0
 foreach vhost $vhostexempt {
if { [string match -nocase $vhost $vichost] } {
 set protec 1
}
 }
 if { $protec == 1 } {
   putserv "NOTICE $nick :\002\0034ATTENTION \002\0036$victim \00312Est dans la liste des pseudos protégés \0037$nick \00312!!!"
   } else {
   putkick $channel $victim $reason
   putserv "PRIVMSG $chanlog :\0034$victim \00312a été kick de \0034$channel \00312par \0034$nick \00312pour la raison :\0037 $reason"
 }
}
 
proc kickflood { nick host hand channel arg } {
 global cs chanlog vhostexempt
 if { ![onchan $arg $channel] } {
   putserv "PRIVMSG $channel :\0034$arg \00312n'est pas là \0037$nick"
return 0
 }
 set vichost [getchanhost $arg $channel]
 set protec 0
 foreach vhost $vhostexempt {
if { [string match -nocase $vhost $vichost] } {
 set protec 1
}
 }
 if { $protec == 1 } {
   putserv "NOTICE $nick :\002\0034ATTENTION \002\0036$arg \00312Est dans la liste des pseudos protégés \0037$nick \00312!!!"
   } else {
   putkick $channel $arg \00312Le flood est interdit sur les salons officiels !
   putserv "PRIVMSG $chanlog :\0034$arg \00312a été kick de \0034$channel \00312par \0034$nick \00312pour flood."
 }
}


Donc avec la proc "kickraison" aucun problème fonctionne très bien. Le problème est avec la proc "kickflood"
Voici le message d'erreur :
Code :
[22:56:02] Tcl error [kickflood]: wrong # args: should be "putkick channel nick?s? ?comment?"
Je ne comprend pas il ne me prend pas en compte mon kick
Peut-on m'éclairer et me guider sur la bonne voix ?

Bien à vous.

Bye.
Mets des " autour du message:
tcl
putkick $channel $arg "\00312Le flood est interdit sur les salons officiels !"



Sinon, chaque mot (ou chaine de caractères) est pris comme un argument, et ça en fait trop pour putkick
Ok merci CrazyCat pour cette précision fonctionne parfaitement bien Smile