voice.tcl
#1
Bonjour,

alors j'ai trouver un code qui permet de voice automatiquement les personne qui arrivent sur mon salon.

se que j'aimerais ajouter à se code c'est une liste de pseudo qui ne seront pas voice.

voila le code:

TCL
## allvoice.tcl
##  - voices everyone in a channel when they join

 
# What channels should this work on?
#  - note, "" is for all channels
set avchan "#Mon-Salon"

## Begin the code
 
bind join - * avjoin
 
proc avjoin {nick uhost hand chan} {
 global avchan botnick
 if {$nick == $botnick} {return 0}
 if {$avchan == "" && [botisop $chan]} {
  pushmode $chan +v $nick
  return 0
 }
 set chan [string tolower $chan]
 foreach i [string tolower $avchan] {
  if {$i == $chan && [botisop $chan]} {
   pushmode $chan +v $nick
   return 0
  }
 }
}



Merci d'avance pour votre aide future.

Cordialement.
Répondre Avertir
#2
Qu'as-tu déjà fait ou essayé ?
Répondre
#3
Oui désolé oublié de poster se que j'avais fait.
J'ai tenter de faire quelque chose comme ça mais je bloque.

TCL
proc avjoin {nick uhost hand chan} {
global avchan botnick
  if {$nick == "Alucard`68"} { return 0 }
}



Voila ça ne fonctionne pas

PS: J'ai effacé cette partie du code et j'ai remarqué qu'il y avait une condition pour le botnick. Donc j'ai reproduis une ligne utilisant la même condition et cela fonctionne.
TCL
proc avjoin {nick uhost hand chan} {
 global avchan botnick
 if {$nick == $botnick} {return 0}
 if {$nick == Alucard`68} {return 0}
 if {$avchan == "" && [botisop $chan]} {
  pushmode $chan +v $nick
  return 0
 }



par contre je devrais rajouter une ligne à chaque fois pour chaque utilisateur...
une optimisation est-elle possible pour ne pas avoir a mettre une ligne a chaque fois.

Merci de m'aider si une optimisation est possible je débute dans le codage tcl.

PS: En fin de compte se que j'ai fait ne fonctionne pas du tout je m'en suis rendu quand un user est arrivé sur mon salon il n'as pas été voice alors qu'il n'est pas dans la liste. Du coup je me suis connecté en PL avec mon bot et j'ai se message.

[code][15:45:51] <Jessica`68> [15:45:58] Tcl error [avjoin]: invalid bareword "Alucard"
[15:45:51] <Jessica68> in expression "$nick == Alucard68";
[15:45:51] <Jessica`68> should be "$Alucard" or "{Alucard}" or "Alucard(...)" or ...[/codes]
Que faire pour que mon pseudo ne renvoie pas d'erreur en PL ?
Sinon j'ai fait un autre test j'ai mis un autre pseudo à la place du mien qui ne possède pas le caractère ` et il a quand même été voice sur le salon.

Voila la je ne sais plus quoi faire.

Merci d'avance
Répondre Avertir
#4
Ok, c'est l'idée, mais c'est pas tout à fait ça:
TCL
set exnicks "Alucard`68 Jessica"
 
proc avjoin {nick uhost hand chan} {
   global avchan botnick exnicks
   if { [lsearch -nocase [split $exnicks] $nick] >= 0 } { return 0 }
   ...


Répondre
#5
Alors j'ai mis ton code CrazyCat

de cette manière

TCL
set avchan "#LibertY-Land"
 
 
bind join - * avjoin
 
proc avjoin {nick uhost hand chan} {
 global avchan botnick
 if {$nick == $botnick} {return 0}
 if {$avchan == "" && [botisop $chan]} {
  pushmode $chan +v $nick
  return 0
 }
 set chan [string tolower $chan]
 foreach i [string tolower $avchan] {
  if {$i == $chan && [botisop $chan]} {
   pushmode $chan +v $nick
   return 0
  }
 }
}
 
set exnicks "Alucard`68"
 
proc avjoin {nick uhost hand chan} {
   global avchan botnick exnicks
   if { [lsearch -nocase [split $exnicks] $nick] >= 0 } { return 0 }
}



cela ne fonctionne pas j'ai peu être mal inséré le code.

Cordialement.

Effectivement j'avais mal inséré le code je l'es inséré de cette manière:
TCL
set avchan "#LibertY-Land"
set exnicks "Alucard`68 Jessica"
 
 
bind join - * avjoin
 
proc avjoin {nick uhost hand chan} {
 global avchan botnick exnicks
 if { [lsearch -nocase [split $exnicks] $nick] >= 0 } { return 0 }
 if {$avchan == "" && [botisop $chan]} {
  pushmode $chan +v $nick
  return 0
 }
 set chan [string tolower $chan]
 foreach i [string tolower $avchan] {
  if {$i == $chan && [botisop $chan]} {
   pushmode $chan +v $nick
   return 0
  }
 }
}



Cela fonctionne parfaitement.
Merci CrazyCat pour ton aide

Cordialement.
Répondre Avertir


Atteindre :


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