je viens car je rencontre un souci,en faite j'aimerais faire que lors un users (flag m) tape !bl on ça ajoute un flag et si il retape la meme commande sa lui indique que c'est deja activer ou désactiver j'espere avoir bien expliquer .
tcl
setudef flag SalonProtect
bind pub m !bl SalonBL
proc SalonBL{nick host hand chan arg}{set flag "SalonProtect"set Activation [lindex[split$arg]0]if{$Activation == ""}{ puthelp "PRIVMSG $chan :Merci d'utiliser la Commande !bl on/off"return0}if{$Activation == "on"}{
channel set$chan +$flag
puthelp "PRIVMSG $chan :Activation de la blackliste pour le salon ($chan)"return0}if{$Activation == "off"}{
channel set$chan -$flag
puthelp "PRIVMSG $chan :Désactivation de la blackliste"return0}}
j'ai essayer avec else mais rien y fait sa m'avais retourner des erreurs
[22:18] wrong # args: should be "proc name args body"
et qd j'ajoute else
tcl
bind pub m !bl SalonBL
proc SalonBL {nick host hand chan arg}{set flag "SalonProtect"set Activation [lindex[split$arg]0]if{$Activation == ""}{ puthelp "PRIVMSG $chan :Merci d'utiliser la Commande !bl on/off"return0}if{$Activation == "on"}{
channel set$chan +$flag
puthelp "PRIVMSG $chan :Activation de la blackliste pour le salon ($chan)"return0}else{
puthelp "PRIVMSG $chan :c'est deja activer"}
j'ai toujours la premier phrase qui s'affiche "Activation de la blackliste pour le salon ($chan)"
C'est normal tu ne vérifies pas que si le flag est activé ou pas.
A chaque passage dans:
tcl
if{$Activation == "on"}{
tu vérifies si l'argument est bien "on" et non s'il a été activé auparavant, du coup il te balancera a chaque fois la phrase "Activation de la blackliste pour le salon ($chan)" si tu as tapé: "!bl on".
voila j'aimerais savoir comment je peut faire pour savoir quand je tape &status sa me dise quel flag sont activer et sur quel salon donc j'ai fait un p'tit truc comme ça mais quandd je tape &status sa me dit que seulement sur le salon ou j'ai taper la commande. j'aimerais que sa me dise ou les flags sont activer.
tcl
bind pub n &status status
proc status { nick host hand chan arg }{global botnick
if{[channel get $chan"SalonAntiClone"]}{
putserv "privmsg $chan :Anti-Clone Activer sur $chan."}if{[channel get $chan"SalonProtect"]}{
putserv "privmsg $chan :Vip'S est Activer sur $chan."}}
y aurais 'til une ame charitable parmis vous pour m'aider svp ?
# Mieux vaut ne pas cumuler les noms génériques
bind pub n &status pub:flagsStatus
#Oué, mettre arg cay le malproc pub:flagsStatus {nick uhost hand chan text}{
# On initialise les variables pour Tcl 8.4set anticloneChans {}set protectChans {}
# On vérifie chaque canal...foreach channel [channels]{
# Si le bot est pas dessus, osefif![onchan $channel]continue# On ajoute le chan si les flags sont bonsif[channel get $channel"SalonAntiClone"]{lappend anticloneChans $channel}if[channel get $channel"SalonProtect"]{lappend protectChans $channel}# Fin du foreach..}
# On a plus qu'a afficherif[llength$protectChans]{ putserv [concat PRIVMSG $chan :Vip'S activé sur les canaux : [join$protectChans", "]}if[llength$anticloneChans]{ putserv [concat PRIVMSG $chan :Anti-clone activé sur les canaux : [join$anticloneChans", "]}
# Cay fini !return}
bind pub n &status status
proc status { nick host hand chan arg }{global botnick
if{[channel get $chan"SalonAntiClone"]}{
putserv "privmsg $chan :Anti-Clone Activer sur $chan."}if{[channel get $chan"SalonProtect"]}{
putserv "privmsg $chan :Vip'S est Activer sur $chan."}if{[channel get $chan"blacklist"]}{
putserv "privmsg $chan :La Blackliste est Activer sur $chan."}}
et donc Quand je tape &status ça m'affiche bien si l'anti clone et activer ect ..mais sa veut pas me dire si il est activer sur d'autre chan
apres chercher un peut partout j'ai réussi à faire fonctionner la version de ArtiX
tcl
# Mieux vaut ne pas cumuler les noms génériques
bind pub n &status pub:flagsStatus
#Oué, mettre arg cay le malproc pub:flagsStatus {nick uhost hand chan text}{
# On initialise les variables pour Tcl 8.4set anticloneChans {}set protectChans {}
# On vérifie chaque canal...foreach channel [channels]{
# Si le bot est pas dessus, osefif[onchan $channel]continue# On ajoute le chan si les flags sont bonsif[channel get $channel"SalonAntiClone"]{lappend anticloneChans $channel}if[channel get $channel"SalonProtect"]{lappend protectChans $channel}# Fin du foreach..}
# On a plus qu'a afficherif[llength$protectChans]{ putserv [concat PRIVMSG $chan :Vip'S activé sur les canaux : [join$protectChans", "]]}if[llength$anticloneChans]{ putserv [concat PRIVMSG $chan :Anti-clone activé sur les canaux : [join$anticloneChans", "]]}
# Cay fini !return}