11/11/2011, 11:31
Bonjour djkenny, CrazyCat,
Merci beaucoup de ton aide
Avec le nouveau code que tu ma fourni j'ai cette erreur
J'ai essayer avec celui de CrazyCat aucun souci pour joindre les salons mais il fonctionne pas :$ et aucune ligne d'erreur
Cordialement Stephane
Merci beaucoup de ton aide
Avec le nouveau code que tu ma fourni j'ai cette erreur
Citation :[10:19] missing close-brace
while executing
"namespace eval ::av {
variable salons "#Fusion #test"
variable time 10
variable lignes 2
bind time - "* * * * *" av::Vvoice
proc Vv..."
(file "scripts/idle.tcl" line 1)
invoked from within
"source scripts/idle.tcl"
(file "Eggdrop.conf" line 116)
djkenny a écrit :tcl
namespace eval ::av { variable salons "#salon1 #salon2 #salon3" variable time 15 variable lignes 5 bind time - "* * * * *" av::Vvoice proc Vvoice {1 2 3 4 5} { variable idle variable salons variable time foreach salon [string tolower $salons] { if ![validchan $salon] continue foreach nick [chanlist $salon] { if {[isbotnick $nick] || [isop $nick $salon]} continue if {[info exists idle($salon)] && [dict exists $idle($salon) $nick]} { set n [dict get $idle($salon) $nick] set t1 [lindex $n 1] set t [expr [unixtime]-$t1] if {$t>[expr $time*60] && [isvoice $nick $salon]} { pushmode $salon -v $nick } if {$t>300} { dict set idle($salon) $nick [list 0 [unixtime]] } } else { dict set idle($salon) $nick [list 0 [unixtime]] } } flushmode $salon } } bind pubm - * av::Pvoice proc Pvoice {nick host hand chan arg} { variable lignes variable salons variable idle set chan [string tolower $chan] if {[lsearch -nocase $salons $chan]==-1 || [isbotnick $nick]} return if {[info exists idle($chan)] && [dict exists $idle($chan) $nick]} { set n [dict get $idle($chan) $nick] set i [lindex $n 0] dict set idle($chan) $nick [list [incr i] [unixtime]] if {$i>=$lignes} {pushmode $chan +v $nick} } else { dict set idle($chan) $nick [list 0 [unixtime]] } } bind join - * av::joinC proc joinC {nick host hand chan} { variable salons set chan [string tolower $chan] if {[lsearch -nocase $salons $chan]==-1 || [isbotnick $nick]} return variable idle dict set idle($chan) $nick [list 0 [unixtime]] } bind nick - * av::chgn proc chgn {nick host hand chan new} { variable salons set chan [string tolower $chan] if {[lsearch -nocase $salons $chan]==-1 || [isbotnick $nick]} return variable idle if {[info exists idle($chan)] && [dict exists $idle($chan) $nick]} { dict set idle($chan) $new [dict get $idle($chan) $nick] dict unset idle($chan) $nick } else { dict set idle($chan) $nick [list 0 [unixtime]] } } }
J'ai essayer avec celui de CrazyCat aucun souci pour joindre les salons mais il fonctionne pas :$ et aucune ligne d'erreur
CrazyCat a écrit :C'est marrant comme vous faites ça, moi j'aurais cherché plus simple:
tcl
namespace eval av { variable salons "#salon1 #salon2 #salon3" variable time 15 variable lignes 5 variable idle bind time - "* * * * *" av::unvoice bind pubm - * av::voice bind nick - * av::chgn proc unvoice {min hour day month year} { foreach chan [string tolower $::av::salons] { if {![validchan $chan]} continue foreach nick [chanlist $chan] { if {[isbotnick $nick] || [isop $nick $chan] || ![isvoice $nick $chan]} continue if {[getchanidle $nick $chan] >= $time} { dict set ::av::idle($chan) $nick 0 pushmode $chan -v $nick } } flushmode $chan } } proc voice {nick uhost handle chan args} { set chan [string tolower $chan] if {[lsearch -nocase $::av::salons $chan]==-1 || [isbotnick $nick] || [isop $nick $chan]} return if {[info exists ::av::idle($chan)] && [dict exists $::av::idle($chan) $nick]} { set i [dict get $::av::idle($chan) $nick] dict set ::av::idle($chan) $nick [incr i] if {$i>=$lignes} {pushmode $chan +v $nick} } else { dict set ::av::idle($chan) $nick 1 } flushmode $chan } proc chgn {nick host hand chan new} { set chan [string tolower $chan] if {[lsearch -nocase $::av::salons $chan]==-1 || [isbotnick $nick]} return if {[info exists ::av::idle($chan)] && [dict exists $::av::idle($chan) $nick]} { dict set ::av::idle($chan) $new [dict get $::av::idle($chan) $nick] dict unset ::av::idle($chan) $nick } else { dict set ::av::idle($chan) $nick 0 } } }
Cordialement Stephane
hésitez pas de visité http://www.tchat-fusion.org/
ou part irc /server -m irc.tchat-fusion.org
ou part irc /server -m irc.tchat-fusion.org