it voice only voiced or regular users without affecting @ops
3 kind of wildcard (left, right, middle) eg.
!voice *bot or *bot* or bot*
!voice * would voice everyone except opérator..
!devoice *wildmatch *wildmatch* wildmatch* directmatch
you can specify unlimited wildcard token all will be voiced if they matche nicks.
- Code: Select all
on $@*:TEXT:/^!((voice|devoice))/:#: {
var %p = $replacex($regml(1),voice,+r,devoice,-v)
if (!$nick($chan,0,$right(%p,1))) { notice $nick No user to $regml(1) on $chan $+ . | return }
if ($2 == *) && (!$3) { var %i = 1 | while ($nick($chan,%i,$right(%p,1))) {
var %n = %n $v1 | inc %i | if ($numtok(%n,32) == $modespl) {
mode $chan $+($left(%p,1),$str(v,$v2)) %n | var %n
}
}
if ($numtok(%n,32)) { mode $chan $+($left(%p,1),$str(v,$v1)) %n }
}
else {
var %x = $2-,%i = 1
while ($gettok(%x,%i,32)) {
if ($regex($v1,/^(\*?[^*]+\*?)$/)) {
if (!$count($regml(1),*)) && ($nick($chan,$regml(1),$right(%p,1))) {
var %n = $addtok(%n,$gettok(%x,%i,32),32)
}
else {
var %w = 1 | while ($nick($chan,%w,$right(%p,1))) {
if ($wildtokcs($v1,$regml(1),1,32)) { var %n = $addtok(%n,$v1,32) } | inc %w
}
}
if ($numtok(%n,32) == $modespl) { mode $chan $+($left(%p,1),$str(v,$v2)) %n | var %n }
}
inc %i
}
if ($numtok(%n,32)) { mode $chan $+($left(%p,1),$str(v,$v1)) %n }
}
}
Have fun...