home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 3 Comm / 03-Comm.zip / PMAC10.ZIP / PCBOARD.DOC < prev    next >
Text File  |  1992-05-07  |  24KB  |  443 lines

  1.      ====================================================================
  2.            PCBOARD.CMD, Copyright 1992 Brad Berson, Psycho Psoftware
  3.                              v1.10 April 28, 1992
  4.      ====================================================================
  5.  
  6.      Warranties...
  7.  
  8.      Hahaha!  Did you really think I'd do THAT?  Enter at your own risk.
  9.      Being responsible for my own problems is enough, thank-you.  And
  10.      please RTFM (read the, ahem, manual!).
  11.  
  12.      This documentation sucks.  "Oh well."
  13.  
  14.      This document assumes you have at least some basic knowledge of
  15.      Multi-Net's PMcomm (1.09 or later), IBM OS/2 (1.30 or later), the
  16.      REXX/2 procedural language, the Qmail off-line mail system and
  17.      recent versions of PCBoard (R) BBS software.  If it's really not
  18.      enough then write or call.  And then register!
  19.  
  20.      What it is!
  21.  
  22.      PCBOARD.CMD is "script" file for PMcomm combining PMcomm and REXX
  23.      commands to allow automated sign-ons to bulletin boards using PCBoard
  24.      (R) software.  With some minor editing, PCBOARD.CMD will also allow
  25.      automated use of Sparkware's Qmail door (v4) and perform multiple
  26.      automatic file uploads and downloads to PCBoard.  PCBOARD.CMD is
  27.      designed to be universal from one PCBoard bulletin board to the next,
  28.      so there's no need to clutter your hard disk with a different file
  29.      for each PCBoard bulletin board you use.
  30.  
  31.      "You have some explaining to do, young man!"
  32.  
  33.      The first thing you need to do is make sure that PMcomm knows where
  34.      to find your script files.  This is in the PMcomm setup under the
  35.      Options/Paths menu.  Then you need to modify your dialing entries
  36.      for PCBoard BBS', inserting "PCBOARD.CMD" in the Dial Script field.
  37.      Minimally, you'll also need to know how each BBS identifies itself
  38.      when you connect to it.  Read on...
  39.  
  40.      What about passwords?
  41.  
  42.      When you connect to a PCBoard BBS, the software returns the modem
  43.      connect strings found when you connected, then a line identifying
  44.      whose BBS you connected to, and then a line identifying the version
  45.      of the PCBoard software in use.  PCBOARD.CMD examines the identifi-
  46.      cation line and then looks up your password for that BBS via the
  47.      text in that line.  You must edit lines in the end of PCBOARD.CMD
  48.      to indicate a unique string of characters to look for in the
  49.      identification line, and a password to use for that BBS.  There are
  50.      a few examples in the file as supplied.  If PCBOARD.CMD could not
  51.      figure out what password to use, it will ask you to type one in.
  52.      Qmail configuration will not be performed for that session but any
  53.      pending file transfers will be.
  54.  
  55.      To prepare for this feat...
  56.  
  57.      You will need to edit ten lines near the top of PCBOARD.CMD:
  58.  
  59.      * The first is your first and last names.
  60.  
  61.      * The second is the directory where you keep your Qmail packets
  62.        (with the trailing backslash, or leave alone if not applicable).
  63.  
  64.      * The third sets the verbosity of the contents of the activity log
  65.        file (if you have specified a file name for it), and takes values
  66.        from 1 to 4.  You would normally use 1 (least) to 3 (most).  Use
  67.        4 to turn on the wait-loop debugging, which writes indicators on
  68.        the screen every time PCBOARD.CMD sees the various text strings
  69.        that it's searching for.  Looks messy but is very useful.
  70.  
  71.      * The fourth indicates whether or not you want PCBOARD.CMD to auto-
  72.        matically disconnect you after a Qmail or file transfer session
  73.        ('YES' or 'NO').
  74.  
  75.      * The fifth indicates whether or not you want to delete Qmail .REP
  76.        and .QWK files after a successful Qmail session.
  77.  
  78.      * The sixth line indicates whether or not you want to implement
  79.        PCBOARD.CMD's own automatic repeat mail scans for multiple mail
  80.        packet downloads when maximum packet size has been reached.
  81.  
  82.      * The seventh line decides if you want PCBOARD.CMD to watch for the
  83.        text "NO CARRIER" after the script has been interrupted.  There
  84.        are several limitations to this feature so use 'YES' only if you
  85.        *need* to log total connect time regardless of whether or not the
  86.        script has been halted.
  87.  
  88.      * The eighth line is the full drive\path\filename of the command
  89.        file used for automatic file uploads and downloads.
  90.  
  91.      * The ninth line is the full drive\path\filename of the file used
  92.        for the activity log (logfile='' to disable the activity logging).
  93.  
  94.      * The tenth line resets the up/download path when the script ends.
  95.        This should be set to match the configuration in PMcomm under
  96.        Options-Paths menus.
  97.  
  98.      The configuration as delivered was tailored to my directory setup,
  99.      which keeps the Deluxe2 mail reader in C:\COMM\QMAIL along with any
  100.      mail packets, and keeps uploads, downloads, list and log files in
  101.      C:\COMM\UPDOWN.  It defaults to the most verbose logging level,
  102.      automatic logoff, automatic deletion of un-needed mail packets,
  103.      automatic repeat scanning turned on, and wait for "NO CARRIER" off.
  104.  
  105.      You'll need to edit the "GetBbs:" code near the end of PCBOARD.CMD
  106.      as well.  An example of the first few lines of text received when
  107.      you call a bulletin board running PCBoard (R) software are:
  108.      ===================================================================
  109.      CARRIER 9600 PROT: ERROR-CONTROL/LAP-B CONNECT 19200
  110.      CONNECT 9600 / 05-07-92 (13:26:00)
  111.      (Error Correcting Modem Detected)
  112.      Invention Factory BBS / Connected to a Hayes 9600 V series.
  113.      PCBoard (R) v14.5a/U - Node 11 - UFE4875A3965
  114.      Do you want graphics (Enter)=no? 
  115.      ===================================================================
  116.      There's a message indicating the details of the modem connection,
  117.      then two lines identifying the BBS you've connected to and then the
  118.      version of PCBoard software in use.  It's that identification line
  119.      that we'll rely on to figure out what password to use, and whether
  120.      or not that board will be used for Qmail4 mail transfers.
  121.  
  122.      Sometimes the ID line is different on various nodes of the same
  123.      BBS, and sometimes SYSOPs change that line from time to time in
  124.      subtle or not-so-subtle ways.  Choose a part of the text as a key
  125.      in ID line that you can rely on to uniquely identify the BBS and
  126.      still be impervious to minor changes.  When you enter the code in
  127.      PCBOARD.CMD, be sure to use capital letters for the variables in-
  128.      side the paired single-quotes.  An example:
  129.  
  130.      WHEN Pos('INVENTION',line)\=0 THEN DO
  131.        pword='INVPW1'                 /* your password for BBS */
  132.        qmail='YES INV-FAC Z' ; END    /* YES, packet name, protocol */
  133.      WHEN Pos('DARK SIDE',line)\=0 THEN DO
  134.        pword='DSPW1'
  135.        qmail='YES DARKSIDE G' ; END
  136.      WHEN Pos('WISHBONE',line)\=0 THEN
  137.        pword='WISHPW1'                /* this fmt for BBS w/o Qmail */
  138.  
  139.      The examples set up the Invention Factory BBS for Qmail, whose mail
  140.      packets look like "INV-FAC.QWK", using Zmodem for the mail transfer
  141.      protocol.  It then sets up the Dark Side of the Moon BBS for Qmail,
  142.      whose mail packets look like 'DARKSIDE.QWK', using Ymodem-G for the
  143.      mail transfer protocol.  And lastly it sets up the Wishbone BBS as
  144.      *not* having Qmail4 (and whose password is "WISHPW1").
  145.  
  146.      You can ask your SYSOP what the packet name will be if you don't
  147.      already know, or find out by firing up the Qmail4 door and trying
  148.      an upload or download and seeing what name it sends/looks for.
  149.      Remember to match your protocol to the Qmail4 "P" configuration.
  150.      When adding entries to the GetBbs: section, it's easiest to just
  151.      copy existing lines (group of 3 for Qmail4 entries, group of 2 for
  152.      boards w/o Qmail4) and then edit your data into the copied lines.
  153.  
  154.      Overall execution logic:
  155.  
  156.      PCBOARD.CMD checks for .QWK & .REP files when it starts and behaves
  157.      accordingly.  It also deletes files in a manner which suited my work
  158.      pattern.  You control what the script does by what files exist.
  159.  
  160.      Here is how it works:
  161.      ====================================================================
  162.      File(s) exist    Behaviour on Qmail configuration
  163.      ====================================================================
  164.      .QWK .REP .LST   Ul's .REP, dels .REP & .QWK, does xfers, logs off.
  165.      .QWK .LST        Logs in, does file xfers and logs off.
  166.      .REP .LST        Dl's .QWK, ul's & dels .REP, does xfers, logs off.
  167.      .LST             Downloads .QWK, does xfers, logs off.
  168.      .QWK .REP        Uploads .REP, deletes .REP and .QWK, logs off.
  169.      .QWK             Logs in and leaves you at Main Board Command.
  170.      .REP             Dl's .QWK, uploads and deletes .REP and logs off.
  171.      none             Downloads .QWK, logs off.
  172.      ====================================================================
  173.      File(s) exist    Behaviour on no-Qmail configuration
  174.      ====================================================================
  175.      .LST             Logs in, does file xfers and logs off.
  176.      none             Logs in and leaves you at Main Board Command.
  177.  
  178.      If for example, you wanted PCBOARD.CMD to sign onto a board that has
  179.      been configured with Qmail, but only perform some unattended file
  180.      transfers and disconnect unattended, you would create UPDOWN.LST to
  181.      perform the transfers and then create a "dummy" <BBSNAM>.QWK file to
  182.      fool PCBOARD.CMD into skipping the mail download.
  183.  
  184.      About file transfers...
  185.  
  186.      After mail transfers have been done, the file transfer commands in
  187.      the auto upload/download file will be performed (if exists).  The
  188.      file has the following format:
  189.  
  190.      0 D Z C:\COMM\UPDOWN\THISFILE.ZIP
  191.      6 U G C:\COMM\UPLOADS\THATFILE.ZIP This is the upload file comment
  192.      0 D O C:\COMM\UPDOWN\DIR??.ZIP
  193.      0 D Z C:\COMM\TEMP\INCOMPLT.ZI?
  194.  
  195.      Downloads file THISFILE.ZIP into directory C:\COMM\UPDOWN using
  196.      Zmodem, then uploads file THATFILE.ZIP into conference 6 from the
  197.      directory C:\COMM\UPLOADS using Ymodem-G, then downloads all files
  198.      on the BBS's main conference matching "DIR??.ZIP" using Xmodem-1K,
  199.      then attempts a Zmodem error-recovery on an incomplete download
  200.      that was left in the directory C:\COMM\TEMP.
  201.  
  202.      Generally, four items/line for downloads and five items for uploads.
  203.      The first is the conference in which to perform the transfer (0 is
  204.      the Main Board), D for download or U for upload, the protocol letter
  205.      which conforms to PCBboard convention, the full drive\path\filespec
  206.      for the file to upload or download, and for uploads a file comment.
  207.      PCBoard's multi-line comments are supported automatically.  The
  208.      conference-specific up/download support exists for systems which
  209.      have special or restricted areas maintained for certain files.  In
  210.      typical use the conference should be 0.  To speed multi-conference
  211.      transfers, you should group transfers by conference (in any order
  212.      but beginning with 0).
  213.  
  214.      "Um, there's something you should know..."
  215.  
  216.      The script is most easily interrupted at any time by clicking on the
  217.      PMcomm script icon (an "open book").  You can do this at any time,
  218.      although the delay between sections (login, mail, files) is a handy
  219.      time.  A line will be added to the log file indicating interruption
  220.      by user, and you will not have a record of total connect time or
  221.      what time you logged off.  There is alternate code to avoid this and
  222.      provide a record of total connect time but it slows down the screen
  223.      response, relies on the modem sending the text "NO CARRIER" when the
  224.      carrier is no longer found and can be fooled by that text appearing
  225.      and not having come from the modem.  To use the alternate code, just
  226.      set the variable 'waitnc' from 'NO' to 'YES'.  There is a one-hour
  227.      timeout for "NO CARRIER", and can be increased or decreased to suit
  228.      your needs.  This also works if the script was just used to log-in
  229.      and left you at the "Main Board Command".  The major restriction to
  230.      using this feature is that file transfers and certain other things
  231.      will cause an error condition in the script, which will then break
  232.      your connection in several seconds.  And the script can't be aborted
  233.      before breaking connection because PMcomm thought the script was
  234.      aborted when you first clicked on the script icon!
  235.  
  236.      Conferences should be specified in UPDOWN.LST by number.  By name
  237.      should work but is untested.  Supported protocols are <Z>modem,
  238.      Ymodem<G>, <K>ermit, <Y>modem-batch, Xmodem-1K<O>, <X>modem and
  239.      Xmodem-<C>RC.  Wildcard uploads are not supported.  Wildcard file-
  240.      spec downloads are supported but may not be reliable depending on
  241.      the PCBoard software version.  Auto-repeat wildcard downloads for
  242.      non-batch protocols may or may not work depending on the version of
  243.      PCBoard and the position of the planets.  Zmodem error recovery may
  244.      fail ("file exists") if you resume an aborted transfer via the file
  245.      transfer list.  The workaround: specify a wildcard in the filename,
  246.      which causes that error-checking to be over-ridden.  For example,
  247.      instead of "0 D Z FILENAME.ZIP", try "0 D Z FILENAME.ZI?".
  248.  
  249.      Detection of the BBS name may fail on connections which involve an
  250.      error-correcting modem and a non-error-correcting modem.  This is
  251.      due to the characters lost during protocol negotiation attempts but
  252.      may be helped by the SYSOP of the BBS increasing the time delay or
  253.      number of 'NUL's transmitted before sending the negotiation/BBSID/
  254.      PCBoard-version message.
  255.  
  256.      Qmail4 should be configured with extended prompts on, auto-repeat
  257.      downloads off, expert mode on.  Qmail4's auto-repeat downloads are
  258.      not supported, however PCBOARD.CMD supports its own repeat-scanning
  259.      by the 'autorep' variable.  Make sure the protocol configuration
  260.      and packet name matches the setup in the GetBbs: section.
  261.  
  262.      With PMcomm 1.11, entries in your .FON file can be dialed from a
  263.      script by referring to them by name.  I may revise PCBOARD.CMD to
  264.      make use of this.  One side-benefit would be better resistance to
  265.      modem negotiation problems as mentioned above, and the other would
  266.      be the capability to have PCBOARD.CMD or maybe another "master"
  267.      control script loop through calling several BBS's unattended and
  268.      time-shifted to late-evening discount calling times.  Stay tuned
  269.      for developments, and feel free to get in touch with me with your
  270.      ideas and viable requests.
  271.  
  272.      A note on mail readers :-)
  273.  
  274.      Note that if you use DELUXE2, it extracts the packet's .PTR file and
  275.      leaves it in the directory DELUXE2 with your .REP and .QWK packets.
  276.      Use DELUXE2's "command to perform on exit" to either delete the .PTR
  277.      file or better yet, move it to a safe holding directory.  This way
  278.      PCBOARD.CMD won't find it and reset your pointers every time you do
  279.      a mail transfer (this could be counter-productive!).  PCBOARD.CMD
  280.      looks for and transfers .KEY and .PTR files in your mail directory.
  281.      By default, after uploading a .PTR file PCBOARD.CMD will reset your
  282.      message-read pointers to the state they were in *after* the download
  283.      of the packet the .PTR file came from.
  284.  
  285.      In emergency, break glass.
  286.  
  287.      In general, errors in script execution are all logged in the file
  288.      PCBOARD.LOG (or whatever name you have chosen).  Inspect the file
  289.      for the error and the line at which it occurred.  Major errors are
  290.      also posted on the screen in red letters.  Those messages will be
  291.      more informative than the error log.  I recommend using the log file
  292.      as it records errors in mail scanning and file transfers in detail,
  293.      as well as general errors.  It also allows you to see what activity
  294.      costs you the most and account for your activity for business and
  295.      the like.
  296.  
  297.      One of the most likely troubles to occur is that of "timeouts".
  298.      That is, where the script is waiting to see specific data coming in
  299.      from the BBS, and doesn't see it after a programmed time period.
  300.      Unusually long welcome screens at low baud rates, slow mail systems
  301.      and large numbers of conferences for Qmail4 to scan may cause such
  302.      a problem.  To allow for extra time in a specific section, look for
  303.      this in the appropriate section:  "CALL Read_timeout 'n000',port".
  304.      Modify 'n' is the number of seconds to wait as used in subsequent
  305.      "CALL Wait_fore..." statements.
  306.  
  307.      Similar trouble is caused by the operators of the BBS deciding that
  308.      they can write better prompts for the PCBoard software than what it
  309.      comes with.  While this configurability is nice, it means you can't
  310.      always depend on exactly what a given version of PCBoard will look
  311.      like.  If "Main Board Command" has been changed to "Sock it to me",
  312.      the script will sit there waiting for "rd Command", and encounter
  313.      a timeout condition.  If you try to edit PCBOARD.CMD to work with a
  314.      particular BBS, be careful not to "break" it for other BBS's.  Or
  315.      if you are desperate, "COPY PCBOARD.CMD PCBOARD1.CMD", make all the
  316.      necessary changes to PCBOARD1.CMD and update the dialing entry to
  317.      refer to PCBOARD1.CMD instead.
  318.  
  319.      I've been using this script in its various intermediate forms for
  320.      many months and done much testing of all the various functions in
  321.      as many combinations as possible, but now and then something slips
  322.      through.  If you have a persisent problem that you can't fix, set
  323.      the logging level to 4, send me a capture log of the session, the
  324.      applicable section of the activity log file, and a copy of the
  325.      script (erase your passwords!) if you've made modifications.  I'll
  326.      do my best to figure out the trouble.
  327.  
  328.      Nitty Gritty...
  329.  
  330.      Read this before you actually use the script.  It may provide some
  331.      useful insight.  It will also prove useful if you encounter errors
  332.      or the script chokes on something or times out.
  333.  
  334.      Start:     Handles language, graphics and first name prompts.
  335.  
  336.      Inam:      Completes log-in with name and password, and abandons any
  337.                 conference auto-joined from previous connections.  The
  338.                 following block determines forthcoming activities.  All
  339.                 other activities are subroutines called from this block!
  340.  
  341.      Qmail:     Several blocks which handle Qmail4 dialogue, uploading
  342.                 key and pointer files (if existing) and transferring .QWK
  343.                 and .REP files.  Also handles deleting mail files.
  344.  
  345.      Quitmail:  Exits Qmail4 door, supports password requests.
  346.  
  347.      CheckMail: Detects mail files to determine mail block logic.
  348.  
  349.      Logoff:    Attempts quick-logoff.  Supports logoff notices and
  350.                 questionnaires and calls error routine to drop DTR and
  351.                 hang-up if timed-out.
  352.  
  353.      PcbXfer:   Reads transfer file list, parses commands and calls
  354.                 routines to join conferences and set up file transfers.
  355.  
  356.      JoinConf:  Joins conference.  Causes transfers to be bypassed if the
  357.                 join failed for any reason.
  358.  
  359.      XferCmds:  Handles all file upload and download dialogue.  Calls
  360.                 DoXfer to perform actual transfers.
  361.  
  362.      DoXfer:    Performs individual file transfers.
  363.  
  364.      GetFnam:   For use with batch downloads using non-batch protocols
  365.                 such as Xmodem.  Scans the scrollback buffer for the name
  366.                 of the file about to be sent.
  367.  
  368.      RexxErr:   Error handler for unrecoverable errors in REXX code.
  369.                 Terminates connection by dropping DTR line to modem.
  370.                 Makes flatulent sound when called.
  371.  
  372.      HostErr:   Error handler for recoverable errors encountered in
  373.                 script execution.  Makes flatulent sound when called.
  374.                 Script continues to execute.
  375.  
  376.      Errh:      Error handler for unrecoverable errors that are due to
  377.                 unexpected conditions or timeouts in execution.  Makes
  378.                 irritating beeping sound and drops DTR.
  379.  
  380.      ExitScr:   Called when script is interrupted by Ctrl-Break or by
  381.                 clicking on script icon (an "open book") on the PMcomm
  382.                 status line.  Control is returned to keyboard and the
  383.                 modem is left on-line.
  384.  
  385.      GetBbs:    Routine which searches scrollback buffer to determine
  386.                 name of connected BBS.  Sets password, Qmail4 file xfer
  387.                 protocol and packet names where applicable.  Will ask you
  388.                 you to type in password manually if it fails.  Type in
  389.                 password.  Don't press <Return> - just wait 20 seconds
  390.                 for script to continue.
  391.  
  392.      Flush:     Flushes pending data from active COM port buffer.
  393.  
  394.      WriteLog:  Allows simplified writing to activity log file.  Stamps
  395.                 the date and time and appends a CR/LF to the argument
  396.                 and writes it to the logfile (if opened).  Writes entry
  397.                 only if variable 'loglvl' is equal to or greater than
  398.                 the verbosity level argument.
  399.  
  400.      ScrDeb:    If log verbosity is set to 4, writes a section and index
  401.                 value in brackets on the screen every time PCBOARD.CMD
  402.                 finds text that it's looping for.
  403.  
  404.      Delay:     Performs delay in number of seconds.  Makes clinking
  405.                 sound with each second.
  406.  
  407.      "And now for something you'll REALLY like!"
  408.  
  409.      I hate to ask for money, so I'm going to DEMAND it instead!  But
  410.      really, this software is delivered under the Shareware premise.
  411.      That is, if it worked and feel happy with what it does for you,
  412.      then you should register it!  At least to pay for all those late-
  413.      night twinkies, if nothing else.
  414.  
  415.      Seriously folks, I didn't do all this just for me.  All the hit-
  416.      and-miss testing cost a few large with NYTEL and AT&T, and I've
  417.      put LOTS of hours and twinkies into making sure it's all as smooth
  418.      and reliable and full-featured as I can make it.  I'd like to
  419.      think that $10 isn't too much to ask, and if you've used QMtoPM
  420.      and/or PrintDir then $15 will register all three programs.  Pretty
  421.      Fair, I think.  Technical support is available through CIS, the
  422.      OS/2 conference on Ilink and SmartNet and via Multi-Net BBS.
  423.  
  424.      Warning!
  425.  
  426.      Violation of the license agreement (as it were) is illegal and
  427.      immoral.  Perpetrators will fall victim to the unbridled wrath of
  428.      the Binary Gods, and their hard disks and CPU's will degenerate
  429.      into smoldering, useless masses of aluminum and silicon.
  430.  
  431.      "Your love gives me such a thrill, but it won't pay my bills..."
  432.  
  433.      Brad Berson
  434.      Psycho Psoftware
  435.      #2 Chaparral Road
  436.      Chestnut Ridge, NY  10977
  437.      (212) 887-4216 voice
  438.      (212) 887-2154 FAX
  439.      CIS: 71631,132
  440.  
  441.      The end.
  442.  
  443.