Code had a stuttle fault in it.
;$1 = chan
;$2 = filename
;$3 = number per file
;$4 = wildmatch for nick (aka ADMIN-*)
alias voiced.nicks.to.text.files {
var %f = 1, %n = 1, %i = 1
while ($nick($1,%i,v) != $null) {
if ($4 iswm $v1) {
write $iif(%n == 1,-c) $+($2,[,%f,].txt) [ $v2 ]
inc %n
if (%n > $3) {
var %n = 1
inc %f
}
}
inc %i
}
}
* tested, working *
The fault was $v2 was wanted from the IF above, but was lost due to the $iif earlier on the line, i used [ & ] as there ment to be for, to control the order of evaluation, namely evaluate $v2 before the $iif.
--edit--
just saw a second fault
, was using !%n when it should have been %n == 1