All pastes #448513 Raw Edit

eggdrop problem

public text v1 · immutable
·published 2007-04-19 18:27 UTC
rendered paste body
proc c_kickban {nick userhost handle chan text} {
        if {([isop $nick $chan]) || ([ishalfop $nick $chan])} {
                if {[[string length [lindex $text 0]] == 0]} {
                        return 1
                } else {
                        set tnick [lindex $text 0]
                }

                if {[[string length [lindex $text 1]] == 0]} {
                        set reason "Banned"
                        set timer 28800
                } else {
                        if {[string is integer [lindex $text 1]]} {
                                set timer [expr [lindex $text 1] * 60]
                                set reason [banreason [lrange $text 2 end]]
                        } elseif {[lindex $text 1] == "forever"} {
                                set timer 0
                                set reason [banreason [lrange $text 2 end]]
                        } else {
                                set reason [banreason [lrange $text 1 end]]
                                set timer 28800
                        }
                }

                set host [i_hostbynick $tnick $chan]
                set mask "*!*@$host"
                putserv "MODE $chan +b $mask"
                putserv "KICK $chan $tnick :$reason"

                if {$timer != 0} {
                        utimer $timer "unban $mask"
                }
        }
}