TCL Auto-sajoin fonctionne partiellement.
#1
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
}
Répondre Avertir


Messages dans ce sujet
TCL Auto-sajoin fonctionne partiellement. - par Aristide - 31/07/2011, 16:18

Atteindre :


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