Communauté Eggdrop
TCL Auto-sajoin fonctionne partiellement. - Version imprimable

+- Communauté Eggdrop (https://forum.eggdrop.fr)
+-- Forum : Eggdrop et TCL (https://forum.eggdrop.fr/forumdisplay.php?fid=8)
+--- Forum : Scripts TCL (https://forum.eggdrop.fr/forumdisplay.php?fid=4)
+--- Sujet : TCL Auto-sajoin fonctionne partiellement. (/showthread.php?tid=1003)

Pages : 1 2


TCL Auto-sajoin fonctionne partiellement. - Aristide - 31/07/2011

J'avais besoin d'un TCL pour l'autosajoin des anims aux salons staff, donc j'ai pris celui que blacknight avait posté sur le forum, j'ai essayé de le modifier pour le débug, y'a que la 1ère partie qui fonctionne correctement "!addsaj pseudo #salon", le reste déconne....
Je voudrais qu'il liste les pseudos ajoutés avec leurs salons d'autosaj en utilisant la commande !listsaj, et qu'il retire les sajs du nick en tapant !delsaj nick
J'espère que vous pourriez m'aider afin de le corriger. Merci d'avance.

Code :
set vhostkill {
   *@NetAdmin.*****.org
   *@TechAdmin.*****.org
   *@ChanAdmin.*****.org
   *@ChefZone.*****.org
   *@Chanop.*****.org
   *@CoChefZone.*****.org
}

set vhostplus {
   *@NetAdmin.*****.org
   *@TechAdmin.*****.org
   *@ChanAdmin.*****.org
   *@ChefZone.*****.org
   *@Chanop.*****.org
   *@CoChefZone.*****.org

}


set salonstaff {
"#Staff"
"#Staff+"
"#Bureau"
"#Control"
"#Bravo"
"#Tango"
"#plaintes"
}

bind pub - !addsaj add_saj
bind pub - !delsaj del_saj
bind pub - !listsaj list_saj
bind join - "*" auto_saj


# configuration NE PAS EDITER
set sajdb "sajoin.txt"
set sajuse ""



# Les Procs

proc add_saj {nick host hand chan text} {
global vhostkill sajdb sajuse
foreach vhostaddautosaj $vhostkill {
  if [string match -nocase $vhostaddautosaj $host]  {
set victim [lindex $text 0]
set vchan [split $text 1]
set sajt [del_sajuse $nick]
set sajuse "[lrange $sajuse 0 end] $victim $vchan"
set f [open "$sajdb" "a"]
puts $f "$sajuse"
close $f
putquick "PRIVMSG $chan : \002\00303OK.\002\00312 AutoJoin vers $vchan ajouté pour $victim.\003"
}
}
}


proc del_saj {nick host hand chan text} {
global vhostkill sajdb sajuse
foreach vhostdelautosaj $vhostkill {
  if [string match -nocase $vhostdelautosaj $host]  {
set sajuse [del_sajuse [lindex $text 0]]
set f [open "$sajdb" "a"]
puts $f "$sajuse"
close $f
putquick "PRIVMSG $chan : \002\00303OK.\002\00312 [lindex $text 0] n'a plus d'AutoJoin.\003"
}
}
}

proc list_saj {nick host hand chan text} {
global vhostkill sajdb sajuse
foreach vhostshowautosaj $vhostkill {
  if [string match -nocase $vhostshowautosaj $host]  {
set saju [llength $sajuse]
set listsaj ""
set i "0"
putquick "PRIVMSG $chan :\002\00306L\002\00312iste \002D\002es \002\00304A\002uto-\002J\002oin \:"
while { $i <= $saju } {
set saj [lindex $sajuse $i]
set saj [split $saj "@"]
set sajn [lindex $saj 0]
set sajc [lindex $saj 1]
if { $sajn != "" } {
set listsaj "[lrange $listsaj 0 end] \00304$sajn \00312(\00303$sajc\00312), "
}
if { [llength $listsaj] >= "6" } {
putquick "PRIVMSG $chan :$listsaj"
set listsaj ""
}
incr i
}
if { $listsaj != "" } {
putquick "PRIVMSG $chan :$listsaj"
set listsaj ""
}
putquick "PRIVMSG $chan :\002\00306F\002\00312in \002D\002e \002L\002a \002L\002iste."
return
}
}
}

proc del_sajuse { nick } {
global sajuse
set saju [llength $sajuse]
set listsaj ""
set sajx "0"
set i "0"
while { $i <= $saju } {
set sajc [lindex $sajuse $i]
set sajt [split $sajc "@"]
set sajy [lindex $sajt 0]
if {![string match -nocase $nick $sajy]} {
set listsaj "[lrange $listsaj 0 end] $sajc"
} else { set sajx 1 }
incr i
}
return $listsaj
}

proc auto_saj {nick host hand chan} {
global sajuse
set saju [llength $sajuse]
set listsaj ""
set i "0"
while { $i <= $saju } {
set saj [lindex $sajuse $i]
set saj [split $saj "@"]
set sajn [lindex $saj 0]
set sajc [lindex $saj 1]
if {[string match -nocase $nick $sajn]} {
set ::timernick $nick
set ::timerchan $sajc
utimer 5 {
putquick "SAJOIN $::timernick $::timerchan"
set ::timernick ""
set ::timerchan ""
}
}
incr i
}
return
}



RE: TCL Auto-sajoin fonctionne partiellement. - aliasangelius - 31/07/2011

Bonjour,

as-tu une erreur en pl ou autre ?


RE: TCL Auto-sajoin fonctionne partiellement. - Aristide - 31/07/2011

Bonjour alias_angelius,

Non, je n'ai pas de message d'erreur en party-line, mais le soucis c'est que quand j'ajoute un pseudo pour que le bot l'autosaj à un salon précis, le bot ne saj pas le nick vers le salon en question, de plus quand je fais !listsaj pour consulter la liste des nicks ajoutés dans l'autosaj après un rehash, je n'ai rien comme si la liste est vide.
Avec la commande !delsaj nick pour retirer l'autosaj d'un nick, le bot l'a prenne en considération même si je ne précise pas le nick, je sais pas ce qu'il va virer lol.
Code :
.[16:50:28] <~Ryan> !addsaj Ryan #aide
.[16:50:28] <Aristide>  OK. AutoJoin vers {Ryan #aide} ajouté pour Ryan .
.[16:50:34] <~Ryan> Listsaj
.[16:50:42] <~Ryan> !listsaj
.[16:50:42] <Aristide> Liste Des Auto-Join :
.[16:50:42] <Aristide> Ryan (), Ryan #aide (),
.[16:50:42] <Aristide> Fin De La Liste.
.[16:50:59] <~Ryan> !delsaj Ryan
.[16:50:59] <Aristide>  OK. Ryan n'a plus d'AutoJoin.
.[16:51:17] <~Ryan> !listsaj
.[16:51:17] <Aristide> Liste Des Auto-Join :
.[16:51:17] <Aristide> Ryan (), #aide (),
.[16:51:17] <Aristide> Fin De La Liste.



RE: TCL Auto-sajoin fonctionne partiellement. - aliasangelius - 31/07/2011

si tu fait !delsaj Ryan #aide
sa donne ?


RE: TCL Auto-sajoin fonctionne partiellement. - CrazyCat - 31/07/2011

Déjà on voit des erreurs sur les arguments (OK. AutoJoin vers {Ryan #aide} ajouté pour Ryan .)
Je regarde ça tranquillement.


RE: TCL Auto-sajoin fonctionne partiellement. - djkenny - 01/08/2011

salut,

voila le tcl corrigé

utilisation:
!addsaj pseudo #salon
!delsaj pseudo #salon
!listsaj ?#salon?

sajoin.tcl


RE: TCL Auto-sajoin fonctionne partiellement. - Aristide - 01/08/2011

Bonjour tout le monde !

@djkenny: Merci pour le temps que tu as consacré afin de corriger ce TCL, c'est vraiment sympa de ta part, mais juste une chose j'ai mis le TCL corrigé et puis le bot ne réagis à aucune action. Je n'ai aucune erreur en party-line.


RE: TCL Auto-sajoin fonctionne partiellement. - djkenny - 01/08/2011

es tu sûr de l'avoir correctement chargé?


RE: TCL Auto-sajoin fonctionne partiellement. - Aristide - 01/08/2011

Bonjour djkenny Smile

Oui, je l'ai correctement chargé, et je n'ai pas un message d'erreur lors du démarrage. Est ce normale cela ?


RE: TCL Auto-sajoin fonctionne partiellement. - djkenny - 01/08/2011

as tu le bon host?
tcl
	variable vhostkill {
		*@NetAdmin.*****.org
		*@TechAdmin.*****.org
		*@ChanAdmin.*****.org
		*@ChefZone.*****.org
		*@Chanop.*****.org
		*@CoChefZone.*****.org
	}
 
.....
 
if {[lsearch -nocase $vhostkill $host]==-1} return
....





RE: TCL Auto-sajoin fonctionne partiellement. - cestlemien - 01/08/2011

salut Smile

question conne peut etre mais je la pose . le bot a-il les flags adequat ?

Cordialement.


RE: TCL Auto-sajoin fonctionne partiellement. - Aristide - 01/08/2011

Oui djkenny ma vHost est bien activée, NetAdmin.*****.org


RE: TCL Auto-sajoin fonctionne partiellement. - Aristide - 01/08/2011

Bonjour cestlemien

Oui, le bot a bien une O-line (IrcOp)


RE: TCL Auto-sajoin fonctionne partiellement. - Aristide - 01/08/2011

Au moins, il devait répondre au requête !addsaj Nick #salon, mais là il n'est même pas synchro avec mes commandes


RE: TCL Auto-sajoin fonctionne partiellement. - djkenny - 01/08/2011

si tu n'as pas un des hosts configuré dans la variable, le bot ne répondra à rien du tout