mIRC Home    About    Download    Register    News    Help

Print Thread
#132991 16/10/05 10:57 AM
Joined: Feb 2004
Posts: 119
D
da_hype Offline OP
Vogon poet
OP Offline
Vogon poet
D
Joined: Feb 2004
Posts: 119
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???

#132992 17/10/05 01:35 PM
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
Well, I have never tried ICL files and haven't tried to actually download a file from mIRC off a website... but, perhaps it's running into the filetype ignore settings in mIRC?


Invision Support
#Invision on irc.irchighway.net
#132993 17/10/05 02:57 PM
Joined: Sep 2005
Posts: 2,881
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Sep 2005
Posts: 2,881
The mIRC options have no influence on sockets.

da_hype: afaik, any script that can download a zip file should also be able to download an icl file, since they're both binary files.
However, since an icl file is a dll with a renamed extension it wouldn't hurt to see how your script handles dll files.

#132994 17/10/05 03:37 PM
Joined: Feb 2004
Posts: 119
D
da_hype Offline OP
Vogon poet
OP Offline
Vogon poet
D
Joined: Feb 2004
Posts: 119
/_download /hirc/update/beep.dll

dll's work frown

#132995 17/10/05 04:22 PM
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
Ok, as I said, I wasn't sure. smile

Anyhow, if DLL and ZIP work... have you tried a different ICL file in case it is just a problem with that one file? Perhaps the path you're using is invalid? Or, perhaps you have a firewall that blocks certain filetypes from being accessed (like colleges that block .mp3 extensions from being downloaded).


Invision Support
#Invision on irc.irchighway.net
#132996 20/10/05 04:39 PM
Joined: Oct 2005
Posts: 10
C
Pikka bird
Offline
Pikka bird
C
Joined: Oct 2005
Posts: 10
1. create filename.icl.exe(zip,rar, more download type file surname )
2. download file your scriptdir
3. /rename file "filename.icl".exe remove second name for script codes
wink

good luck..


Link Copied to Clipboard