on *:TEXT:*:%<protect.text:if ($_protect(text)) return | _txprot $1-
on *:ACTION:*:%<protect.text:if ($_protect(text)) return | _txprot $1-
alias -l _txprot {
if ($_getcflag($chan,24)) _wordkick 1 , $1- ,
if ($_getcflag($chan,25)) _wordkick 2 , $1- ,
}
alias -l _wordkick {
var %words = $hget(pnp.config,$+(wordk,$1,.,$chan))
if (%words == $null) %words = $hget(pnp.config,$+(wordk,$1,.*))
if (%words) {
var %match,%stripped,%num = $numtok(%words,44)
%stripped = , $replace($strip($3-),!,.,$chr(44),.,-,.,$chr(40),.,$chr(41),.,?,.,",.,.,$chr(32)) ,
while (%num) {
%match = * $gettok(%words,%num,44) *
if (%match iswm %stripped) { some command here }
if (%match iswm $2-) { some command here }
dec %num
}
}
}