Code: Select all
bind evnt -|- sighup quit
bind evnt -|- sigterm quit
bind evnt -|- sigill quit
bind evnt -|- rehash quit
bind evnt -|- prerehash quit
bind evnt -|- prerehash quit
bind evnt -|- prerestart quit
proc quit { type } {
putlog "got event, $type"
}
Code: Select all
if {![info exists arewealive]} {
catch {unbind dcc n die *dcc:die}
bind dcc n die our:dcc:die
rename die our:die
proc die {rsn} {
our:dcc:die $::botnick 0 $rsn
}
}
set arewealive 1
proc our:dcc:die {hand idx arg} {
set a 0
set b 0
foreach x [binds evnt] {
if {![string equal -nocase [lindex $x 2] predie]} { continue }
incr a
incr [numberize [[lindex $x 4] $hand $arg]]
}
if {$a == $b} { die "($hand) $arg" }
}
proc numberize {n} {
if {$n == ""} { return 0}
if {$n == "0"} { return 0 }
return 1
}
Code: Select all
bind EVNT - predie my:event:proc
Code: Select all
proc my:die:function {hand rsn} {
if {![matchattr $hand Z]} { return 0 }
if {([uptime] - $uptime) < 600} { return }
return 1
}
bind EVNT - predie my:die:function