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


recherche d'eggdrop
#53
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
      }
   }
}

irc.zeolia.net - Offrez-moi un café
Merci de ne pas demander d'aide en MP
Away


Messages In This Thread
recherche d'eggdrop - by Darfus - 06/06/2011, 18:15
RE: recherche d'eggdrop - by aliasangelius - 07/06/2011, 16:00
RE: recherche d'eggdrop - by djdu32 - 07/06/2011, 19:58
RE: recherche d'eggdrop - by Darfus - 09/06/2011, 19:24
RE: recherche d'eggdrop - by CrazyCat - 09/06/2011, 22:11
RE: recherche d'eggdrop - by fedora - 09/06/2011, 19:27
RE: recherche d'eggdrop - by Darfus - 10/06/2011, 00:12
RE: recherche d'eggdrop - by Darfus - 10/06/2011, 10:54
RE: recherche d'eggdrop - by CrazyCat - 10/06/2011, 14:16
RE: recherche d'eggdrop - by Darfus - 11/06/2011, 18:07
RE: recherche d'eggdrop - by aliasangelius - 10/06/2011, 14:52
RE: recherche d'eggdrop - by djkenny - 11/06/2011, 18:56
RE: recherche d'eggdrop - by aliasangelius - 11/06/2011, 23:45
RE: recherche d'eggdrop - by Darfus - 12/06/2011, 14:58
RE: recherche d'eggdrop - by lesny - 12/06/2011, 15:06
RE: recherche d'eggdrop - by Ixion - 12/06/2011, 17:29
RE: recherche d'eggdrop - by Darfus - 12/06/2011, 17:18
RE: recherche d'eggdrop - by Darfus - 12/06/2011, 19:02
RE: recherche d'eggdrop - by Ixion - 12/06/2011, 20:45
RE: recherche d'eggdrop - by lesny - 12/06/2011, 20:53
RE: recherche d'eggdrop - by Ixion - 12/06/2011, 21:47
RE: recherche d'eggdrop - by lesny - 12/06/2011, 22:33
RE: recherche d'eggdrop - by Darfus - 12/06/2011, 22:54
RE: recherche d'eggdrop - by Ixion - 13/06/2011, 00:38
RE: recherche d'eggdrop - by aliasangelius - 13/06/2011, 11:19
RE: recherche d'eggdrop - by aliasangelius - 13/06/2011, 11:26
RE: recherche d'eggdrop - by pheeric - 11/10/2011, 14:54
RE: recherche d'eggdrop - by aliasangelius - 11/10/2011, 15:14
RE: recherche d'eggdrop - by snip74 - 10/11/2011, 15:42
RE: recherche d'eggdrop - by CrazyCat - 10/11/2011, 15:48
RE: recherche d'eggdrop - by snip74 - 10/11/2011, 16:14
RE: recherche d'eggdrop - by CrazyCat - 10/11/2011, 16:25
RE: recherche d'eggdrop - by snip74 - 10/11/2011, 16:46
RE: recherche d'eggdrop - by aliasangelius - 10/11/2011, 16:43
RE: recherche d'eggdrop - by snip74 - 10/11/2011, 17:18
RE: recherche d'eggdrop - by aliasangelius - 10/11/2011, 17:41
RE: recherche d'eggdrop - by snip74 - 10/11/2011, 18:31
RE: recherche d'eggdrop - by aliasangelius - 10/11/2011, 19:40
RE: recherche d'eggdrop - by djkenny - 10/11/2011, 21:12
RE: recherche d'eggdrop - by aliasangelius - 10/11/2011, 21:43
RE: recherche d'eggdrop - by snip74 - 10/11/2011, 21:51
RE: recherche d'eggdrop - by djkenny - 11/11/2011, 00:28
RE: recherche d'eggdrop - by djkenny - 11/11/2011, 11:18
RE: recherche d'eggdrop - by DnS - 10/11/2011, 21:57
RE: recherche d'eggdrop - by snip74 - 10/11/2011, 22:27
RE: recherche d'eggdrop - by djkenny - 11/11/2011, 00:31
RE: recherche d'eggdrop - by snip74 - 11/11/2011, 00:44
RE: recherche d'eggdrop - by snip74 - 11/11/2011, 01:26
RE: recherche d'eggdrop - by DnS - 11/11/2011, 07:24
RE: recherche d'eggdrop - by djkenny - 11/11/2011, 09:08
RE: recherche d'eggdrop - by djkenny - 11/11/2011, 10:04
RE: recherche d'eggdrop - by aliasangelius - 11/11/2011, 10:08
RE: recherche d'eggdrop - by djkenny - 11/11/2011, 10:45
RE: recherche d'eggdrop - by CrazyCat - 11/11/2011, 11:12
RE: recherche d'eggdrop - by snip74 - 11/11/2011, 11:31
RE: recherche d'eggdrop - by CrazyCat - 11/11/2011, 11:31
RE: recherche d'eggdrop - by djkenny - 11/11/2011, 11:36
RE: recherche d'eggdrop - by snip74 - 11/11/2011, 11:51
RE: recherche d'eggdrop - by djkenny - 11/11/2011, 12:01
RE: recherche d'eggdrop - by snip74 - 11/11/2011, 12:34
RE: recherche d'eggdrop - by djkenny - 11/11/2011, 14:51
RE: recherche d'eggdrop - by snip74 - 11/11/2011, 19:08
RE: recherche d'eggdrop - by djkenny - 11/11/2011, 20:07
RE: recherche d'eggdrop - by snip74 - 11/11/2011, 20:32
RE: recherche d'eggdrop - by djkenny - 11/11/2011, 21:00
RE: recherche d'eggdrop - by snip74 - 11/11/2011, 21:35

Possibly Related Threads…
Thread Author Replies Views Last Post
  Recherche uno pour eggdrop MRVOLKANO 2 4,436 03/12/2010, 23:45
Last Post: Mrvolks

Forum Jump:


Users browsing this thread: 1 Guest(s)