home *** CD-ROM | disk | FTP | other *** search
- /* Fetch script for use with AmIRC 2.x
- $VER Fetch.amirx 1.16a (18.05.99)
- // Written by Deryk Robosson 11.19.96
- //
- // 11.24.96 (1.01) - added .readme fetching support
- // 16.01.97 (1.02) - added support for result codes
- // 04.02.97 (1.03) - added path variable for ftpget and updated
- // the docs
- // added support for not obtaining the .readmes
- // added multi site support - Requested by TheBarron
- // 13.02.97 (1.05) - added .readme viewing support - Suggested by Gallant
- // optimised the source - Suggestions made by Gallant
- // 04.03.97 (1.06) - prettied up the display of information
- // 18.03.97 (1.07) - cleaned up the code and modified the way
- // the sitelist is handled. (suggestions and some code by Gallant)
- // 25.05.97 (1.071)- added notification to the user of the start of retrieval
- // 12.06.97 (1.08) - corrected problem fetching files from root dir of aminet.
- // (reported by Chris chris@celsworth.demon.co.uk)
- // newlook@ameritech.net newlook on #amiga IRC (ANet)
- //
- // - start WNP work mail amicon@amicon.net if you have suggestions or problems.
- //
- // 17.08.97 (1.08a)- added 'missing ftpget' error report.
- // by John M. Hoyt - amicon@amicon.net
- // 04.02.98 (1.09a)- Cleaned up some a couple routines.
- // 04.02.98 (1.10a)- Fixed geeked output display reported by Cryto.
- // 05.02.98 (1.11a)- Yet another boo-boo fixed that I should have caught before.
- // 11.07.98 (1.12a)- Various "stuff" fixed that annoyed me.
- // 21.10.98 (1.14a)- Updated Aminet mirror list.
- // 18.05.99 (1.15a)- Changed to support Ray Akey's GetClient. (included).
- // Updated Aminet mirror list.
- // 18.05.99 (1.16a)- Revamped method of retrieving .readme for use with GetClient.
- //
- // Add this alias to your AmIRC:
- //
- // /alias fetch /rx fetch.amirx %p
- //
- // Then use like: /fetch comm/irc/AmIRCFetch.lha
- // Which would get the original AmIRCFetch from Aminet :)
- //
- //
- // GetClient is (c) 1999 by Ray Akey and available via irc at:
- // addicted.beyondirc.net channel #CNetIndependent
- // Ray goes by the nick of HMetal. And I am there as WarNPeace.
- //
- */
- bold = d2c(2)
- underline = '1F'x
-
- /* this is the default site list, edit for any changes */
-
- site.0 = 6
- site.1 = 'us.aminet.net' /* USA - Complete mirror (ftp.wustl.edu)*/
- site.2 = 'de.aminet.net' /* Germany - Complete mirror (ftp.uni-paderborn.de)*/
- site.3 = 'uk.aminet.net' /* UK - Complete mirror */
- site.4 = 'it.aminet.net' /* Italy - Complete mirror */
- site.5 = 'se.aminet.net' /* Sweden - Complete mirror */
- site.6 = 'au.aminet.net' /* Australia - Complete mirror */
-
- site_default = 1 /* Change this to your favorite site */
-
-
- /* change this to 0 if you don't want readme files, 1 otherwise */
- get_readme = 1
-
- /* change this to 0 if you don't want the readme files displayed after download , 1 otherwise */
- display_readme = 1
-
- /* Change this to your default incoming directory */
- incoming_dir = 'NEW:'
-
- /* Change this to reflect the path of GetClient */
- ftpget_path = 'GetClient'
-
- /* Change this to your favorite text viewer */
- text_viewer = 'multiview'
-
- /* Change this to your email address */
- pass_word = 'using@fetch.amirx'
-
- options results
- parse arg file' 'param
-
- if file = ''|upper(file) = 'VER' then signal version
- if upper(file) = 'HELP' then signal help
- if upper(file) = 'SITELIST' then signal listsites
-
- if param ~= '' then if datatype(param) = 'NUM' then if param <= site.0 then site_default = param
-
- /* prepare for the main file */
- remote = '/pub/aminet/'file
-
-
-
-
- /* setup the commandline parameters */
- getit = ftpget_path' U anonymous P 'pass_word' Q L 'incoming_dir' 'site.site_default||remote
- call echo('Now retrieving' site.site_default||remote'.')
- ADDRESS COMMAND getit /* grab the file */
-
- /* inform the user as to the status of the command */
- out.0 = 'File retrieval finished (No Errors).'
- out.10 = 'Connot locate GetClient exe (Set the path in Fetch.Amirx).'
- out.21 = 'Connection refused'
- out.22 = 'Unknown error - Contact amicon@amicon.net'
- out.23 = 'Unknown error - Contact amicon@amicon.net'
- out.24 = 'Unknown error - Contact amicon@amicon.net'
- out.25 = 'Xfer failed/file does not exist'
- out.26 = 'User not welcome/Service unavailable'
- out.27 = 'Bad Username'
- out.28 = 'Bad Password'
- out.29 = 'No Filename Given'
- out.30 = 'No Socket Lib - Try again when you are online!'
-
- call echo(out.rc)
-
- if rc=0 then do
- if get_readme then do
- if pos('.',file) > 0 then readme_file = left(file,lastpos('.',file))'readme'
- else readme_file = file'.readme'
- remote = '/pub/aminet/'readme_file
-
- /* setup the commandline parameters */
- getit = ftpget_path' U anonymous P 'pass_word' Q L 'incoming_dir' 'site.site_default||remote
- call echo('Now retrieving' site.site_default||remote'.')
- ADDRESS COMMAND getit /* grab the file */
- call echo(out.rc)
- if display_readme then address command text_viewer' 'incoming_dir||substr(readme_file,lastpos('/',readme_file)+1,length(readme_file))
- end
- end
- exit
-
- Else exit
-
- version: /* show the user version information */
- call echo(bold'Fetch.AMIRX'bold' Version 'subword(sourceline(2),3,2))
- call echo('Read the top of Fetch.AMIRX script for history.')
- call echo(bold'©1996,1997'bold' Deryk Robosson 'bold'(newlook)'bold' - [newlook@ameritech.net]')
- call echo('mods by 'bold'©1997-99'bold' John M. Hoyt 'bold'(WarNPeace)'bold' - [amicon@amicon.net]')
- call echo(bold'HELP:'bold' /fetch help')
- exit
-
- help: /* show the user help examples */
- call echo(bold'Fetch.AMIRX'bold' Help')
- call echo('/<alias> comm/tcp/AmIRCFetch.lha 2 to get file from site #2')
- call echo(bold'SITELIST - 'bold'displays current aminet site list')
- call echo(bold'VER - 'bold'displays script version')
- call echo(bold'HELP - 'bold'displays this')
- exit
-
- listsites: /* show the user all sites */
- call echo(bold||underline'SiteList')
- do i=1 to site.0
- call echo(i' - 'site.i)
- end
- exit
-
- echo: procedure
- parse arg a
- 'echo P='d2c(27)'b«Fetch» 'a
- return 1
-
-