Mise en forme de code: pensez à utiliser les balises [ tcl ] et [ /tcl ] (sans les espaces bien sûr) autour de vos codes tcl afin d'avoir un meilleur rendu et une coloration syntaxique. x


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.
#2
Qu'as-tu déjà fait ou essayé ?
zeolia: tchat gratuit, sans inscription ni publicité
Merci de ne pas demander d'aide en MP
Away
#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
#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 }
   ...

zeolia: tchat gratuit, sans inscription ni publicité
Merci de ne pas demander d'aide en MP
Away
#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.


Possibly Related Threads…
Thread Author Replies Views Last Post
  [Script] Voice-auto SQL aliasangelius 0 2,362 21/07/2018, 08:05
Last Post: aliasangelius
  ajout d'une fonction sur un auto voice on join Alucard`68 13 5,626 09/07/2018, 12:22
Last Post: aliasangelius
  Auto voice après X lignes Scorpio 1 3,249 04/02/2016, 00:57
Last Post: BaGrift
  trivia - voice faible blackdevil 2 4,222 29/12/2012, 17:47
Last Post: blackdevil
  Voice-In aliasangelius 1 3,491 06/08/2012, 12:21
Last Post: aliasangelius
  voice devoice Romu83 11 6,618 23/02/2012, 13:16
Last Post: BdS
  voice faible DodY 2 3,490 13/06/2010, 20:44
Last Post: DodY

Forum Jump:


Users browsing this thread: 1 Guest(s)