Code:
alias _download {
  var %socket $+(dl,$chr(46),$nopath($1))
  if (!$sock(%socket)) {
    sockopen %socket hirc.org 80
    sockmark %socket HEAD hirc.org $1
    echo -s begin download.
  }
  else echo -s error
}
on *:SOCKOPEN:dl.*:{
  var %file = $nopath($gettok($sock($sockname).mark,3,32)), %fullfile = %file
  var %sckr = sockwrite -n $sockname, %:dl = $gettok($sock($sockname).mark,3,32)
  write -c %fullfile
  %sckr GET $iif(left(%:dl,1) != $chr(47),$chr(47) $+ %:dl,%:dl) HTTP/1.0
  %sckr HOST: $gettok($sock($sockname).mark,2,32)
  %sckr ACCEPT: *.*
  %sckr $crlf
}
on *:SOCKREAD:dl.*:{
  if ($sockerr) halt
  var %a
  :begin
  if ($gettok($sock($sockname).mark,1,32) = head) sockread %a
  else sockread &b
  if ($sockbr) {
    tokenize 32 $sock($sockname).mark
    if ($1 = HEAD) {
      if (%a) if ($gettok(%a,1,32) = Content-Length:) var %totsize = $gettok(%a,2,32)
      else sockmark $sockname GET $2- %totsize
    }
    elseif ($1 = GET) {
      var %file = $nopath($3), %cursize = $file(%file).size
      var %totsize = $gettok($sock($sockname).mark,4,32)
      ;write to mirc
      bwrite %file -1 &b
    }
    goto begin
  }
}
on *:SOCKCLOSE:dl.*:{ echo -s done. }


why won't this download the .icl file into the mirc dir properly?? it works with txt files. frown

/_download /hirc/update/gnome.icl << this doesn't work.

but this works..
/_download /hirc/update/mIRC2k[06-30].zip

any ideas???