on @*:TEXT:*shit*:#: {
IF (($nick !isop $chan) && ($nick !isvo $chan)) {
ban $chan $nick 3
kick $chan $nick Do Not Say That Word
notice $nick Please refrain from swearing in $chan again.
msg $chan $nick has been warned about swearing in $chan again.
}
}
This only works if a non-op says it. I want it to work ONLY if a op says it. How can i do that? (Okay, i'm changing the script, i'm not going to ban myself)
on @*:TEXT:*shit*:#: {
if ($nick isop $chan) {
ban $chan $nick 3 kick $chan $nick Do Not Say That Word
notice $nick Please refrain from swearing in $chan again.
msg $chan $nick has been warned about swearing in $chan again.
}
}
Matching *shit* is the worst possible way of detecting a swearword.
on @*:TEXT:*shit*:#: {
if ($nick isop $chan) {
ban $chan $nick 3
kick $chan $nick Do Not Say That Word
notice $nick Please refrain from swearing in $chan again.
msg $chan $nick has been warned about swearing in $chan again.
}
}
Of course, he could just use the -k option to kick with the ban line. And using the -u option to automatically unban the user after a period of time is a good idea as well.
The @ symbol in that line means that the code will only be processed if the client running the code has ops in the channel.
Riamus posted the full code that you're looking for. There is no need to change that line, but a second check to see if the nick that used the word is an op (or not) is required (again, per Riamus' code).
Sorry if i explained bad, but i'm just learning mirc scripting, and i wanted to do something like a very simple bot. And i wonders if i can use this code to make me (the op) send a word (!bot) and it do something.