; Notice here the usage of the '$' dollar sign which then
; permits to make regex matches directly in the event declaration.
; I've also replaced 'fuck|suck' with '[fs]uck'
; Ah, almost forgot it. The /S modifier is to strip the
; text ($1-) received before searching.
On ^$!*:Text:/\b([fs]uck|shit|bitch)\b/iS:?:{
; Here's Bekar's condition. Very useful :)
If ($comchan($nick,0) > 0) {
Var %t = $v1 , %n = $nick
; Now we loop on the number of common channels with $nick
While %t {
Var %ch = $comchan(%n,%t)
; And if we find a common channel where we are opped
If (%n isreg %ch) && ($me isop %ch) {
; then kick/ban
KICK %ch %n swearing on private
Ban %ch %n 2
Break
}
Dec %t
}
}
}