hi, can anyone help me plz, i am getting this error when i type .+ban nick
Tcl error [pub_+ban]: can't read "ban": no such variable
i went through codes, but no luck
here are the codes!
proc pub_+ban {nick uhost hand channel rest} {
global botnick CC ban-time
if {[matchattr $hand Q] == 0} {
puthelp "NOTICE $nick :02[AW]02 This command requires you to authenticate yourself. Please /msg $botnick auth <password>"
return 0
}
if {[botisop $channel]==1} {
if {$rest == ""} {
puthelp "NOTICE $nick :02[AW]02 Usage: ${CC}+ban <hostmask> [reason]"
return 0
}
if {$rest!=""} {
set host [lindex $rest 0]
set reason [lrange $rest 1 end]
if {[string tolower $host] == [string tolower $botnick]} {
putserv "KICK $channel $nick :02[AW]02 You really shouldn't try that..."
return 0
}
if {$reason == ""} {
set reason "02requested02"
}
set options [lindex $reason 0]
if {[string index $options 0] == "-"} {
set options [string range $options 1 end]
}
switch -exact $options {
perm {
set reason [lrange $reason 1 end]
newban $host $nick "$reason" 0
if {$reason == ""} {set reason "No reason given"}
putlog "02[AW]02 <<$nick>> !$hand! +ban $reason"
return 0
}
min {
if {[val [lindex $reason 1]] == ""} {
puthelp "NOTICE $nick :02[AW]02 Error, invalid time period"
return 0
}
set time [lindex $reason 1]
set reason [lrange $reason 2 end]
newban $host $nick "$reason" $time
if {$reason == ""} {set reason "No reason given"}
putlog "02[AW]02 <<$nick>> !$hand! +ban $reason"
return 0
}
hours {
if {[val [lindex $reason 1]] == ""} {
puthelp "NOTICE $nick :02[AW]02 Error, invalid time period"
return 0
}
set time [expr [lindex $reason 1]*60]
set reason [lrange $reason 2 end]
newban $host $nick "$reason" $time
if {$reason == ""} {set reason "No reason given"}
putlog "02[AW]02 <<$nick>> !$hand! +ban $reason"
return 0
}
days {
if {[val [lindex $reason 1]] == ""} {
puthelp "NOTICE $nick :02[AW]02 Error, invalid time period"
return 0
}
set time [expr [expr [lindex $reason 1]*60]*24]
set reason [lrange $reason 2 end]
newban $host $nick "$reason" $time
if {$reason == ""} {set reason "No reason given"}
putlog "02[AW]02 <<$nick>> !$hand! +ban $reason"
return 0
}
weeks {
if {[val [lindex $reason 1]] == ""} {
puthelp "NOTICE $nick :02[AW]02 Error, invalid time period"
return 0
}
set time [expr [expr [expr [lindex $reason 1]*60]*24]*7]
set reason [lrange $reason 2 end]
newban $host $nick "$reason" $time
if {$reason == ""} {set reason "No reason given"}
putlog "02[AW]02 <<$nick>> !$hand! +ban $reason"
return 0
}
}
set reason [lrange $reason 1 end]
newban $host $nick "$reason" $ban-time
if {$reason == ""} {set reason "No reason given"}
putlog "02[AW]02 <<$nick>> !$hand! +ban $reason"
return 0
}
}
if {[botisop $channel]!=1} {
puthelp "NOTICE $nick :02[AW]02 I am not oped"
}
}