maybe the structure is not very good but it work exept for 1 thing
Code: Select all
bind pub f !spam uw:spamkb
proc uw:spamkb {nick host hand chan text} {
global botnick
set rsn SPAM
uw:ban $nick $host $hand $chan $text
}
proc uw:ban {nick host hand chan text} {
global botnick uw:spamkb rsn uw:viruskb
set target [lindex $text 0]
set reason [lindex $rsn 0 end]
set bhost [getchanhost $target $chan]
set banmask "*!*@[lindex [split $bhost @] 1]"
if {[matchattr $target fmo|fmo $chan]} {return 0}
if {[matchattr $nick n|-] == "1"} {
putserv "MODE $chan +b $banmask"
putserv "KICK $chan $target :$reason"
} elseif {$target != $botnick} {
if {[matchattr $target n|-] == "0"} {
if {[matchattr $target fmo|fmo $chan]} {return 0}
if {[matchattr $nick -|o $chan] == 1} {
putserv "MODE $chan +b $banmask"
putserv "KICK $chan $target :$reason"
} elseif {[matchattr $target -|o $chan] == 0} {
putserv "MODE $chan +b $banmask"
putserv "KICK $chan $target :$reason"
} else {
putserv "NOTICE $nick : You don`t have permission to kick the Op $target"
}
} elseif {[matchattr $target n|-] == 1} {
putserv "NOTICE $nick : You don`t have permission to kick the Op $target"
}
} else {
putquick "NOTICE $nick : [censored] you"
}
}
but if a make the command with a nick who isnt in the chan anynore the bot place a ban *!*@ and thats the part i dont want...
i know its a little thing but i cant find how to resolve it.... its probably a if command but i cant find the variable (im a neeb in tcl]

i want to keep those flag
Code: Select all
if {[matchattr $target fmo|fmo $chan]} {return 0}
Code: Select all
if {[matchattr $nick n|-] == "1"}
if {[matchattr $target n|-] == "0"}
if {[matchattr $nick -|o $chan] == 1}
} elseif {[matchattr $target n|-] == 1}
and if you have some idea how to improve or simplify the script all the commentary are welcome
thanks[/code]