* i didnt try to understand what your doing in your code, but i spotted this line if (%AG_lineNo < line(%AG_pathFile)) { i would expect line() is ment to be $line()

* I suggest you group all your script into ONE remote file, you can make your aliases wotrk fromt he remote file by adding the "alias" directive to the front of each alias
ex /doCheckFile { becomes alias /doCheckFile { and moves to the remotes file.

Quote:
I want to add a feature to auto-resume when file already exists without manually configuring it in the DCC options.

That wont be easy, i suggest instead you set the auto resume feature to ON, but then intercept and either delete the old existing file, or redirect the download to a new folder, or rename the old file.

The code you hook in on to get control before the download starts is CTCP ^*:DCC SEND *:{ }

here is a skeleton for working with...
Code:
CTCP ^*:DCC SEND *:{
  ; # correct $1- to deal with files with spaces in #
  tokenize 62 $1 $+ &gt; $+ $2 $+ &gt; $+ $nopath($filename) $+ &gt; $+ $gettok($1-,-3,32) $+ &gt; $+ $gettok($1-,-2,32) $+ &gt; $+ $gettok($1-,-1,32)
 
  ; # $1- = Dcc Send Filename LongIP Port Filesize
  ; $3 contains the filename even if there are spaces in it, $filename conatins the file path/name
 
  ; you can do anything here , check if the file exists, delete/move/rename it etc, before the mirc defualt action of resume if exists takes over.
  ; aka if u renamed the existing one, then a new one well be downloaded.
  ; or redirect the download to a new folder using /dcc get &lt;folder&gt;
}