The Script is nearly working but if i enter a time the timer always makes an error or it simply doesn`t kick the user. Could please anyone check what`s the error in this source?
Code: Select all
bind pub o|o !lamer pub:lamer
proc pub:lamer { nick uhost handle channel arg } {
global botnick
if {([llength $arg]==0) || ([lsearch [string tolower [chanlist $channel]] [string tolower [lindex $arg 0]]]==-1) || (![string is digit [lindex $arg 1]])} {
putserv "PRIVMSG $channel :Usage: !lamer <nick> [time]"
} elseif {![botisop $channel]} {
putserv "PRIVMSG $channel :$nick: Ja, du Scherzkeks, dann gib mir OP!"
} elseif {$botnick==$arg} {
putserv "PRIVMSG $channel :$nick: So blöd bin ich nun wirklich nicht..."
} else {
if {[string is digit [lindex $arg 1]]} {
set bantime [lindex $arg 1]
} else {
set bantime 10
}
set host [getchanhost $arg $channel]
putserv "MODE $channel +b $arg!$host"
utimer 2 "putkick $channel $arg lamer"
timer $bantime "putserv \"MODE $channel -b $arg!$host\""
}
}