CLEARFILE

By SyntaxIRC on Feb 11, 2008

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-,)
}

Comments

Sign in to comment.
SyntaxIRC   -  Feb 11, 2008

Updated with $exists to make sure no errors occur

 Respond  
SyntaxIRC   -  Feb 11, 2008

Sorry mountaindew, but I don\'t see the point. What possible use would it be as an identifier?

 Respond  
guest598594   -  Feb 11, 2008

nice idea, mountaindew

i hope you don\'t think i made this script Image

 Respond  
Jonesy44   -  Feb 11, 2008

nice idea, mountaindew

 Respond  
guest598594   -  Feb 11, 2008
  var %x = $$input(What file would you like to clear?,qe,Clear file)
  $clearfile(%x) 

idk

 Respond  
Freckle   -  Feb 11, 2008

I do not see the point of that mountaindew, any examples?

 Respond  
guest598594   -  Feb 11, 2008

you should let it be an $identifier too, so u can do like $clear(file.txt)

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.