Code: Select all
####################################################
# by wiebe @ QuakeNet
#
####################################################
setudef flag flyby
setudef int flyby-trigger
setudef int flyby-bantime
####################################################
# flyby:part
####################################################
bind part -|- * flyby:part
proc flyby:part { n u h c {m ""}} {
if {![validchan $c]} { return 0 }
if {[isbotnick $n]} { return 0 }
if {![botisop $c]} { return 0 }
if {![channel get $c flyby]} { return 0 }
if {[matchattr $h bfvlomn|fvlomn $c]} { return 0 }
if {[isop $n $c]} { return 0 }
if {[ishalfop $n $c]} { return 0 }
if {[isvoice $n $c]} { return 0 }
if {[matchban $n!$u $c]} { return 0 }
set t [channel get $c flyby-trigger]
if {$t < 0} { set t 10; channel set $c flyby-trigger $t }
set d [expr [clock seconds] - [getchanjoin $n $c]]
if {$d > $t} { return 0 }
set l [channel get $c flyby-bantime]; set e "flyby.tcl"
if {$l < 5} { set l 10; channel set $c flyby-bantime 10 }
set m "*!$u"; set r "You joined and left within a very short time."
if {[string match "~*@*" $u] || [string match "*.users.quakenet.org" $u]} {
set m "*!*@[lindex [split $u @] 1]"
}
if {![string equal [info procs newchanban:ban] ""]} { newchanban:ban $c $m $e $r $l]
} else { newchanban $c $m $e $r $l }
}
set scriptdb(flyby) {
"ban users who part shortly after joining, +flyby (enable), flyby-trigger (ban if user parts within X seconds), flyby-bantime (ban for X minutes)"
}