This script is very useful in certain scripts, so as you can guess this is mainly for mIRC scripters. It is simple yet effective, and what it does is clear a or multiple files, which would save you time or lines using write -c or running, then copying and deleting from the file.
Usage: /clearfile FILES (separated by a space)
alias clearfile {
if (!$1) { echo -a An error occured | halt }
if (!$exists($1)) { echo -a The file could not be found | halt }
if ($count($1-,$chr(32)) > 1) {
%d = $v1
%o = 1
while (%o <= %d) {
write -c $mid($1-,$pos($1-,$chr(32),%o))
}
}
if (!%o) {
write -c $1
}
echo -a Cleared file(s) $+(,$1-,)
}