Systeme IDLE
Systeme IDLE
Voici un petit code IDLE en TCL afin de voir le temps d'inactivité des user sur votre server a intégré dans votre eggdrop.
bind pub -|- !idle pub_idle
proc pub_idle {nick host hand chan arg} {
global idlewhois idchan
if {![info exists idchan]} {
set idchan $chan
set idlewhois [lindex $arg 0]
bind raw - 317 idle_whois
bind raw - 318 idle_whois
putserv "WHOIS $idlewhois $idlewhois"
}
}
proc idle_whois {from keyword arg} {
global idlewhois idchan
if { ([info exists idlewhois]) && ($keyword == 317) } {
set idle [lindex $arg 2]
set idle [string map {"year" "an" "week" "semaine" "day" "jour" "hour" "heure" "second" "seconde"} [duration $idle]]
putquick "PRIVMSG $idchan : 5IDLE:6 $idlewhois7>>>4 $idle"
} elseif {$keyword == 318} {
catch {
unbind raw - 317 idle_whois
unbind raw - 318 idle_whois
unset idlewhois
unset idchan
}
}
}
bind pub -|- !idle pub_idle
proc pub_idle {nick host hand chan arg} {
global idlewhois idchan
if {![info exists idchan]} {
set idchan $chan
set idlewhois [lindex $arg 0]
bind raw - 317 idle_whois
bind raw - 318 idle_whois
putserv "WHOIS $idlewhois $idlewhois"
}
}
proc idle_whois {from keyword arg} {
global idlewhois idchan
if { ([info exists idlewhois]) && ($keyword == 317) } {
set idle [lindex $arg 2]
set idle [string map {"year" "an" "week" "semaine" "day" "jour" "hour" "heure" "second" "seconde"} [duration $idle]]
putquick "PRIVMSG $idchan : 5IDLE:6 $idlewhois7>>>4 $idle"
} elseif {$keyword == 318} {
catch {
unbind raw - 317 idle_whois
unbind raw - 318 idle_whois
unset idlewhois
unset idchan
}
}
}
Permission de ce forum:
Vous ne pouvez pas répondre aux sujets dans ce forum
|
|