Activation
#1
Coucou tous le monde,

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 Mad 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"
return 0
}
if {$Activation == "on"} {
channel set $chan +$flag
puthelp "PRIVMSG $chan :Activation de la blackliste pour le salon ($chan)"
return 0
}
if {$Activation == "off"} {
channel set $chan -$flag
puthelp "PRIVMSG $chan :Désactivation de la blackliste"
return 0
}
}



j'ai essayer avec else mais rien y fait sa m'avais retourner des erreurs
Sad
merci de votre aide
Répondre Avertir
#2
Perso je vois qu'un problème, il manque un espace à la première ligne :s
TCL
proc SalonBL{nick host hand chan arg} {


TCL
proc SalonBL {nick host hand chan arg} {



Sinon heu.... quelle est l'erreur ^^' ?
Répondre Avertir
#3
bonsoir

j'ai cette erreur
TCL
[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"
return 0
}
if {$Activation == "on"} {
channel set $chan +$flag
puthelp "PRIVMSG $chan :Activation de la blackliste pour le salon ($chan)"
return 0
} 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)"
Répondre Avertir
#4
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".
CrazyCat a écrit :La prochaine fois, essaye d'imaginer que j'ai un cerveau ...
Répondre Avertir
#5
re coucou à tous,

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 ?

merci beaucoup
Répondre Avertir
#6
TCL
# Mieux vaut ne pas cumuler les noms génériques
bind pub n &status pub:flagsStatus

#Oué, mettre arg cay le mal
proc pub:flagsStatus {nick uhost hand chan text} {
# On initialise les variables pour Tcl 8.4
set anticloneChans {}
set protectChans {}

# On vérifie chaque canal...
foreach channel [channels] { 
# Si le bot est pas dessus, osef
if ![onchan $channel] continue
# On ajoute le chan si les flags sont bons
if [channel get $channel "SalonAntiClone"] { lappend anticloneChans $channel }
if [channel get $channel "SalonProtect"] { lappend protectChans $channel }
# Fin du foreach..
}

# On a plus qu'a afficher
if [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 }



Non testé :s
Répondre Avertir
#7
merci Artix pour ta réponse j'ai tester ta version et aucune erreur en pl mais il indique rien sur le salon lol.
Répondre Avertir
#8
Ca pourrait signifier que tu n'as activé ton script sur aucun chan.

pour l'activer sur #monchan, tu dois taper :
Code :
.chanset #monchan +SalonAntiClone
.chanset #monchan +SalonProtect
Répondre Avertir
#9
bonsoir, merci beaucoup de vos reponse rapide

il sont bien ajouter

en pl j'ai ceci :
Citation :|21:06:20| <Nvidia> [21:06]UDEF: SalonAntiClone defined
|21:06:20| <Nvidia> [21:06] Anti-Clone.tcl 1.9 béta chargé.
|21:06:20| <Nvidia> [21:06]UDEF: blacklist defined
|21:06:20| <Nvidia> [21:06] BlackList.tcl charger...
|21:06:20| <Nvidia> [21:06] UDEF: SalonProtect defined
|21:06:20| <Nvidia> [21:06] Autorise.tcl 2.1 chargé....

et j'avais fait ceci en code
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."
}
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
Répondre Avertir
#10
Il ne faut pas trop demander.
Prend exemple sur les TCL d'Artix et regarde les tuto sur le site même !

Il faut apprendre aussi et non rien faire Smile
Répondre Avertir
#11
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 mal
proc pub:flagsStatus {nick uhost hand chan text} {
# On initialise les variables pour Tcl 8.4
set anticloneChans {}
set protectChans {}
 
# On vérifie chaque canal...
foreach channel [channels] {
# Si le bot est pas dessus, osef
if [onchan $channel] continue
# On ajoute le chan si les flags sont bons
if [channel get $channel "SalonAntiClone"] { lappend anticloneChans $channel }
if [channel get $channel "SalonProtect"] { lappend protectChans $channel }
# Fin du foreach..
}
 
# On a plus qu'a afficher
if [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 }



il manquais " ] "
Répondre Avertir


Atteindre :


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