backIndex

Xelagot action script

Events: DownloadComplete

Refer to Events for general information..

See also Topics: Downloading files and Web Downloads.

DownloadComplete event is triggered whenever the bot completes or aborts downloading a file from internet (http).

To request a download from URL $u to a file on your computer having the same name as the file on the web:
Download $u

To request a download to a specified filename (or full path + filename) $f
Download $u $f

These two statements trigger the DownloadComplete event. You do not need to wait for this event to occur to isue multiple requests: they get queued in a request buffer. All downloads are in a separate thread, the program regulates how many threads it allows at one given time.

xelagot 3.607 or newer
If file $f is not specified, the file is downloaded to the _Downloads folder. The filename convention for $f in Download $u $f is explained in the section Filenames. However, in this case, the _Downloads folder takes precedence over the script's folder. If the destination path and folder does not exist, it will be created to accommodate the file.

xelagot 3.606 or older
Files are downloaded to the Downloads folder by default. A different full path (+ filename) may be specified in $f.

Installer:

OnDownloadCompleteEvent <eventlabel>
Event type: 9110

Specific statements (must be inside the event handler):

GetEventType %a stores the event type code in variable %a
GetEventResult %a stores the event result code in variable %a. 0 means success, -1 means failure. This must be tested
GetURLError $e stores the error message in $e if %a in GetEventResult %a is different to zero.
GetURL $u $f %L stores the url in $u, the filename in $f and the file-length in %L.
Note: URL event uses the same statement with different parameters!


backIndex