This script returns the total number of lines of the .mrc files within your mIRC directory. It can be used as /script_lines or $script_lines. For example: I have a total of $script_lines lines of code within my mIRC script.
alias script_lines {
set %lins 0 | unset %lines
while (%lins < $findfile($mircdir,*.mrc,0)) {
inc %lins
%lines = $calc($lines($findfile($mircdir,*.mrc,%lins)) + %lines)
}
set -u1 %lines %lines
unset %lins
return %lines
}
You can use a $findfile loop for iterations involving operations on each file returned by $findfile, so as an example: //var %x | .echo -q $findfile($mircdir,*.mrc,0,inc -s %x $file($1-)) | echo -a %x - also note that /var creates a local variable, one that terminates at the end of the running process, to avoid setting/unsetting global variables