I been wandering around to find a script that suits me.
I need the bot to ban users who use badwords in their actions.
The ban should be in this mask ~q:*!*@* and the bot should automatically remove it in 10 minutes. Also it would be good to use badwords.txt file to always be able to add more words as needed to this protection.
I've got this code and just have no luck achieving the result i need.
# kick after x slaps in y seconds
set slaplimit 1:1
I've found this one, but it bans everyone, even if the user has +f flag on the bot and it does not remove bans from the channel after the ban expires...
How do I change it, not to ban users that have +f flag?
# actban variable is setting ban time in minutes
# use 0 to make perm
set actban 10
bind ctcp - ACTION ban:act
proc ban:act { nick uhost hand dest key text } {
#uncomment next line to exclude chanops
if [isop $nick] return
newban ~q:*!$uhost $::botnick action_ban $::actban
foreach chan [channels] {
if [onchan $nick $chan] { pushmode $chan +b ~q:*!*@[lindex [split $uhost @] 1] }
}
}
Yeah this is a really big badwords engine, you can set load of things. But it does not offer ban removal after set time, bans cannot include ~q:*!*@* and there is no file.txt where I would be able to edit them badwords easily.
g0m3z wrote:Yeah this is a really big badwords engine, you can set load of things. But it does not offer ban removal after set time, bans cannot include ~q:*!*@* and there is no file.txt where I would be able to edit them badwords easily.
Yes it does offer ban removal see this ?
#Set the amount of time in minutes to ban the user for. (in mins)
#(By default if you do not set a value the script will assume it to be 60 minutes)
set swearbantime "30"
As for the easy to edit list, Maybe awyeah can help you with this? It has never been an issue as most of the bad words are covered out of the box. Easy enough to edit though.
I've found this one, but it bans everyone, even if the user has +f flag on the bot and it does not remove bans from the channel after the ban expires...
How do I change it, not to ban users that have +f flag?
# actban variable is setting ban time in minutes
# use 0 to make perm
set actban 10
bind ctcp - ACTION ban:act
proc ban:act { nick uhost hand dest key text } {
#uncomment next line to exclude chanops
if [isop $nick] return
newban ~q:*!$uhost $::botnick action_ban $::actban
foreach chan [channels] {
if [onchan $nick $chan] { pushmode $chan +b ~q:*!*@[lindex [split $uhost @] 1] }
}
}
Sorted the ban time with a .chanser #channel ban-time 10. Works like a charm. Can anyone give me a hand on badwords.txt file, how to implement it into the script?
# actban variable is setting ban time in minutes
# use 0 to make perm
set actban 10
bind ctcp - ACTION ban:act
proc ban:act { nick uhost hand dest key text } {
#uncomment next line to exclude chanops
if {[isop $nick] || [matchattr $hand f|f $dest]} { return 0 }
newban ~q:*!$uhost $::botnick action_ban $::actban
foreach chan [channels] {
if [onchan $nick $chan] { pushmode $chan +b ~q:*!*@[lindex [split $uhost @] 1] }
}
}