home *** CD-ROM | disk | FTP | other *** search
/ ProfitPress Mega CDROM2 …eeware (MSDOS)(1992)(Eng) / ProfitPress-MegaCDROM2.B6I / BBS / MISC / SCRIPTS.ZIP / GEFDL.T < prev    next >
Encoding:
Text File  |  1990-10-05  |  2.3 KB  |  90 lines

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