This snippet allows you to detect +a and -a channel mode events perfectly. It will count the number of times you have been protected/deprotected, and also give a "message" to the channel on that event. This follows the same format as the On Voice/Help/Op/Owner events. This snippet can be easily configured to detect other modes. If you don't know how, just contact me on IRC or Email.
On *:RAWMODE:#: {
If ($Istokcs($2-,$Me,32) == $True) && (a isincs $1) {
var %a = 1, %b = 1
While (%a <= $Len($1)) {
; Sets %c for the next character
var %c = $Mid($1,%a,1)
; Checks if the character is + or -
If (%c == +) { var %d = 1 }
Elseif (%c == -) { unset %d }
; Checks if the character displays a word in the 2nd token onwards (eg. +a Relinsquish)
Elseif (%c !isincs cimnprstzACGMKNOQRSTVu) && ((%c !=== l) || ((%c === l) && (%d))) {
; Checks if the character is "a" (case sensitive) and the matching token is your nickname
If (%c === a) && ($Gettok($2-,%b,32) == $Me) {
; Checks if the character is being set
If (%d) {
inc %ProtectCount
msg # Thanks for the Protect $Nick $+ . I have been Protected %ProtectCount times.
}
; Checks if the character is being unset
Else {
inc %DeProtectCount
msg # Where did my Protect go $Nick $+ ? I have been DeProtected %DeProtectCount times.
}
}
inc %b
}
inc %a
}
}
}