[Résolu] rajout d'une exception sur une commande de kick
#4
ok aliasangelus donc voici le le code la procédure sans les modifications
tcl
set log "#services"
set cs "ChanServ"
 
set vhostmodo2 {
  RooT@domain.tld
  *@TechAdmin.domain.tld
  *@NetAdmin.domain.tld
  *@Admin.domain.tld
  *@CoAdmin.domain.tld
  *@IRCop.domain.tld
  *@ChanMaster.domain.tld
  Ange@Faucheur.domain.tld
}
 
set vhostmodo1 {
  *@Moderateur.domain.tld
  *@Moderatrice.domain.tld
  *@Operateur.domain.tld
  *@Operatrice.domain.tld
}
 
set vhostmodo {
  RooT@domain.tld
  *@TechAdmin.domain.tld
  *@NetAdmin.domain.tld
  *@Admin.domain.tld
  *@CoAdmin.domain.tld
  *@IRCop.domain.tld
  *@ChanMaster.domain.tld
  Ange@Faucheur.domain.tld
  *@Moderateur.domain.tld
  *@Moderatrice.domain.tld
  *@Operateur.domain.tld
  *@Operatrice.domain.tld
  *@Services.domain.tld
}
 
proc kickraison { nick host hand channel text } {
  global vhostmodo2 kickraison
  set args [split $text]
  set victim [lindex $args 0]
  set reason [join [lrange $args 1 end]]
  foreach vhost $vhostmodo2 {
    if [string match -nocase $vhost $host] {
      putserv "PRIVMSG $::cs kick $channel $victim $reason"
      putserv "PRIVMSG $::log :\0034$victim \00312a été kick de \0034$channel \00312par \0034$nick \00312pour la raison :\0037 $reason"
      }
   }
}


la procédures avec les modifications :
tcl
proc kickraison { nick host hand channel text } {
  global vhostmodo2 kickraison
  global vhostmodo kickraison
  set args [split $text]
  set victim [lindex $args 0]
  set reason [join [lrange $args 1 end]]
  if { $vhost == $vhostmodo } { return 0 }
  foreach vhost $vhostmodo2 {
    if [string match -nocase $vhost $host] {
      putserv "PRIVMSG $::cs kick $channel $victim $reason"
      putserv "PRIVMSG $::log :\0034$victim \00312à été kick de \0034$channel \00312par \0034$nick \00312pour la raison\0037 $reason."
      }
   }
}


Et le message d'erreur en PL :
Code :
[15:23:12] Tcl error [kickraison]: can't read "vhost": no such variable
Donc si je comprend bien je n'arrive pas a lire la variable "vhost" de la ligne
Code :
if { $vhost == $vhostmodo } { return 0 }
suis-je sur la bonne voix ?

Merci d'avance pour votre future aide.

Bien à vous.

Bye.
Répondre Avertir


Messages dans ce sujet
RE: rajout d'une exception sur une commande de kick - par Alucard`68 - 28/01/2017, 17:56

Atteindre :


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