; Mass Commands Script
; v2.14
; Copyright 2004 Helio
; type /mcom command $target(#channel)
; Common Command Aliases
; /mkick #channel = kicks all selected users from the channel
; /mmode #channel +o = sets mode to all selected users in the channel
; /mmodeb #channel +b = sets mode to all selected users in the channel, but fills it in with masks (for +b, +e)
; /mctcp #channel ping = sends a ctcp to all selected users in the channel
alias mkick mcom kick $$1 $target($$1) $2-
alias mmode mcom mode $$1 $$2 $target($$1)
alias mmodeb mcom mode $$1 $$2 $target($$1) $$3
alias mctcp mcom ctcp $target($$1) $$2-
alias -l maskmode {
if ($4 == $null) /mode $$1 $$2 $reptok($address($3,9),$3,*,1,33)
else /mode $$1 $$2 $4 $+ : $+ $reptok($address($3,9),$3,*,1,33)
}
alias -l kban {
maskmode $$1 +b $$2
kick $$1 $$2 $$3-
}
; Target Insertion Alias
; every form of mcom must
; have this identifier,
; somewhere
alias target {
return @- $+ $1-
}
; Main mcom alias
; hard to code,
; even harder to understand
; :/
alias mcom {
if ($matchtok($1-,@-,0,32) != 0) {
set %string $1-
goto bypass
}
if ($matchtok($1-,$,0,32) = 0) {
echo -a Missing "$ $+ target()" insert
halt
}
if ($matchtok($1-,$,0,32) > 0) {
set %string $eval($1-,2)
if ($matchtok(%string,@-,0,32) == 0) {
echo -a Missing "$ $+ target()" insert
halt
}
}
:bypass
set %window $deltok($matchtok(%string,@-,1,32),1,45)
set %position $findtok(%string,$matchtok(%string,@-,1,32),1,32)
set %counter 1
while (%counter <= $snick(%window,0)) {
set %test $reptok(%string,$matchtok(%string,@-,1,32),$snick(%window,%counter),1,32)
%test
inc %counter
}
goto endpoint
:error
if ($3 == $evalnext) {
echo -a insufficient parameters
/reseterror
goto endpoint
}
:endpoint
unset %string
unset %test
unset %position
unset %counter
unset %window
halt
}