| View previous topic :: View next topic |
| Author |
Message |
AskMe Voice
Joined: 11 Apr 2007 Posts: 23 Location: Canada
|
Posted: Tue Apr 24, 2007 6:30 am Post subject: a little ban problem |
|
|
i have take a existing script and modify it a little bit...
maybe the structure is not very good but it work exept for 1 thing
| Code: | 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"
}
}
|
if i make !spam nick in the channel it ban like a want.. ex: *!*@host
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: |
if {[matchattr $target fmo|fmo $chan]} {return 0}
|
so probably this is going to garbage
| Code: |
if {[matchattr $nick n|-] == "1"}
if {[matchattr $target n|-] == "0"}
if {[matchattr $nick -|o $chan] == 1}
} elseif {[matchattr $target n|-] == 1}
|
i juste whant to keep de kick/ban procedure in proc uw:ban and protect the fmo flag from beeing ban...
and if you have some idea how to improve or simplify the script all the commentary are welcome
thanks[/code] |
|
| Back to top |
|
 |
rosc2112 Revered One

Joined: 19 Feb 2006 Posts: 1454 Location: Northeast Pennsylvania
|
Posted: Tue Apr 24, 2007 5:41 pm Post subject: |
|
|
Simplest thing would be to add a new test:
if {![onchan $target $chan]} {putcmdlog "'target' isn't on '$chan'";return 0} |
|
| Back to top |
|
 |
|