VaporWare
VaporWare AmIRC Main Index [Previous| Chapter Index|Next]

Arexx Scripts

DCCDone.amirx

ARGUMENTS: com successcode nick filename

Where:
successcode is 1 for a successfull DCC 0 for failed.
com is SEND for Outgoing DCC's or RECEIVE for Incoming DCC's.

This script is executed when a DCC is completed/aborted/failed. It may be used to perform autgomated actions on received files.

Example:

This script will extract lha/lzx archives to RAM: and play wav's and
snd's.

     /* DCCDone.amirx */
     options results
     parse arg com successcode nick filename
     
     /*Transfer failed/DCC is incoming - abort*/
     if successcode=0 | com='SEND' then exit
     
     /* Obtain 3 - letter extension */
     ext = upper(right(strip(filename,'B',' "'),4))
     
     /*
     ** #?.wav or #?.snd  will be played in AmIRC
     ** #?.lha will be extracted to RAM:
     ** #?.lzx will be extracted to RAM:
     */
     Select
         when ext = '.WAV' | ext = '.SND' then 'PLAYSOUND' filename
         when ext = '.LHA' then address command 'lha x' filename 'RAM:'
         when ext = '.lzx' then address command 'lzx x' filename 'RAM:'
     otherwise
     end