eww, sloppy. A hash table for each download? hmm I got mine working, so maybe you can look at it and see what's going on?

Code:
; ------------------------------------------------------------------------------------------------------
; usage: $download(<link>, option)
; --
; Options:
;   Excluded or run [Default Option]
;     Will download and run program apon completion of download
;   norun
;     Will not run the program after download completion
;   opendir
;     Will open the mirc directory to which i was downloaded to apon completion
;
; Properties:
;   .owrite - When specified, if a file already exists with the same name as that of ebign downloaded,
;             it is overwritten.  When not specified, the user will be faces with a popup asking if they
;             would like to overwrite the file.
; ------------------------------------------------------------------------------------------------------
alias download {
  if (!$isid) || (!$1) {
    /echo -s Invalid Usage: $ $+ download(link, option)[.owrite]
    /echo -s Options:
    /echo -s  $null   - [Default Option] Will download and run program apon completion of download
    /echo -s  norun   - Will not run the program after download completion
    /echo -s  opendir - Will open the mirc directory to which i was downloaded to apon completion
    return
  }
  else {
    var %link = $remove($$1, http://) $+ /
    var %host = $gettok(%link, 1, $asc(/))
    var %get = $iif($left($remove(%link, %host), -1), $ifmatch, /)
    if ($sock(download)) /download.close
    var %download.info $+($rand(1,9999),$chr(44),$iif($prop && $prop == owrite, 1, 0),$chr(44),1,$chr(44),$iif($2, $2, run))
    var %id = $gettok(%download.info, 1, 44)
    /sockopen download $+ %id %host 80
    /sockmark download $+ %id %host %get
    /set %download. [ $+ [ %id ] ] %download.info
    return %id
  }
}

alias download.close {
  if ($sock(download $+ $1)) /sockclose download $+ $1
  /unset %download. $+ $1
  if ($isFile(download $+ $1 $+ .dat)) .remove download $+ $$1 $+ .dat
}

on 1:SOCKOPEN:download*: {
  var %id = $remove($sockname, download)
  if ($sockerr) {
    /echo -a Error: Could not connect to $gettok($sock($sockname).mark, 1, 32)
    .signal download %id $false Could not connect to host " $+ $gettok($sock($sockname).mark, 1, 32) $+ "
    /download.close %id
  }
  else {
    /sockwrite -n $sockname GET $gettok($sock($sockname).mark, 2-, 32) HTTP/1.0
    /sockwrite -n $sockname Host: $gettok($sock($sockname).mark, 1, 32)
    /sockwrite -n $sockname $crlf
  }
}

on 1:SOCKREAD:download*: {
  var %id = $remove($sockname, download)
  var %download.header = $gettok(%download. [ $+ [ %id ] ], 3, 44)
  if (%download.header) {
    /sockread %data
    if (%data == $null) /set %download. $+ %id $puttok(%download.info, 0, 3, 44)
  }
  else {
    /sockread -f &data
    /bwrite download $+ %id $+ .dat -1 -1 &data
  }
}

on 1:SOCKCLOSE:download*: {
  var %id = $remove($sockname, download)
  .timerdownload -m 1 250 /download.done %id $sock($sockname).mark
}

alias download.done {
  var %id = $1, %mark = $2-
  var %file = $gettok($nopath($gettok(%mark, 2-, 32)) $+ ?, 1, $asc(?))
  if (%file == $null) %file = index.htm
  var %owrite = $gettok(%download. [ $+ [ %id ] ], 2, 44)

  if ($isFile(download $+ %id $+ .dat)) {
    if ($isFile(%file)) {
      if (%owrite) || ($$?!="Would you like to overwrite the previous file ( $+ %file $+ )?") .remove %file
    }
    .rename download $+ %id $+ .dat %file
    .signal DOWNLOAD %id $true %file

    var %option = $gettok(%download. [ $+ [ %id ] ], 4, 44)
    else if (%option == opendir) /run .
    else if (%option != norun) /run %file
  }
  else .signal download %id $false Could not find downloaded file "download $+ %id $+ .dat"

  /download.close %id
}

; ------------------------------------------------------------------------------------------------------
; example code
alias dlTest {
  /inc %files
  /echo -a Downloading File... (With opendir option)
  /set %dl.id $download($1-, opendir).owrite
}

on *:SIGNAL:DOWNLOAD: {
  var %id = $1, %sOK = $2
  if (%sOK) var %file = $3-
  else var %error = $3-
  ; ----------------------
  if (%id == %dl.id) {
    if (%sOk) /echo -a File Downloaded ( $+ %file $+ )
    else /echo -a Error Occured! ( $+ %error $+ )
  }
}

; EOF
; ------------------------------------------------------------------------------------------------------


Few additions:

/dlText <path> to run a demonstration download. It is called as an ID, and passed back a numeric value identifying that file. From there, a download.<id>.dat file is created (less the header information). Once the download has completed, the file is saved as its name from the path (Defaults to paths like www.somesite.com/ with no name) On completion, the signal "download" is called with three parameters.

.signal download <id> <sok> <info>
id - the id of the download that was either completed, or performed an error
sOk - states if the download was successful (returns tru on success, and false on fail)
info - depending on an sok value of true or false, this could be either the filename of the downloaded file, or the error message that occured respectivly.

I also added an option prperty to the $download call as the second parameter ($download(path, option)) The option can be any of the following settings:

If the option parameter is excluded or is filled with run, it will execute the just-downloaded program on completition.
If the option is filled with norun, the file will not be executed when the download is complete
If the option opendir is included, the mirc directory to which it was downloaded will open apon completion.

Hope that helps you, and homefully others. the idea is basically you can do somethign like the following:

Code:
alias versionCheck {
  /set %verFile $download(http://mywebsite.com/vers.txt, noopen)
}

on *:SIGNAL:DOWNLOAD: {
  var %id = $1, %sOK = $2, %file = $3-
  if (%id == %verFile) {
    if (%sOK) {
      var %content = $read(%file, 1)
      if (%content = %vers) var %a = $input(No new versions are currently available for download, o)
      else var %a = $input(A new version has become available for download!, o)
    }
    else var %a = $input(An error occured while checking the verion: $crlf %file, o)
  }
}


Assuming vers.txt on ur website contained just one line, and that was the version--this would work


-KingTomato