Visualizzazione dei risultati da 1 a 2 su 2
  1. #1
    Utente di HTML.it L'avatar di Lino80
    Registrato dal
    Oct 2005
    Messaggi
    1,560

    editare script downloader (help!!)

    da questo script vorrei che al posto di scaricare il file da web a directory, il file me lo mandasse al mio NICK dove si deve modificare?Ho messo $nick al posto di $dir e ora me lo scarica direttamente nella directory download del mirc..mi sa che bisogna cambiare altro...:

    ;***********************************
    ;mIRC File Downloader v1.0
    ;Scripted by Phoenix_the_II
    ;Phoenix_the_II@sjacob.dk
    ;Do not modify/recreate/distribute unless giving permission by me
    ;Usage: /download <URL> <Destanation Directory>
    ;***********************************
    dialog download {
    title "mIRC File Downloader v1.0 by Phoenix_the_II"
    size -1 -1 170 73
    option dbu
    text "", 1, 5 3 106 8
    text "", 2, 62 33 76 8
    text "Speed:", 3, 5 33 54 8
    text "", 4, 113 3 25 8
    button "Open Dir", 5, 139 13 30 10
    button "Open File", 6, 139 26 30 10
    button "Cancel", 7, 139 39 30 10, cancel
    text "", 8, 62 23 76 8
    text "Estimated Time Left:", 9, 5 23 54 8
    text "Filesize:", 10, 5 13 54 8
    text "", 11, 62 13 76 8
    text "Status:", 12, 5 43 25 8
    text "", 13, 62 43 76 8
    text "URL:", 14, 5 53 12 8
    text "", 15, 40 53 140 8
    text "Destination:", 16, 5 63 36 8
    text "", 17, 40 63 116 8, nowrap
    }
    on *:dialog:download:init:0: {
    did -ra download 15 $iif($len(%fullhost) > 45,$left(%fullhost,45) $+ ...,%fullhost)
    did -ra download 17 $iif($len(%path $+ %nopath) > 45,$left(%path $+ %nopath,45) $+ ...,%path $+ %nopath)
    did -ra download 13 Initializing...
    did -ra download 2 0kB/sec
    did -ra download 8 0secs
    did -ra download 11 0byte/0byte
    did -ra download 4 0%
    did -ra download 1 [::::::::::::::::::::::::::::::::::::::::::::::::::]
    did -b download 6
    }
    on *:dialog:download:sclick:5: {
    run %path
    }
    on *:dialog:download:sclick:6: {
    if ($exists(%path $+ %nopath)) {
    run $+(",%path,%nopath,") | url $+(",file://,%path,%nopath,")
    }
    }
    on *:sockopen:download: {
    if ($sockerr < 0) { error Download Failed,wo,Error }
    set %download 0
    set %ticks $ticks
    sockwrite -n $sockname GET $+($iif(%dir != $null,/ $+ %dir),/,%nopath2) HTTP/1.1
    sockwrite -n $sockname Accept-Language: en-us
    sockwrite -n $sockname Connection: keep-alive
    sockwrite -n $sockname User-Agent: Mozilla/??
    sockwrite -n $sockname Host: %host
    sockwrite $sockname $crlf
    }
    alias update {
    set %1 $calc($file(%path $+ %nopath).size - %fsize)
    set %2 $calc($ticks - %dticks)
    if (%2 == 0) { set %2 1000 }
    set %3 $calc((%1 / %2) * 1000)
    set %4 $calc((%size - $file(%path $+ %nopath).size) / %3)
    set %dticks $ticks
    set %fsize $file(%path $+ %nopath).size
    $iif($dialog(download),did -ra download 8 $duration($round(%4,0)))
    $iif($dialog(download),did -ra download 2 $iif(%3 != 0,$iif(%3 >= 1000,$iif(%3 >= 1000000,$round($calc(%3 /1024 /1024),1) $+ MB/sec,$round($calc(%3 /1024),1) $+ kB/sec),$round(%3,1) $+ B/sec)))
    }

    on *:sockread:download: {
    if (!$dialog(download)) { .timerstat off | .timerdownload off | sockclose $sockname | Error Download closed file not saved,wo,Error | $iif($exists(%path $+ %nopath),remove %path $+ %nopath) | halt }
    if (%download == 0) {
    sockread %data
    if (404 not found isin %data) { sockclose $sockname | error 404 file not found,wo,Error | dialog -c download download | halt }
    if (content-length isin %data) {
    set %size $remove($gettok(%data,2,58),$chr(32))
    $iif(!$dialog(download),did -ra download 11 $iif($file(%nopath).size >= 1000,$iif($file(%nopath).size >= 1000000,$round($calc($file(%nopath).size /1024 /1024),3) $+ MB,$round($calc($file(%nopath).size /1024),3) $+ kB),$file(%nopath).size $+ bytes) $+ / $+ $iif(%size >= 1000,$iif(%size >= 1000000,$round($calc(%size /1024 /1024),3) $+ MB,$round($calc(%size /1024),3) $+ kB),%size $+ bytes))
    if ($disk(%left(%path,1)).free < %size) {
    error Not enough free space available on $left(%path,1) $+ : $crlf $+ Space needed $iif(%size >= 1000,$iif(%size >= 1000000,$round($calc(%size /1024 /1024),3) $+ MB,$round($calc(%size /1024),3) $+ kB),%size $+ bytes) $+ $crlf $+ Space to clear up: $iif($calc(%size - $disk($left(%path,1)).free) >= 1000,$iif($calc(%size - $disk($left(%path,1)).free) >= 1000000,$round($calc($calc(%size - $disk($left(%path,1)).free) /1024 /1024),3) $+ MB,$round($calc($calc(%size - $disk($left(%path,1)).free) /1024),3) $+ kB),$calc(%size - $disk($left(%path,1)).free) $+ bytes)) ,wo,Error
    writeini -n downloader.ini %nopath status Not enough harddisk space
    writeini -n downloader.ini %nopath date $fulldate
    writeini -n downloader.ini %nopath size %size
    dialog -c download download
    sockclose $sockname
    halt
    }
    }
    if ($len(%data) < 4) {
    inc %download
    .timerstat 0 1 update
    }
    }
    elseif (%download == 1) {
    sockread 8192 &bin
    bwrite " $+ %path $+ %nopath $+ " -1 &bin
    $iif($dialog(download),did -ra download 13 Downloading...)
    .timerdownload 1 10 $iif($dialog(download),did -ra download 13 Stalled...)
    set %percent $round($calc($file(%path $+ %nopath).size / %size * 100),0)
    set %i 1
    set %bar $eval([,0)
    while (%i <= 50) {
    if ($calc(%percent / 2) < %i) {
    set %bar %bar $+ :
    }
    elseif ($calc(%percent / 2) >= %i) {
    set %bar %bar $+ |
    }
    if (%i == 50) {
    set %bar %bar $+ $eval(],0)
    }
    inc %i
    }
    $iif($dialog(download),did -ra download 1 %bar)
    $iif($dialog(download),did -ra download 4 %percent $+ $chr(37))
    if (%size == $null) { set %size $file(%path $+ %nopath).size | $iif($dialog(download),did -e download 6) }
    if ($file(%path $+ %nopath).size >= %size) { .timerstat off
    $iif($dialog(download),did -ra download 4 100%)
    set %size $file(%path $+ %nopath).size
    .timerdownload off
    $iif($dialog(download),did -e download 6)
    $iif($dialog(download),did -ra download 7 Exit)
    $iif($dialog(download),did -ra download 13 Download Completed)
    $iif($dialog(download),did -ra download 8 0secs)
    $iif($dialog(download),did -ra download 3 Avarage Speed
    $iif($dialog(download),did -ra download 2 $round($calc(%size / (($ticks / 1000) - (%ticks / 1000)) / 1024),1) $+ kB/sec)
    .timerdownload1 1 1 error Download completed: File saved in %path ,io,^_^
    writeini -n downloader.ini %nopath status Download Completed
    writeini -n downloader.ini %nopath date $fulldate
    writeini -n downloader.ini %nopath speed $round($calc(%size / (($ticks / 1000) - (%ticks / 1000)) / 1024),1) $+ kB/sec)
    }
    $iif($dialog(download),did -ra download 11 $iif($file(%path $+ %nopath).size >= 1000,$iif($file(%path $+ %nopath).size >= 1000000,$round($calc($file(%path $+ %nopath).size /1024 /1024),3) $+ MB,$round($calc($file(%path $+ %nopath).size /1024),3) $+ kB),$file(%path $+ %nopath).size $+ bytes) $+ / $+ $iif(%size >= 1000,$iif(%size >= 1000000,$round($calc(%size /1024 /1024),3) $+ MB,$round($calc(%size /1024),3) $+ kB),%size $+ bytes))
    }
    }
    on *:dialog:download:close:0: {
    sockclose download
    if ($did(13).text != Download Completed) {
    writeini -n downloader.ini %nopath status Download closed by user
    writeini -n downloader.ini %nopath date $fulldate
    Error Download closed file not saved,wo,Error
    $iif($exists(%path $+ %nopath),remove %path $+ %nopath)
    .timerstat off
    .timerdownload off
    halt
    }
    }
    alias error {
    if (!$isid) { tokenize 44 $1- }
    set %input $input($1,$2,$3)
    }
    alias download {
    unset %path
    if ($1) {
    if (ftp:// isin $1) { error You can't download files from ftp servers yet!,wo,Error| halt }
    if (http:// !isin $1) { Error Please give a full path to download including http://,wo,Error | halt }
    if ($2) {
    if ($right($2-,1) != \) { Error Please give a full destination path including the "\",wo,Error | halt }
    else {
    set %path $2-
    if ($disk($left(%path,1)).type == cdrom) { Error You cant save your file directly on a CD-ROM drive!,wo,Error | halt }
    elseif ($disk($left(%path,1)).type != fixed) { Error Drive does not exists,wo,Error | halt }
    }
    }
    elseif (!$2) {
    set %path $mircdir $+ download\
    }
    set %fullhost $1
    set %nopath $mkfn($nopath($1))
    set %nopath2 $nopath($1)
    if (%nopath == $null) { Error No file specified,wo,Error | halt }
    set %host $gettok($nofile($1),2,47)
    if (%host == $null) { set %host / }
    set %dir $gettok($nofile($1),$+(3-,$numtok($1,47)),47)
    sockclose download
    set %port
    set %i 1
    while (%i <= 5) {
    if ($mid($gettok(%fullhost,3,58),%i,1) isnum) {
    set %port %port $+ $mid($gettok(%fullhost,3,58),%i,1)
    }
    inc %i
    }
    if (!$exists(%path)) {
    error %path Doesn't exists!! Want to create it?,qnv,Question
    if (%input == $yes) {
    mkdir %path
    }
    elseif (%input == $no) {
    :dir
    var %mkdir $sdir(c:\,Please select directory to save to)
    if ($disk($left(%mkdir,1)).type == cdrom) { error You cant save your file directly on a CD-ROM drive!,wo,Error | goto dir }
    if (%mkdir != $null) {
    if ($disk($left(%mkdir,1)).type == $null) { error Drive does not exsist!,wo,Error | goto dir }
    }
    else { sockclose download | error No download directory given,wo,Aborted | $iif($dialog(download),dialog -c download download) | halt }
    if (%mkdir != $null) {
    mkdir %mkdir
    set %path %mkdir
    }
    else { sockclose download | error No download directory given,wo,Aborted | $iif($dialog(download),dialog -c download download) | halt }
    }
    }
    :file
    if ($exists(%path $+ %nopath)) {
    error %path $+ %nopath already exists! Remove and begin writing new file?,qy,Question
    if (%input == $true) {
    remove %path $+ %nopath
    }
    else { sockclose download | error File already exists,wo,Aborted | $iif($dialog(download),dialog -c download download) | halt }
    }
    unset %size
    sockopen download $iif(%port != $null,$remove(%host,: $+ %port),%host) $iif(%port != $Null,%port,80)
    writeini -n downloader.ini %nopath URL %fullhost
    writeini -n downloader.ini %nopath begin $fulldate
    writeini -n downloader.ini %nopath path %path $+ %nopath
    dialog -m download download
    }
    else { echo -a Usage: /download <URL> <Destanation dir> Example: /download http://www.mirc-help.de/mirc/mirc603.exe c:\ }
    }
    ;--------------------------
    ;Download History
    ;Usage /history
    ;its that easy!
    ;--------------------------
    dialog history {
    title "Please select download history file"
    size -1 -1 120 30
    option dbu
    combo 1, 5 5 100 80, sort,drop
    button "&Select" 2, 5 18 30 10, flat
    button "&Close" 3, 43 18 30 10, flat,ok
    }
    on *:dialog:history:init:0: {
    did -t history 2
    var %tini $ini(downloader.ini,0)
    var %i 1
    while (%i <= %tini) {
    did -a history 1 $ini(downloader.ini,%i)
    inc %i
    }
    }

  2. #2
    Utente di HTML.it L'avatar di Lino80
    Registrato dal
    Oct 2005
    Messaggi
    1,560
    continua...



    on *:dialog:history:sclick:2: {
    set %dialog $did(history,1).text
    dialog -c history history
    dialog -m history2 history2
    }
    dialog history2 {
    title $eval(History of %dialog,2)
    size -1 -1 200 100
    option dbu
    combo 1, 5 5 100 80, sort,drop
    button "&Select" 2, 5 18 35 10, flat
    text "URL:" 3, 5 30 30 8
    text "Directory:" 4, 5 40 30 8
    text "Session Started:" 5, 5 50 50 8
    text "Session Ended:" 6, 5 60 50 8
    text "Filesize:" 7, 5 70 50 8
    text "Avarage Speed:" 8, 5 80 50 8
    text "Status:" 9, 5 90 50 8
    icon 10, 115 5 25 25
    text "" 11, 108 22 30 8, center
    text "" 12, 55 30 140 8
    text "" 13, 55 40 140 8
    text "" 14, 55 50 140 8
    text "" 15, 55 60 140 8
    text "" 16, 55 70 140 8
    text "" 17, 55 80 140 8
    text "" 18, 55 90 140 8
    icon 19, 165 5 25 25
    text "" 20, 158 22 30 8, center
    button "R&emove Item" 21, 43 18 35 10, flat
    button "&Close" 22, 155 85 35 10, flat,ok
    }
    on *:dialog:history2:init:0: {
    did -t history2 2
    var %tini $ini(downloader.ini,0)
    var %i 1
    while (%i <= %tini) {
    if ($ini(downloader.ini,%i) != %dialog) {
    did -a history2 1 $ini(downloader.ini,%i)
    }
    inc %i
    }
    did -ac history2 1 %dialog
    if ($exists($readini(downloader.ini,%dialog,path))) {
    did -g history2 10 $readini(downloader.ini,%dialog,path)
    did -ra history2 11 $nopath($readini(downloader.ini,%dialog,path))
    if ($len($gettok($did(history2,11).text,1,46)) > 8) { did -ra history2 11 $left($did(history2,11).text,6) $+ ~1. $+ $left($gettok($did(history2,11).text,$numtok($did( history2,11).text,46),46),4) }
    }
    elseif (!$exists($readini(downloader.ini,%dialog,path))) { did -b history2 10,11 }
    if ($len($nofile($readini(downloader.ini,%dialog,path ))) == 3) {
    if ($exists($gettok($readini(downloader.ini,%dialog,p ath),1,92))) {
    if (!$exists(%shell32.dll)) { set %shell32.dll $findfile(c:\,shell32.dll,1) }
    did -g history2 19 8 %shell32.dll
    did -ra history2 20 $gettok($readini(downloader.ini,%dialog,path),1,92 ) $+ \
    }
    }
    else {
    if ($len($nofile($readini(downloader.ini,%dialog,path ))) > 3) {
    if ($exists($nofile($readini(downloader.ini,%dialog,p ath)))) {
    if (!$exists(%shell32.dll)) { set %shell32.dll $findfile(c:\,shell32.dll,1) }
    did -g history2 19 4 %shell32.dll
    did -ra history2 20 $iif($len($nofile($readini(downloader.ini,%dialog, path))) > 12,Open Dir,$nofile($readini(downloader.ini,%dialog,path)) )
    }
    else { did -b history2 19,20 }
    }
    }
    did -ra history2 12 $readini(downloader.ini,%dialog,url)
    did -ra history2 13 $readini(downloader.ini,%dialog,path)
    did -ra history2 14 $readini(downloader.ini,%dialog,begin)
    did -ra history2 15 $readini(downloader.ini,%dialog,date)
    set %hsize $readini(downloader.ini,%dialog,size)
    did -ra history2 16 $iif(%hsize != $null,$iif(%hsize >= 1000,$iif(%hsize >= 1000000,$round($calc(%hsize /1024 /1024),3) $+ MB,$round($calc(%hsize /1024),3) $+ kB),%hsize $+ bytes),Download did not start)
    set %hspeed $readini(downloader.ini,%dialog,speed)
    if (%hspeed == $null) { did -ra history2 17 Download did not finish! }
    else { did -ra history2 17 %hspeed }
    did -ra history2 18 $readini(downloader.ini,%dialog,status)
    }
    on *:dialog:history2:sclick:2: {
    set %dialog $did(history2,1).text
    dialog -c history2 history2
    dialog -m history2 history2
    }
    on *:dialog:history2:sclick:21: {
    error Are you sure to remove the history of $did(history2,1).text $+ ?,q,Question
    if (%input == $true) {
    var %a $did(history2,1).sel
    var %b $did(history2,1).lines
    if (%a == 1) {
    if (%b == 1) {
    error No more download left closing window...,io,Info
    remini downloader.ini $did(history2,1).text
    dialog -c history2 history2
    }
    else {
    set %dialog $did(history2,1,2).text
    remini downloader.ini $did(history2,1).text
    dialog -c history2 history2
    dialog -m history2 history2
    }
    }
    elseif (%a == %b) {
    set %dialog $did(history2,1,1).text
    remini downloader.ini $did(history2,1).text
    dialog -c history2 history2
    dialog -m history2 history2
    }
    else {
    set %dialog $did(history2,1,$calc(%a +1)).text
    remini downloader.ini $did(history2,1).text
    dialog -c history2 history2
    dialog -m history2 history2
    }
    }
    }
    on *:dialog:history2:dclick:10: {
    run $readini(downloader.ini,%dialog,path)
    url file:// $+ $readini(downloader.ini,%dialog,path)
    }
    on *:dialog:history2:dclick:19: {
    run $nofile($readini(downloader.ini,%dialog,path))
    }
    alias history {
    $iif($exists(downloader.ini) && $ini(downloader.ini,0) != 0,dialog -m history history,$error(No download history available yet!,wo,Eh oh))

    }
    On ^*:hotlink:*:*:{ return | halt }
    On *:hotlink:*:*:{
    if (www isin $1) || (http isin $1) {
    error Download with mIRC File Downloader?,qnv,Question
    if (%input == $yes) {
    unset %path
    if ($1) {
    if (ftp:// isin $1) { error You can't download files from ftp servers yet!,wo,Error| halt }
    if (http:// !isin $1) { var %var http:// $+ $1 | tokenize %var 32 }
    set %fullhost $1
    set %nopath $mkfn($nopath($1))
    set %nopath2 $nopath($1)
    if (%nopath == $null) { Error No file specified,wo,Error | halt }
    set %host $gettok($nofile($1),2,47)
    if (%host == $null) { set %host / }
    set %dir $gettok($nofile($1),$+(3-,$numtok($1,47)),47)
    sockclose download
    set %port
    set %i 1
    while (%i <= 5) {
    if ($mid($gettok(%fullhost,3,58),%i,1) isnum) {
    set %port %port $+ $mid($gettok(%fullhost,3,58),%i,1)
    }
    inc %i
    }
    :dir
    var %mkdir $sdir(c:\,Please select directory to save to)
    if ($disk($left(%mkdir,1)).type == cdrom) { error You cant save your file directly on a CD-ROM drive!,wo,Error | goto dir }
    if (%mkdir != $null) {
    if ($disk($left(%mkdir,1)).type == $null) { error Drive does not exsist!,wo,Error | goto dir }
    }
    else { sockclose download | error No download directory given,wo,Aborted | $iif($dialog(download),dialog -c download download) | halt }
    if (%mkdir != $null) {
    set %path %mkdir
    }
    else { sockclose download | error No download directory given,wo,Aborted | $iif($dialog(download),dialog -c download download) | halt }
    }
    }
    :file
    if ($exists(%path $+ %nopath)) {
    error %path $+ %nopath already exists! Remove and begin writing new file?,qy,Question
    if (%input == $true) {
    remove %path $+ %nopath
    }
    else { sockclose download | error File already exists,wo,Aborted | $iif($dialog(download),dialog -c download download) | halt }
    }
    unset %size
    sockopen download $iif(%port != $null,$remove(%host,: $+ %port),%host) $iif(%port != $Null,%port,80)
    writeini -n downloader.ini %nopath URL %fullhost
    writeini -n downloader.ini %nopath begin $fulldate
    writeini -n downloader.ini %nopath path %path $+ %nopath
    dialog -m download download
    }
    elseif (%input == $no) {
    run $1
    }
    }

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.