home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 3 Comm / 03-Comm.zip / roboos2b.zip / OS2-DOW2.RS < prev    next >
Text File  |  1994-03-11  |  2KB  |  87 lines

  1. TITLE "OS2Shareware File Download"
  2.  
  3. ;Will download up to 1 file, the OS2-DOW.RS script will do up to 9
  4. ;For more use a second script.
  5.  
  6. ; The numbers on the next lines don't actually do anything.  They are
  7. ; only added to increase the readability of the script.  Robocomm
  8. ; always numbers parameters in the order they are encountered in
  9. ; the file.
  10.  
  11. PARAMETER 1 "Enter File Name to GET"
  12. ENDPARAMS
  13.  
  14.     TIMEOUT 120
  15.  
  16.     IF NOT CONNECTED GOTO NotOn
  17.     WHEN "MESSAGE: SEND "M"
  18.     SEND "|"
  19.     WHEN "to continue" Send "|"
  20.     WHEN "More [Y,n,=]?" SEND "|"
  21.  
  22. ; Send a bunch of <CR> to get through the other prompts
  23. ; without modifications
  24.     CLEAR
  25.     WHEN "to continue" Send "|"
  26.     WHEN "More [Y,n,=]?" SEND "|"
  27.  
  28.     SEND "||"
  29.     WAITFOR "MAIN:" FAILURE HANGUP
  30.  
  31. ; Change to File Area
  32.     MESSAGE "Changing to File Area"
  33.     SEND "F"
  34.     WAITFOR "FILE:"
  35.  
  36. ; Getting File
  37. :GetFile1
  38.     IF EMPTY "%P1%" GOTO GetFile2
  39.     Message "Initiating Download of %P1% "
  40.     Send "D"
  41.     Waitfor "download (#"
  42.     Message "Requesting %P1% file"
  43.     IF NOT EMPTY "%P1%" SEND "%P1%|"
  44.     CLEAR
  45.  
  46. ; Watch if unable to download file.
  47.     WHEN "I see no" GOTO NoFile1
  48.     WHEN "Transfer aborted." GOTO Aborted1
  49.  
  50.     WAITFOR "download (#"
  51.     Message "Sending Enter To Start Download"
  52.     SEND "|"
  53.     Waitfor "times to cancel."
  54.     Message "Starting Protocol"
  55.     Download "%DLDIR%%P1%" Using "%BBS20%"
  56.     IF ERRORLEVEL GOTO ProtocolError
  57.     SEND "||"
  58.     WAITFOR "FILE:"
  59. ; Quit to the main prompt
  60.     SEND "M"
  61.     Exit 0
  62.  
  63. :NoFile1
  64.     MESSAGE "File %P1% is not on board"
  65.     GOTO DownloadError
  66.  
  67. :Aborted1
  68.     Message "Transfer aborted, Probably no time"
  69.     GOTO DownloadError
  70.  
  71. :ProtocolError
  72.    MESSAGE "Download of %P1% Failed, Protocol Error, maybe no disk space"
  73.     GOTO DownloadError
  74.  
  75. :DownloadError
  76.     SEND "||"
  77.     WAITFOR "FILE:"
  78. ; Quit to the main prompt
  79.     SEND "M"
  80.     Exit 1
  81.  
  82. :NotOn
  83.         Message "Make Sure SCript to Execute After Log On"
  84.         Message "is Set in BBs Systems"
  85.         Exit 1
  86.  
  87.