Hello !
I tryed but no sucess =D
I just want a simple ban/script like
.noflame $nick
+ban $nick
+kick $nick ( NO FLAME !!! )
(after 1 hour)
-ban $nick
Thanks !
GaRfWeN
Code: Select all
set noflame_access "o|o" ;# access flags for public command
# "global-flag"|"channel-flag"
set noflame_message "NO FLAME !!!" ;# kick/ban message
set noflame_time "100" ;# time to remove ban after this many minets
proc noflame:pub {nick host handle channel text} {
global noflame_message noflame_time
if {([llength $text] == 0)} {
puthelp "NOTICE $nick :Syntax: .noflame <nickname>"
return 0
}
set target [lindex [split $text] 0]
if {(![onchan $target $channel])} {
puthelp "NOTICE $nick :I dont see $target on this channel."
return 0
} else {
if {([string match "*!~*@*" "$target![getchanhost $target $channel]"])} {set banmask [maskhost [regsub "~" "$target![getchanhost $target $channel]" "*"]]} else {set banmask [mashost "$target![getchanhost $target $channel]"]}
if {([botisop $channel]) || ([botishalfop $channel])} {
putserv "KICK $channel $target :$noflame_message"
putserv "MODE $channel +b $banmask"
timer $noflame_time [list pushmode $channel -b $banmask]
return 1
} else {
puthelp "NOTICE $nick :unable to kick/ban $target (i'm not oped)"
return 0
}
}
}
proc noflame:checksettings {} {
global noflame_message noflame_time noflame_access
if {($noflame_access == "")} {
putlog "noflame.tcl: invalid access flags set, should be <globalflag>|<channelflag> (setting it to default o|o)"
set noflame_access o|o
} else {
bind pub $noflame_access .noflame noflame:pub
}
if {($noflame_time < 0) || ($noflame_time == 999)} {
putlog "noflame.tcl: invalid ban time, should be above 0 and below 999. (setting it to default 100)"
set noflame_time 100
}
if {($noflame_message == "") || ([llength $noflame_message] > 200)} {
putlog "noflame.tcl: invalid kick messag. (setting to default \"Please do not flame in this channel\")"
set noflame_message "Please do not flame in this channel"
}
return
}
putlog "loaded noflame.tcl"
return [noflame:checksettings]
Code: Select all
set target [lindex [split $text] 0]
if {(![onchan $target $channel])} {
puthelp "NOTICE $nick :I dont see $target on this channel."
return 0
} else {
if {([string match "*!~*@*" "$target![getchanhost $target $channel]"])} {set banmask [maskhost [regsub "~" "$target![getchanhost $target $channel]" "*"]]} else {set banmask [mashost "$target![getchanhost $target $channel]"]}
if {([botisop $channel]) || ([botishalfop $channel])} {
putserv "KICK $channel $target :$noflame_message"
putserv "MODE $channel +b $banmask"
timer $noflame_time [list pushmode $channel -b $banmask]
return 1
} else {
puthelp "NOTICE $nick :unable to kick/ban $target (i'm not oped)"
return 0
}
}
}
The Bot Not oped on the channel seems to work[05:30:48] <@Me> .noflame Flamer
[05:30:49] * Flamer was kicked by bot (NO FLAME !!!)
[05:30:50] * bot sets mode: +b *!*noident@*.flame.org
And when the nickname isn't on the channel it works fine.[05:31:11] <@ME> .noflame Flamer
[05:31:11] -bot- unable to kick/ban Flamer (i'm not oped)
I got the same thing on Quakenet so i doubt it was a problem the syntax. I'd check out if anything on your bot could be preventing it from kicking and banning or an other script[05:31:04] <@Me> .noflame Flamer
[05:31:05] -bot- I dont see Flamer on this channel.
Code: Select all
bind PUB - .noflame pub:timeban
proc pub:timeban {nickname hostname handle channel arguments} {
if {[llength [set arguments [split $arguments]]] < 1} {
putquick "NOTICE $nickname :Usage: !timeban nickname"
} elseif {![onchan [set nick [lindex $arguments 0]] $channel]} {
putquick "NOTICE $nickname :I don't see $nick on $channel!"
} else {
if {[isop $nickname $channel]} {
putquick "MODE $channel +b $nick"
putquick "KICK $channel $nick :\026 Flame não é permitido, ban 60 minutos. Regras: http://gather.dotsi.pt \026"
timer 60 [list putquick "MODE $channel -b $nick"]
}
}
}