Its a simple swear protection. You can edit it by adding more words thats are considered a bad word to you. .. ENJOY!
Its my first script that I uploaded, so bare wit me:D
on *:text:*:#: {
if (($istok($1-,FUCK,32) == $true) || ($istok($1-,BITCH,32) == $true)) {
ban $chan $nick
kick $chan $nick Don't swear here!
}
}
that aint much more useful then what i put :/
also, you used 32 as a delimeter when you should be using 44,
and banning $nick doesnt really help at all, they can just change nicks
try this:
alias swearon set %status on
alias swearoff unset %status
alias addswear set %swears $addtok(%swears,$$1,32)
alias remswear set %swears $remtok(%swears,$$1,1,32)
on @*:text:*:#:{
if (%status && $istok(%swears,$1-,32)) {
ban -k $chan $address($nick,2) Swearing is Prohibited.
}
}
usage:
/swearon (turns it on)
/swearoff (turns it off)
/addswear (adds swear to list)
/remswear (removes swear from list)
Cons:
Here is the updated code (with a \'mini-tutorial\' on what I changed):
on @*:TEXT:*:#:{
; the above line is not much different from your first, the @ checks if you are an op in the channel
var %swear fuck,bitch
; swear words that are checked are in this local variable (can be added or removed)
if ($istok($1-,%swear,32)) {
; checks if any of the words are in the text
ban -k # $nick Swearing is prohibited.
; ban/kick\'s the nick w/ above msg
}
}
Try that w/o the ; comments. They were just used to help you understand. And if you already knew about what I\'m talking about, then just ignore them.
its rather lacking though you did use the token identifiers well. add change \"on :text::#: {\" to \"on @:text::#: {\" to check if you are an op or \" on :text:*:#: { if ($me isop $chan) {\" You might also consider making a way to add any swear words to a list so they can have their own custom list of words that they want to protect against. And to Corne yes ban -k $chan $nick is better but banning just the nick won\'t do you much good in the long run use .ban -k $chan $nick .