23/08/2009, 13:07
Bon, après des heures de casse tête, et de travail, et surtout quelques poignées de cheveux en moins, j'ai réussi a faire ça:
a savoir "sajoin.db" doit être créer a la racine de l'eggdrop.
donc une fois le tcl chargé, tout fonctionne impeccable.
le seul souci, c'est que si j'ai le malheur de redémarrer l'eggdrop ou de le rehash, il ne prends plus en compte les sajoin, il ne saj plus, il ne les liste plus non plus, enfin, plus rien ne va.
Vous auriez une solution s'il vous plait ? là je sèche totalement.
tcl
#################################################
######### AUTOSAJ TCL PAR BLACKNIGHT ############
#################################################
# Les binds
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.db"
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 3 [lindex $text 0]
set 4 [lindex $text 1]
set sajt [del_sajuse $nick]
set sajuse "[lrange $sajuse 0 end] $3@$4"
set f [open "$sajdb" "a"]
puts $f "$sajuse"
close $f
putquick "PRIVMSG $chan : \002\00303OK.\002\00312 AutoJoin vers $4 ajouté pour $3.\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
}
a savoir "sajoin.db" doit être créer a la racine de l'eggdrop.
donc une fois le tcl chargé, tout fonctionne impeccable.
Mon Salon Irc a écrit :-12:59:29- ‹~BlackNight14› !addsaj BlackNight #salon1,#salon2,#salon3
-12:59:30- ‹~Merlin› OK. AutoJoin vers #salon1,#salon2,#salon3 ajouté pour BlackNight.
-12:59:43- ‹~BlackNight› !listsaj
-12:59:43- ‹~Merlin›Liste Des Auto-Join :
-12:59:43- ‹~Merlin›BlackNight (#salon1,#salon2,#salon3),
-12:59:43- ‹~Merlin› Fin De La Liste.
-13:00:06- ‹~BlackNight› !delsaj BlackNight
-13:00:06- ‹~Merlin› OK. BlackNight n'a plus d'AutoJoin.
-13:00:11- ‹~BlackNight› !listsaj
-13:00:11- ‹~Merlin›Liste Des Auto-Join :
-13:00:11- ‹~Merlin› Fin De La Liste.
apres quelques test il saj comme il faut.
le seul souci, c'est que si j'ai le malheur de redémarrer l'eggdrop ou de le rehash, il ne prends plus en compte les sajoin, il ne saj plus, il ne les liste plus non plus, enfin, plus rien ne va.
Vous auriez une solution s'il vous plait ? là je sèche totalement.