Messages : 142
Sujets : 22
Inscription : Mar 2008
Niveau d’avertissement :
0%
Bonjour,
j'ai un petit soucis de format de ban dans un proc
if [onchan $p1 $channel] {putquick "mode $channel +bb $rest* [lindex [split [getchanhost $rest $channel] @] 1]"
Ca ban le pseudo et son host mais si celle si change d'extension, il peut revenir sans pb
Quel format adapter?
Merci
Gilles
Messages : 2,319
Sujets : 190
Inscription : Apr 2004
Voila une petite procédure utile pour toi:
TCLcopier
# choix du type de ban
set masktype 0
# valeurs possibles:
# 0 - *!*@machine.domain.com / *!*@555.555.555.555
# 1 - *!*ident@machine.domain.com / *!*ident@555.555.555.555
# 2 - *!*ident@*.domain.com / *!*ident@555.555.555.*
proc masktype { uhost} {
switch -exact -- $ ::masktype {
0 { return *!* [ string range $uhost [ string first @ $uhost ] end] }
1 { return *!* $uhost }
2 { return *!* [ lindex [ split [ maskhost $uhost ] "!" ] 1 ] }
}
return
}
Messages : 2,319
Sujets : 190
Inscription : Apr 2004
02/11/2008, 19:03
(Modification du message : 02/11/2008, 19:04 par CrazyCat .)
bewess a écrit : Merci pour la réponse, je poste tcl pour savoir comment l'integrer dedans sans faire de conneries ...bewess a écrit : TCLcopier
if [ onchan $p1 $channel ] { putquick "mode $channel +bb $rest* [lindex [split [getchanhost $rest $channel] @] 1]"
Il te suffit de remplacer ta ligne précédente par:
TCLcopier
if [ onchan $p1 $channel ] {
putquick "mode $channel +b [maskhost $rest]"
}
(si $rest est bien l'hostmask de la victime)