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
#39

tcl
namespace eval ::av {
	variable salon #tonsalon
	variable time 15
	variable lignes 5
 
 
	bind time - "* * * * *" av::Vvoice
	proc Vvoice {1 2 3 4 5} {
		variable idle
		variable salon
		variable time
		foreach nick [chanlist $salon] {
			if {[isbotnick $nick] || [isop $nick $salon]} continue
			if [info exists idle($nick)] {
				set t1 [lindex $idle($nick) 1]
				set t [unixtime]
				if {[expr $t-$t1]>[expr $time*60] && [isvoice $nick $salon]} {
					pushmode $salon -v $nick
				}
				if {[expr $t-$t1]>300} {
					set idle($nick) "0 $t1"
				}
			} else {
				set idle($nick) "0 [unixtime]"
			}
		}
		flushmode $salon
	}
 
	bind pubm - * av::Pvoice
 
	proc Pvoice {nick host hand chan arg} {
		variable lignes
		variable salon
		if {![string equal -nocase $chan $salon] || [isbotnick $nick]} return
		variable idle
		if ![info exists idle($nick)] {set idle($nick) "1 [unixtime]";return}
		set i [lindex $idle($nick) 0]
		set idle($nick) "[incr i] [unixtime]"
		if {$i>=$lignes} {pushmode $chan +v $nick}
	}
 
	bind join - * av::joinC
 
	proc joinC {nick host hand chan} {
		variable salon
		if {![string equal -nocase $chan $salon] || [isbotnick $nick]} return
		variable idle
		set idle($nick) "0 [unixtime]"
	}
 
	bind nick - * av::chgn
 
	proc chgn {nick host hand chan new} {
		variable salon
		if {![string equal -nocase $chan $salon] || [isbotnick $nick]} return
		variable idle
		if ![info exists idle($nick)] {
			set idle($new) "0 [unixtime]"
		} else {
			set idle($new) $idle($nick)
			unset idle($nick)
		}
	}
 
}

C'est en reconnaissant ses erreurs que l'on progresse ;)
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)