home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload / ShartewareOverload.cdr / comm / zcm_scrp.zip / GEFDL.T < prev    next >
Text File  |  1989-11-21  |  2KB  |  86 lines

  1.  :: Download a file from GEnie page given in s7 - see info at end REV 8-08-89
  2.     pat
  3.     open %item
  4.     dis -g
  5. try2:    grab s0
  6.     set ifs "     "
  7.     split s0
  8.     if !%z0 goto done
  9.     setc s1 "\L%z1"
  10.     if !t goto failed
  11.     pq200
  12.     put "m %s7:3\r"
  13.     pat 1 "Enter #"
  14.     pat 2 "Item #"
  15.     wait    
  16.     put "6\r"
  17. again:    pat 1 "Enter"
  18.     wait
  19.     put "%z0\r"
  20.     pat 1 "D>ownload"
  21.     pat 3 "Try again (Y/N)"
  22.     wait
  23.     if 3 put "N\r"; goto failed
  24.     put "d\r"
  25.     pat 2c "3. YMODEM"
  26.     pat 3 "Which item"
  27.     pat 4c "4. ZMODEM"
  28.     wait -f20
  29.     estimate z5
  30.     if 4 put "4\r"; set adlopts "r"; wait -T99; goto diddl
  31.     if f%s1 echo "%s1 Exists: Skipping File"; put "\r"; goback try2
  32.     put "3\r"
  33.     pat 3 "file!"
  34.     wait -f20
  35.     pat
  36.     p?0
  37.     rb -y
  38. diddl:
  39.     if !? goto fail
  40.     pat 2 "another"
  41.     wait
  42. try3:    grab s0
  43.     split s0
  44.     if !%z0 goto done0
  45.     if !t goto done0
  46.     setc s1 "\L%z1"
  47.     put "y\r";  goback again
  48. done0:    put "n\r"
  49. done:    echoc "Processing of %item finished."
  50.         obey "!mv %item dow/done"
  51.         echoc "%item moved to dow/done"
  52.     pat 1 "Enter #"
  53.     pat 2 "Item #"
  54.     wait -f15
  55.         ena -gt
  56.     echoc "gefdl.t Finished"
  57.     return
  58. fail:    echoc "%s1 Download FAILED"
  59.     closetx
  60.         ena -gt
  61.     if !c fail
  62.     return
  63. failed:    echoc "gefdl.t FAILED: bad control file"
  64.     closetx
  65.         ena -gt
  66.         obey "!mv %item dow/failed"
  67.         echoc "%item moved to dow/failed"
  68.     return
  69.  
  70. ************************************************************************
  71. This script is called from the main GEnie script as:
  72.         set s7 "615"
  73.         expand %lib/gefdl.t dow/G615*
  74. with the control files being in the "dow" subdirectory.  "dow" must
  75. itself have "done" and "failed" subdirectories.  Control files have
  76. one or more lines taken verbatim from the GEnie files listing:
  77.  
  78.  6016 WEFAX.ARC                X PJSPELLMAN   870830   39060     18   4
  79.  6005 ZANSI1.ARC               X WHEISER      870830   34020     65   5
  80.  5952 ZD12.ARC                 X SHANNON      870825   27720     98   5
  81.  
  82. The files are fetched by their GEnie directory number, and are downloaded
  83. to the filename given in the directory line.  If the file already exists,
  84. the download is skipped unless ZMODEM is available.  ZMODEM downloads use
  85. the -r option for Crash Recovery.
  86.