home *** CD-ROM | disk | FTP | other *** search
/ Simtel MSDOS - Coast to Coast / simteldosarchivecoasttocoast2.iso / zmodem / zcommexe.zip / PHOMAST.T < prev    next >
Text File  |  1993-09-21  |  82KB  |  1,524 lines

  1.  
  2.   PHOMAST.T  [Version 6.4a]                                  Michael R. Ash
  3.   Revised  to YAM/ZCOMM Version 17.70+                       15 March 91
  4.   Revised 17 Jun 92 CAF
  5.  
  6.  
  7.   This is the latest in a series of updates to PHOMAST.T scripts designed
  8.   to get you up and running utilizing the power of Professional-YAM or ZCOMM.
  9.   For performance and clarity I have moved my opening remarks and instructions
  10.   about setting up this script to a separate file called: -> PHOMAST.DOC <-
  11.   New features of this update include fully automated menu configuration,
  12.   autospeed detection, and lots of slick coding examples...
  13.  
  14.   When run for the first time this script will generate a new file called
  15.   'PROFILE.DAT' containing specific configuration information that in the
  16.   past you used to have to know and write into the script with an editor
  17.   in advance before using YAM or ZCOMM.  This file, 'PROFILE.DAT', if present
  18.   is loaded every time YAM/ZCOMM is run and defines your generalized defaults.
  19.   I have included comments everywhere to help you understand the fascinating
  20.   and comprehensive script language included in YAM and ZCOMM.  Any information
  21.   that follows a colon (:) mark is not read by YAM or ZCOMM since it is taken
  22.   as a comment.  When you are instructed to uncomment a line it means to load
  23.   the script into an editor and delete the colon at the start of the line so
  24.   the program can use it.
  25.  
  26.   When ZCOMM is loaded it looks in the \ZCOMM subdirectory for a file called
  27.   PHOMAST.T  -=-  When YAM is loaded it looks in the root for a file called
  28.   PHONES.T (you could rename PHOMAST.T to PHONES.T and put it in the root
  29.   but there are a couple of better ways to handle this). The simplest and
  30.   most flexible method is to use the DOS 'set phones' command (shown below)
  31.   to tell YAM/ZCOMM where to find its phones file.  Another method is to
  32.   have PUTSNP.EXE (the serial number installing routine) change the default
  33.   location of the phones files.
  34.  
  35.                          set PHONES=c:\yam\phomast.t
  36.  
  37.   The line above can be added to your AUTOEXEC.BAT file to tell YAM where
  38.   to look for its phones file.  ZCOMM users won't need to use this line
  39.   unless they want to have PHOMAST.T in another directory since it is already
  40.   the default location for ZCOMM.  The phones file (PHOMAST.T) gives YAM/ZCOMM
  41.   directions on how you want the package to operate.
  42.  
  43.   For those of you that haven't heard of YAM, it's the short name for
  44.   Professional-YAM, a commercial package that includes all of ZCOMM (its
  45.   shareware subset) plus advanced capabilities for professional tele-
  46.   communications requirements.
  47.  
  48.   Dialing entries can be placed anywhere in the script but since the script
  49.   is read from the top down, entries placed near the top will be found first.
  50.   A simple dialing entry is usually one line as below, with the label
  51.   starting in column 1.  Using the command 'call pcmag' will cause the
  52.   following.  The old line will be 'hung-up', speed will be set to 2400 baud,
  53.   number dialed, then Error correction turned on and terminal mode entered
  54.   in 8 bit graphics format.  Just copy this line, make a new label, add a
  55.   new number and you're all set with a new phone directory entry...
  56.  
  57. pcmag   sp 2400   1-212-503-5255 ena -E;t -8g    :PC Magazine BBS
  58.  
  59.                         ------------------------------
  60.  
  61.   I have tried to make this script as perfect as possible but like most
  62.   things in life there are no guarantees that I found everything.  I wish
  63.   you the best of luck with YAM or ZCOMM.  Please let me know if you run
  64.   into problems...
  65.  
  66.   I have spent hundreds of hours over many years on this script to make
  67.   ZCOMM or YAM useful to new users right out of the starting blocks.  If
  68.   this has helped you get a better grasp of the package I would like
  69.   to hear from you.  If this really made a difference, and you think my
  70.   time is was well spent, throw a couple bucks my way and I will go out
  71.   for a taco...
  72.  
  73.   Whatever you decide, I would appreciate a postcard, just to get an
  74.   idea who this script finally reached...
  75.  
  76.                                             Michael Ash
  77.                                             POB 231323
  78.                                             Encinitas CA 92023-1323
  79.  
  80.  
  81.                       ---------- Have Fun ----------
  82.  
  83.  
  84. ::----------------------------------------------------------------------------::
  85.  
  86.          -- Special AutoSense Dialing Script with speed fallback --
  87.  
  88.   Below is specialized code you don't need to concern yourself with.  If you
  89.   want to change the default menu colors or the initial generic modem string,
  90.   search for the character <*> to direct you to those parts of the code. Again
  91.   this is optional since 95% of the users out there will be able to use the
  92.   script as is.
  93.  
  94.   The dial routine below replaces internal YAM/ZCOMM carrier detect code...
  95.   This dialing routine is called by the first line in 'setup' section of code
  96.   by the command:  set mcommand "gosub dial"
  97.  
  98.   Calls you make with your modem at 2400 baud that connect to 2400, 1200,
  99.   or 300 baud modems on the other end will automatically change your modem
  100.   speed to match.  It is IMPORTANT to give Xn value in modem setup string the
  101.   highest number available to insure your modem answer using full words, not
  102.   just codes...
  103.  
  104.   To manual dial a voice call use construct: 'xxx-xxxxxv' where 'xxx-xxxx'
  105.   is the phone number you want to call from the command line followed by the
  106.   letter 'v'.  If you need more complex dial routines for mnp and high speed
  107.   modems see 'mm224' label under PHONES.T provided with Professional-YAM or
  108.   download SCRIPTS.ZOO from the scripts subdirectory on Telegodzilla, the
  109.   YAM/ZCOMM support BBS.
  110.  
  111. dial    pat     :Clear old patterns
  112.  
  113.         if "%telno<2" echo "\n\nPhone number must be at least 2 numbers\n\n"; return
  114.         bye                   : %telno is string containing phone number
  115.     sleep 10
  116.  
  117.         if "%mprefix<2" goto mandial   :If no modem prefix defined (e.g. ATDT)
  118.                                        :This allows for manual phone dialing.
  119.         pat 0c "v"                     :Search for "v" voice call
  120.                                        :Below list possible messages from modem
  121.         pat 1 "CONNECT\r\n"  ; pat 2 "NO CARRIER" ; pat 3 "BUSY" ; pat 4 "RING"
  122.     pat 5l "CONNECT 1200" ; pat 6l "CONNECT 2400" ; pat 7l "9600" ; pat 9 OK
  123.  
  124.         ena -d      :disABLE carrier lost message (ver 17.04+ not needed)
  125.         put %mprefix; putw %telno\r    :Send dial prefix (e.g. ATDT) and phone #
  126.  
  127.         if !0  goto nov :Skip instruction if not a voice call (eg not a ';')
  128.         echo "\n\n\n\n\n\t\t\t Voice Calling in Progress...\n\n"
  129.         echo "\t\t    >>> Once phone ringing Hit RETURN <<<\n\n"
  130.         if y bye ; return        :once key hit, hang up modem...
  131.  
  132. nov:
  133.         wait -f72
  134.         while "4&&!L>3" wait -f40       :while ringing less then 4 times wait
  135.         if "n||2||3||9" echo "No connection made..." pat; o; fail
  136.  
  137.         while "!c&&L<20"  sleep 1       :wait for slow carrier detect
  138.         if 5 sp 1200 goto gotit         :setup for 1200 baud connection
  139.         if 6 sp 2400 goto gotit         :setup for 2400 baud connection
  140.     if 7 sp 9600 goto gotit         :setup for 9600 baud connection
  141.         if 10 sp 300                    :ugh a 300 baudy line...
  142.  
  143. gotit:  set telno ""                    :erase telephone number from variable
  144.     dis -d
  145.         return
  146.  
  147.         :: If modem prefix string less than 2 characters, Manual dialing
  148.         :: is assumed.  This allows the special case where you may have
  149.         :: to have an operator make the call (or dial manually on phone)
  150.  
  151. mandial:
  152.         : putw "ATZ\r"        :put modem in standard configuration
  153.         echo "\n\n\n     Please dial %telno... \n"
  154.         lput "     Once dialed wait for FIRST RING then hit F1 and hang up the phone!  "
  155.         t             :Put into terminal mode to prepare modem...
  156.         put "ATD\r"   :Force modem to answer
  157.         echo "\nIf you want to have MODEM do the dialing hit Shift-F6 and change option...\n"
  158.         return
  159.  
  160.  
  161. ::
  162. :: Advanced Dial shell  Rev 5-8-91
  163. ::
  164. ::  String vars: s0: original speed   s1:non empty to lock interface speed
  165. ::    s2: Current dial option   s3:Current telno
  166. ::      s4: Remaining alternate telnums    s5: provisional speed
  167. ::    s8: Result string from modem    s9: empty means no connection
  168. ::
  169. ::    Bypass fail command if called as gosub adial,nofail
  170. ::
  171.  
  172. :: Call modem specific init routine
  173. initmodem
  174.     sets s0 %args
  175.     gosub init.%lib/%MODEM
  176.  
  177. adial    
  178.     set s8 "h/w"; set s9 "port"
  179.     if "itelno,1" if dX echo "Vritual Channel 1"; return
  180.     if "itelno,2" if dX echo "Vritual Channel 2"; return
  181.     if "itelno,3" if dX echo "Vritual Channel 3"; return
  182.     if "itelno,1" port 1;  set dirrx "";  echo "Port 1"; return
  183.     if "itelno,2" port 2;  set dirrx "";  echo "Port 2"; return
  184.     set s8 ""; set s9 ""
  185.     if "%telno<2" echo "Please do not use \"call adial\""; abort
  186.  
  187.     set? s0 S;  sets s4 %telno
  188. adia2:    split s4 "+" ""; sets s4 %z1; sets s3 %z0
  189.     set s1 ""; split s3 "/" ""; sets s3 %z0; sets s2 %z1
  190.     handshake sw;  pat;  sets s5 "%s0"
  191.     echo "PORT = %dport  MODEM = %MODEM  modifier = %s2"
  192.     if js2,mnp set s1 "mnp"
  193.     if js2,_s set s1 "_s"
  194.     if js2,lock set s1 "lock"
  195.     if js2,1200 sp 1200; set s5 1200
  196.     else if js2,300 sp 300; set s5 300
  197.     else if S==450 sp 300 echo "300 bps"
  198.     else if !%s1 if "S<9500&&S>1201" sp 2400 echo "2400 bps"
  199.     if !dv bye
  200.  
  201.     :: set up for modem specific dialnum routine
  202.     set s8 ""; set s9 ""
  203.     gosub dialnum.%lib/%MODEM
  204.     pat;  if %s9 goto adiend
  205.     if %s4 echo "Attempting %s4";  speed s0;  goback adia2
  206.     bye; bye; if "!jargs,nofail" fail
  207.  
  208. adiend:    sets telno %s3        : Telephone number we connected to
  209.     if !js2,nodel queue delete
  210.     if dl<2 echo "Please type t<Enter> to enter terminal function."
  211.     return
  212.  
  213.  
  214. ::----------------------------------------------------------------------------::
  215. ::                                                                            ::
  216. ::              >>>  This SETUP script is where it all begins <<<             ::
  217. ::                                                                            ::
  218. ::      In both Professional-YAM and ZCOMM "setup" is the first subroutine    ::
  219. ::      executed.  In a departure from the standard PHONES script, this       ::
  220. ::      version of the phones file actually looks for another file called     ::
  221. ::      PROFILE.DAT where specific setup information is stored.  If this      ::
  222. ::      file doesn't exist, this script will actually write the code.  This   ::
  223. ::      allows for easy menu modification of things like PORT number and      ::
  224. ::      Dialing Prefix.  Once an entry is made using the menu, a new          ::
  225. ::      PROFILE.DAT file is written to disk and used in the future to load    ::
  226. ::      saved setup information.  The examples assume the modem responds      ::
  227. ::      to the HAYES command set and either COM1 or COM2 connected to a       ::
  228. ::      modem.  Others can modify the script for their application...         ::
  229. ::                                                                            ::
  230. ::      This allows for easy setup modification without the use of an editor  ::
  231. ::      to change configuration information -=- especially useful to laptop   ::
  232. ::      users out there who may need to quickly change dialing configuration  ::
  233. ::      while on the road.  Setup code has been moved to the bottom of the    ::
  234. ::      script since it is run only once at startup...                        ::
  235. ::                                                                            ::
  236. ::----------------------------------------------------------------------------::
  237.  
  238. setup:  lput "\r\n\n...working\r\n\n"  goto do_it    :skip to 'setup' code
  239.  
  240.  
  241. ::============================================================================::
  242.  
  243. ::     --- Some San Antonio Bulletin Boards using simple Phone Directory ---
  244. ::     Remember if you are out of the area you must add (512) area code...
  245.  
  246. apco24     speed 2400  496-5558 ena -E;t -8g  :membership board #
  247. apco12     speed 1200  496-5558 ena -E;t -8g
  248. public     speed 1200  434-1557 ena -E;t -8g  :APCO public BBS
  249. chess      nolog speed 1200 494-5478 ena -E;t -8g  :Chess BBS
  250.  
  251. ::  Note to users -- Some of the above San Antonio bulletin boards operate
  252. ::  at speeds higher than 1200 baud.  If you have a 2400 baud modem, just
  253. ::  edit the 'speed 1200' to read 'speed 2400' as appropriate in the above
  254. ::  directory.  Want to add other favorites?  Just add them in with an ASCII
  255. ::  text editor using the above as example entries.  It's easy!  AreaCode=512
  256.  
  257. ::  To call one of these just give the command 'call buerg' for example...
  258.  
  259. ::                     --- Some Classic BBS systems ---
  260.  
  261. buerg24    sp 2400   1-707-778-8944 ena -E;t -8g    :Vern Buerg's BBS
  262. buerg12    sp 1200   1-707-778-8944 ena -E;t -8g
  263.  
  264. qedit      speed 1200 %l,404-296-9681 ena -E; kill :QEdit Sammy Mitchell (area 5)
  265.            restime; create -S+ %tmp\qedt%d.log ; t -8g
  266.  
  267. virusinfo  sp 2400 %l,408-988-4004 ena -E;t -8g  :John McAfee Viruscan -voice 408-988-3832
  268.  
  269. ::               -=- End of simple phone directory entries -=-
  270. ::  ---------------------------------------------------------------------------
  271.  
  272. menu:  cls                  :On screen Menu Generation...
  273.   set n9 "Pro-YAM"; if dS set n9 " ZCOMM "
  274.  
  275.   echo "                   >>>  %n9 Function Key Menu  <<<                          "
  276.   echo "  Alt-N  EMERGENCY EXIT, 'Nuke It' to get out of trouble/escape a command       "
  277.   echo "                                                                                "
  278.   echo "  F1  Exit Circular Buffer            F2  Enter Circular Buffer                 "
  279.   echo "  F3  OPEN Capture file               F4  Send ASCII Text                       "
  280.   echo "  F5  Send Kermit Upload              F6  Send Zmodem Upload    <<BEST>>        "
  281.   echo "  F7  Receive CrcXmodem Download      F8  Send CrcXmodem Upload                 "
  282.   echo "  F9  Press for THIS HELP SCREEN      F10 Online Manual                         "
  283.   echo "  Alt-1  Get DOS Command prompt       Alt-2  Get %n9 Command prompt         "
  284.   echo "                                                                                "
  285.   echo "  sF3  Holds you on-line...           sF4  Use Turbolearn Script Writer         "
  286.   echo "  sF6  Change YOUR defaults           sF7  Dialing Menu example                 "
  287.   echo "                                                                                "
  288.   echo "  aF1  AutoLog B&F Tech BBS (2400B)   aF2  AutoLog Olde Guard BBS (1200B)       "
  289.   echo "  aF3  CLOSE Capture file             aF4  CIS DEMO at 1200 baud                "
  290.   echo "  aF5  Call PC Magazine's BBS         aF6  Enter HOST MODE operation            "
  291.   echo "  aF7  Sign name on-line...           ALT-F9  Edit PHOMAST.T script             "
  292.   echo "                                                                                "
  293.   echo " TO CALL OTHER BBSs: enter 'call name' where name is a label -=- LD service \45l, "
  294.   echo "    >>To DIAL A NUMBER just enter number followed by ;t  (e.g. 523-8994;t)<<    "
  295.   echo "       -- CompuServe-B, KERMIT, and ZMODEM download automatic --                "
  296.   echo "  Stop Redialing ---- press <CR>      Hangup w/o pgm exit  - enter 'o'          "
  297.   echo "  PgUp into Buffer; <CR> to return    -> EXIT hit F1 then -- enter 'off'        "
  298.   return
  299.  
  300.                           --------------------------------
  301.  
  302. capture:                      :called by F3 to generate capture file...
  303.         acceptl1 s1 "\r\n\n\t Do you want to save what has already past as well (Y/n)? "
  304.         if is1,n  kill      : kill old buffer and start new...
  305.         accept s1 "\t Enter name of Capture File: " create -S+ %s1 lput "\r\n"
  306.         return
  307.  
  308. ::                              ---------------------
  309.  
  310.         Here is a slick way to stay on-line in systems that will log you
  311.         off if you don't hit the keyboard...  Below is an example of how
  312.         to use text positioning (Now Active) to make this happen.
  313.  
  314. hold:   lput "\E[s\E[f\E[33m"  :save cursor position, move to top line, change color
  315.         lput "══════════════════  \E[3m\E[5mHOLDING...\E[0m\E[33m Press SPACE-BAR to continue!  ═════════════════\E[0"
  316.         lput "\E[u"     :restore cursor to line where it was called
  317.  
  318.         :: The line below sends to remote what ever is stored in variable s8
  319.         :: (usually space,BS define at 'setup') until a key is hit (!k). It
  320.         :: allows you to modify what is sent to remote to hold.  For example
  321.         :: on a VT emulation you would use set s8 " \177" for space, backspace/
  322.         :: delete.
  323.  
  324.         while "!k" putw %s8  sleep 20   :While no keyhit keep adding chars
  325.  
  326.         lput "\E[f"     :put cursor on top line
  327.         lput "\E[33m════════════════════════════════  ON-LINE  ═══════════════════════════════════\E[0m"
  328.         lput "\E[u"     :restore cursor to line where it was called
  329.  
  330.         return          :return to calling code
  331.  
  332.  
  333. ::----------------------------------------------------------------------------::
  334. ::                     --- Color Generation examples ---
  335. ::     To see this just give the command 'gosub color' from the prompt...
  336.  
  337. color:
  338.      cls; echo "\n\t\t\t\E[32m\E[41m >>> ANSI Color Calls <<< \n"
  339.      echo "All that is required is you precede the text you want in color with \\E[xxm."
  340.      echo "For example: { echo \" This is \\E[32mGREEN\\Em\" } will make GREEN green.\n"
  341.      echo "Foreground:\n"
  342.      lput "\E[47m\E[30m\\E[30m\E[40m  \E[31m\\E[31m  \E[32m\\E[32m  \E[33m"
  343.      lput "\\E[33m  \E[34m\\E[34m  \E[35m\\E[35m  \E[36m\\E[36m  \E[37m\\E[37m"
  344.  
  345.      echo "\n\nBackground:\n"
  346.      lput "\E[40m\\E[40m \E[30m\E[41m \\E[41m \E[42m \\E[42m \E[43m \\E[43m "
  347.      lput "\E[44m \\E[44m \E[45m \\E[45m \E[46m \\E[46m \E[47m \\E[47m \n\n"
  348.  
  349.      echo "Modifiers (primary here is green):\E[32m\n"  :Switch foregrd back to green
  350.      lput "\E[0mReset,  Bold, Faint, Italics, Underline,    Blinking,"
  351.      lput "    Reverse, Invisible\n\r"
  352.  
  353.      lput "\E[0m\\E[0m   \E[1m\\E[1m \E[2m\\E[2m\E[0m   \E[3m\\E[3m\E[0m     \E[4m\\"
  354.      lput "E[4m\E[0m    \E[5m\\E[5m or \\E[6m \E[0m  \E[7m\\E[7m\E[0m     \\E[8m"
  355.  
  356.      echo "\E[36m\E[22f\t\t   Notice \\E[22f puts cursor on 22rd line...   \E[23f"
  357.  
  358.      lput "\t\t\t  Hit Any Key to continue..."
  359.      ife y  ;          :basically a no-op wait for keystroke (nul else nul)
  360.  
  361.      cls; echo "\E[21f\t\t\t>>> All Numeric Color Calls <<<"
  362.      set s0 0
  363.      p#255; p$5; cls; display noautowrap
  364.      while L<129 obey "pn%s0" lput "\E[m %s0  \r\n" setn s0 s0+1
  365.      pn130; p$80; p#24; lput "\E[10;H\E[m"
  366.      pn1055; lput "\n\t\t\t\E[mFor \E[5mBLINKING\E[m text just add 128\r\n\n"
  367.      lput "\t  Possible colors for: *, @, n, r, s and u Numeric Parameters\r\n"
  368.      lput "\t  where: *=highlite (color shown when text in circular buffer is\r\n"
  369.      lput "\t  marked), @=messages, n=normal text, r=reverse, s=status, u=underline."
  370.      lput "\r\n\n\t  Use these number in the following format 'px#', where x is the\r\n"
  371.      lput "\t  parameter choice (e.g. n,r,s etc.) and # is the color number\r\n"
  372.      lput "\t  above... For example pn2 give light green color to normal text.\n\n\n\n\r"
  373.      return
  374.  
  375. :==============================================================================:
  376. :                      --- Auto Logon Examples --                              :
  377.  
  378. bnf : Autolog onto the Back and Forth Technical Support BBS.  This is a
  379.     : board I talk to more than all others.  This programming below
  380.     : demonstrates an example of an autolog script for WildCat BBS.
  381.  
  382.     : Comment in the line below once you have a password, if you want to enter
  383.     : it and not have it done automatically...
  384.  
  385.     : cls; accept s1 "\E[21f\E[36m\t\t\tEnter your Password now: \E[8m"
  386.  
  387.     cls ;  echo "\n\n\t\t   Calling B&F Support (Line 1)...  TURBO Mode \n"
  388.     echo "\t\t       -- If no answer try 'call bf2' -- \n\n"
  389.     lput "\t\t Are you calling from the San Antonio Area (y/N)? "
  390.     ife y nolog lput "\r\n\n" speed 2400 670-0954 ena -8g goto go; else lput "\r\n\n"
  391.     speed 2400 %l,512-670-0954 ena -8g     :Default of long distance call...
  392.                                            :Note %l, for long distance prefix
  393.  
  394.     goto go   : The 'nolog' command above will prevent local call logging to
  395.               : the 'calllog' file.
  396.  
  397. bf2 cls; echo "\n\n\t\t   Calling B&F Support (Line 2)...  TURBO Mode \n\n"
  398.     lput "\t\t Are you calling from the San Antonio Area (y/N)? "
  399.     ife y nolog lput "\r\n\n" speed 2400 670-1809 ena -8g goto go; else lput "\r\n\n"
  400.     speed 2400 %l,512-670-1809 ena -8g   :Long Distance using %l, service
  401.  
  402. go: cd %tmp        : UNCOMMENT NEXT LINE once you have a password defined...
  403.     : lput "\n\n\n Please Standby...  "; display inhibit
  404.     : pat 5ci "N]on"  "n"     : Watch for N]onStop incase it's there...
  405.  
  406.  
  407. ::  Note you will have to log-on manually first to get a password on this
  408. ::  system.  Since you don't have a password assigned, the line below
  409. ::  skips the rest of the auto log-on and hooks you to this BBS.
  410. ::  When you have a name and password, add them in the 'putw' statement
  411. ::  BELOW and DELETE (or comment out) the NEXT line and uncomment
  412. ::  lines above ('lput "\n\n\n Please Standby..." and 'pat...')
  413.  
  414.          goto bv  :just put to codeset that watches for carrier...
  415. ::       ^^^^^^^^^:delete this after name/password loaded below!
  416.  
  417.  
  418.     pat 1i "Name? " ; wait; put "PUT YOUR LOGIN NAME HERE\r"
  419.     pat 1i "word: " ; wait; put "PUT YOUR PASSWORD IN HERE\r"
  420.     :  pat 1i "word: " ; wait; put "%s1\r"  :if you used passwd prompt above
  421.  
  422.     display noinhibit; lput "Account verified...  "; display inhibit
  423.     pat 1i "    " ; wait; put " "
  424.     pat 1i "[y/N]" ; wait; put "n"
  425.  
  426.     display noinhibit; lput "Login Complete... \n\n "
  427.  
  428.     ::                    >>> Alarm Section <<<
  429.  
  430.     display nobell=visual               :Turn bell back ON
  431.     lput "\r\n\n\t\t  Hit *BACKSPACE* key to \E[3m\E[5mSTOP\E[0m alarm..."
  432.     sleep 30                 :Give 3 seconds for response before alarm
  433.     while "!k&&L<20" lput "\7\7"        :For 20x and While nokey, make noise
  434.     if k goto bv                        :If keyhit then skip next call
  435. bv: : cls
  436.     :: display bell=visual                 :quiet bell
  437.     pat                                 :clear patterns
  438.     pat 1i "Thank you for calling"      :watch for goodbye from BBS
  439.     pf3                                 :set check wait for 3 second
  440.     while "!1&&c" wait                  :while carrier present wait here
  441.     echo "\n\n"
  442.     return
  443.  
  444. :            --- An example of a TComm BBS that has ZCOMM users ---
  445.  
  446.  
  447. oldguard  cls; echo "\n\t\t       Now calling Olde Guard at 1200 Baud \n\n"
  448.  
  449.           : Note I have default from menu to call at 1200 - just change
  450.           : entry for 'set fa2' to oldg24 if you want 2400 by default.
  451.  
  452.           ena -E -Z -8g                 :enaBLE Error ck, auto d/l, w graphics
  453.           nolog; speed 1200             :turn off log and set speed 1200 baud
  454.           goto number                   :Skip 2400 baud dial
  455.  
  456. oldg24    cls; echo "\n\t\t       Now calling Olde Guard at 2400 Baud \n\n"
  457.           ena -E -Z -8g                 :enaBLE Error ck, auto ZModem w graphics
  458.           nolog; speed 2400             :turn off log and set speed 2400 baud
  459.  
  460. number:
  461.           lput "\t\t Are you calling from the San Antonio Area (y/N)? "
  462.           ife y nolog lput "\r\n\n"  684-4470 ena -8g goto go; else lput "\r\n\n"
  463.           %l,512-684-4470               :Long distance  (outside San Antonio)
  464.                                         :Note the %l, selects Long Distance service
  465. go:       cls
  466.           : echo "\E[34m\n\n\t\t >>> Welcome to Olde Guard BBS -- Please standby <<<"
  467.           : display inhibit             :turns off display for opening setup...
  468.                                         :(use this to not show opening screens)
  469.           ena -E -Z -8g                 :enaBLE Error ck, auto ZModem w graphics
  470.           pat; pat 1i "ENTER"           :Clear patterns and look for ENTER
  471.           wait                          :Wait for pattern
  472.           : put "\rn\ry\r\r"              :REQUEST graphics and color
  473.           put "\r\r\r"                  :SKIP graphics and color
  474.           restime                       :Reset status clock  (Yam Only)
  475.           pat 1i "right (y/N/why)?"
  476.           wait                          :wait for tcomm...
  477.           : display noinhibit           :turn display back on if off
  478.           : pat 1i "~~"; wait           :Watch and for opening screen
  479.           : put "\013"                  :Once found Ctrl-K out of it...
  480.           pat 1i "ast name: "           :Look for log in prompt
  481.           wait                          :Wait until prompt occurs
  482.  
  483. ::        Note you will have to log-on manually first to get a password on Olde
  484. ::        Guard...  Since you don't have a password assigned, the line below
  485. ::        skips the rest of the auto log-on and hooks you to the BBS.
  486. ::        When you have a name and password, add them in the 'putw' statement
  487. ::        BELOW and DELETE (or comment out) the NEXT line...
  488.  
  489.           goto bv  :just put to codeset that watches for carrier...
  490. ::        ^^^^^^^^^:delete this after name/password loaded below!
  491.  
  492.           putw "FIRST LAST NAME\rPASSWORD\r"     :Enter name / password
  493.  
  494. ::        --- Note comment out next four lines if you want bulletins ---
  495.           pat 2i "=="              :Look for bulletin menu if turned on
  496.           wait                     :wait until found...
  497.           put \013                 :Ctrl K to skip this menu
  498.           put "q\rm\r"             :Drop to mail menu level to prevent timeout
  499.  
  500. ::                            >>> Alarm Section <<<
  501.  
  502.           display nobell=visual           :Turn bell back ON
  503.  
  504.           lput "\r\n\n\t\t\E[33;1m  Hit *BACKSPACE* key to \E[5;31mSTOP\E[0;33m alarm..."
  505.           : lput "\r\n\n\t\t  Hit *BACKSPACE* key to STOP alarm..." :no ANSI
  506.  
  507.           sleep 30                        :3 sec for response before alarm
  508.           while "!k&&L<20" lput "\7\7"    :For 20x and While nokey, make noise
  509.           if k goto bv                    :If keyhit then skip next call
  510.  
  511. ::        Put other DOS noise making program here if you wish, for example
  512. ::        !sound  (note the '!' will execute DOS programs from inside script)
  513.  
  514. bv:       : cls
  515.           :: display bell=visual                :quiet bell
  516.           : put "r\r"                        :Prepare to read mail. (off now)
  517.           pf30                               :Reset search wait (30 sec)
  518.           kill                               :Clear circular buffer
  519.           restime                            :Reset the timer (YAM only)
  520.           :  create -S+ %tmp\mail%d.log      :Strip all ANSI, append date file
  521.              ::^If today was 5/25/90 this makes a file in c:\tmp
  522.              :: called mail0525.log -- If you need to use a DOS program on
  523.              :: this filename use the syntax @!% [DOS program] mail%d.log
  524.              :: to force YAM/ZCOMM to fill in the date before passing to DOS
  525.  
  526.           : cd %tmp                          :Change directory to d/l area
  527.  
  528. ::        Three lines below show how to check for connection to host system
  529. ::        every 3 seconds.  Once connection is lost you are returned to YAM
  530. ::        command-line.  This is a useful piece of code if you wanted to have
  531. ::        a call placed from a DOS menu and return to DOS menu when the call is
  532. ::        completed.  If this is the case you would replace 'return' with 'off'
  533. ::        and have YAM/ZCOMM return to DOS after this call is completed.
  534.  
  535.           pf3                 : set pattern fail time to 3 seconds
  536.           while c wait        : While connected just wait here...
  537.           return              : once no carrier, return to command line.
  538.  
  539.  
  540. :---------------------------------------------------------------------------:
  541. :           --- Example of an auto logon script for CompuServe ---          :
  542.  
  543. cis       cls           :Note -- CIS access number for SAN ANTONIO, TX
  544.                         :You will need to modify for your local CIS number...
  545.           echo "\t Now accessing CompuServe at 2400 baud using the SA Texas number\n\n "
  546.           speed 2401 239-6124     :Odd number, 2 stop bits, error trap
  547.           goto cislog             :Goto logon section of CIS script
  548.  
  549. cis12     cls; bye; echo "\t Now accessing CompuServe at 1200 baud using the SA Texas number\n\n "
  550.           speed 1200 435-3883     :local San Antonio TX access number...
  551.  
  552. cislog:   sleep 20                            :Sleep for 2 seconds
  553.           ena -E -7e   : put into Error correcting 7 bit, even parity...
  554.           echo ""; echo "Sending ^C"; put \3  :Send Ctrl-C, echo doing it.
  555.           pattern 1i ID:                      :Wait for ID
  556.           wait                                :"i" causes immediate release
  557.           putw "77770,101\r"                  :Enter Account (can be yours)
  558.           pat 1i word:                        :Wait for password prompt
  559.           wait
  560.           putw "FREE-DEMO\r"                  :Enter password for demo...
  561.           pat 1i "word" ;wait
  562.           put "%s1\r"
  563.           cls;  echo "\n\n\t\t\tStandby for CIS to finish logon..."
  564.           pat 1i ompu
  565.           wait
  566.           restime                             :Reset YAM status timer
  567.           putw "\20"; cls                     :Hit ^P to skip menu (\20 = ^P)
  568.                                               :Next line skips interrupt display
  569.           pat 1i "." ; wait; cls; lput "\r\n\nChoice: "
  570.           :  create -S+ %tmp\cis.log          :Setup appended capture file
  571.           :  cd %tmp                          :Change directory to d/l area
  572.  
  573.           :Set: fULL duplex, B proto, strip ctrl char, don't pAUSE for {CR}
  574.           ena -fcs!p
  575.           kill                                :Kill initial login text
  576.           restime                             :Reset status timer (yam only)
  577.  
  578.           while c wait                        :while carrier present wait here
  579.           : w; close                          :Write then close capture file...
  580.           echo "\n\n"                         :This will put you back at the
  581.           return                              :command line once off line...
  582.  
  583.                  ----------------------------------------------------
  584.  
  585. telegodzilla           : Omen Technology (YAM/ZCOMM Upgrade BBS)
  586.                        : just give the command  'call -99 telegodzilla'
  587.  
  588.      pat 9 K\r\n; ena -d; cls          : Ck for OK, disable carrier lost message
  589.      putw "ATS7=100\r" ; wait -f1      : Change wait for connect to 100 sec
  590.      cls; echo "Demand Upgrade(TM): Omen Technology's TeleGodzilla system\n\n"
  591.      accept s7 "Please enter your LAST name: "; accept s6 "First name: "
  592.      :  set s6 "FIRST_NAME" ; set s7 "LAST_NAME" :Fill in and you can comment
  593.                                                  :out accept above and use this
  594.      speed 2400 %l,503-621-3746       :Call using phone account in '%l'
  595.      : speed 2400 1-503-621-3746      :Call using 1-503-621-3746 service
  596.      restime; kill                    :Reset time and Kill buffer
  597.      display overstrike; cls; pat 1 "ease:"; wait -f4
  598.      if "c&&!1" put "\r"; wait -f8
  599.      : if !1||!c echo "Access Failed"; o; fail
  600.      put "\b\b%s6 %s7\r"; pat 1 ect;wait -f2
  601.      put "y"; pat 1 "-Host"; wait -f5
  602.      : !sound  TeleGodzilla is on-line :uncomment if you have external alarm
  603.                                        :program (this one calls sound.exe)
  604.      cd %tmp
  605.      create -S+ %tmp/tele%d.txt        :Strip all ANSI, append to dated file
  606.      : sz -Z [filespec to upload]      :example of how to force file upload
  607.  
  608.      ::  If you uncomment one of the below you can select a file auto-download
  609.      : zcommand "sz -n upgrade/yam.eqe upgrade/newest.meq upgrade/read.meq"
  610.      : zcommand "sz -n upgrade/newest.meq"
  611.      : zcommand "sz -n answer"
  612.      : zcommand "sz -n rzsz*.* upgrade/newest.meq"
  613.      : putw "bye\r"; o
  614.      t -8g      :force terminal mode...
  615.  
  616. upgrade    speed 2400 %l-503-621-3746 t  :no frills calling telegodzilla
  617.  
  618. :                     --- End of Auto Log Examples ---                        :
  619. :=============================================================================:
  620.  
  621. ::         Generate a script with TurboLearn Script Writer(TM)
  622. ::                    Hit Shift-F4 to start this...
  623.  
  624. tlearn    set fc10 "" :: telephone number, and flag that telno was entered
  625.      if c goto connected
  626.      cls
  627.      accept fc10 "Enter Telephone Number "
  628. ag1: accept fa1 "Enter Speed (300, 1200, 2400) "
  629.      if ifa1,2400 speed 2400 goto ag2
  630.      if ifa1,1200 speed 1200 goto ag2
  631.      if ifa1,300 speed 300 goto ag2
  632.      echo "Bad speed"; goback ag1
  633. ag2: lput "\r\n1 - System uses IBM PC (ANSI) line drawing characters\r\n"
  634.      lput "2 - System uses 7 bits even parity\r\n"
  635.      lput "3 - System uses 8 bits No parity (8n1)\r\n"
  636.      lput "\r\n"
  637.      acceptl1 fa2 "Choose one of the above: "
  638.      lput "\r\n"
  639.      ena -8n
  640.      @%fc10
  641.      if !c echo "Sorry, no connection"; return
  642.      set fa5 ""
  643.      if ifa2,1 ena -8g; set fa5 "ena -8g"
  644.      if ifa2,2 ena -7e; set fa5 "ena -7e"
  645. connected:
  646.      echo "Finish with F1.  Use ALT-B to send a break if necessary"
  647.      learn -y tlrn.tmp
  648. cn2: if !r echo "WARNING: Learning (recording) terminated prematurely!"
  649.      close
  650.      kill
  651.      create newscr.t
  652.      if !r abort
  653.      echo "Is this to become a Telephone Directory entry (y/n)?"
  654.      if !y goto nodir
  655.      accept fa6 "What directory entry name to use? "
  656.      echoc "%fa6    speed %fa1 %fc10 %fa5"
  657. nodir:    close;  set fa2 ""
  658.      echo "Should the script disconnect the phone line (y/n) ?"
  659.      if !y "!tlearn tlrn.tmp >>newscr.t"; goto scdone
  660.      set fa2 "bye;  return"
  661.      echo "Should the script then exit to the Operating System (y/n)?"
  662.      if y  set fa2 "off"
  663.      !tlearn -r tlrn.tmp >>newscr.t
  664.      create -+ newscr.t; echof "   %fa2";  close
  665. scdone:   echo "Your new script is in the file 'newscr.t' !!"
  666.      if %fc10 echo "You may add this file to your Telephone Directory"
  667.      if %fc10 echo "Or execute it with 'call %fa6.newscr.t'";  return
  668.      echo "You may execute this file with 'source newscr.t'"
  669.      return
  670.  
  671.  
  672. :=============================================================================:
  673.  
  674. ::                    ---  Using YAM/ZCOMM in HOST MODE  ---
  675.  
  676. ::      Note that for maximum -security- have this section be another file
  677. ::      so users won't see your passwords.
  678.  
  679.  
  680. ::      YAM users can uncomment 'demand %password' line at end of file
  681.  
  682. host    cls; echo " Activating host mode operation...  Stand by!\n\n"
  683.         sp 2400
  684.         : sp 1200                   : use for 1200 baud host modem...
  685.         : set home "/HOST"          : Optional restricted directory
  686.  
  687. ::    The above command can force users into a specific area on disk.  It
  688. ::    CRITICAL you use "/" NOT a "\" in this command.  This will lock users
  689. ::    into that directory and its subdirectories.  If you use this
  690. ::    command, you MUST have your welcome and xhelpfile as a different
  691. ::    file and this file MUST be in the directory specified by the 'set
  692. ::    home' command.  To function it MUST be a READ ONLY file.  You may
  693. ::    use HOSTHELP.TXT for this purpose but it will need to be renamed to
  694. ::    HOSTHELP.T.  Remember you will also need to add some starting
  695. ::    labels and utilize new 'set welcome' and 'set xhelpfile' commands.
  696.  
  697.         set welcome "@gosub welcome.%phones"  : setup Welcome
  698.         set messages "/host/messages"        : setup file for messages
  699.  
  700. ::    Private should set to another directory so people won't see
  701. ::    private messages, since when HOST restricted they can change from %home
  702.  
  703.         set private "/yam/pmessage"         : Setup private message area
  704.  
  705. ::    Normally section below would be in another file so people could NOT
  706. ::    view your passwords.  For testing you can get around this by assigning
  707. ::    your script a READ-ONLY, HIDDEN attributes.  For YAM users wanting to
  708. ::    use the 'demand %password' option, the file CAN NOT have a HIDDEN
  709. ::    attribute so you MUST put this in another directory that users can't
  710. ::    access for protection.
  711.  
  712.         set password "xxxxxxxx"   : CHANGE THIS Access Password
  713.         set unrestrict "xxxxxx"   : WARNING - CHANGE THIS DOS drop PASSWORD!!
  714.  
  715. ::                     -- HOST Helpfile Defined Below --
  716.  
  717.         set xhelpfile "@gosub help.%phones"  : Custom help 17.29+
  718.         : set xhelpfile "@type hosthelp.txt>com1"    : (older versions)
  719.                                            :^^^^ set this for com1 or com2
  720.                                            : Notice this is an EXTERNAL file!
  721.  
  722.         set disks "abc"                    : Setup restricted disk area
  723.  
  724.         set call1 "ATZ\r\336\336ATZ\r\336\336"  :prepare to answer phone...
  725.         set call2 "ATZ\r\336\336ATM1X1S0=1\r\336ATM1X1S0=1\r\336\336"
  726.  
  727.         :       Note 'call3' below would normally be a command that
  728.         :       requires quotes around it, but it includes a quoted string
  729.         :       so you MUST use this alternate form of the set command to
  730.         :       have the actual command start at COL #1 of the next line.
  731.         :                 <<< This works with YAM only...>>>
  732.  
  733.         : set call3
  734. : @echo "\t\t Now awaiting incoming calls... Press F1 to exit.\n\n"
  735.  
  736.         set answerback "\r\nYOUR NAME HERE...\r\n\21"
  737.  
  738.         set outahost "@pk512; putw ATE1V1X1S7=60S8=1S11=50S0=0\r;pwd; gosub menu"
  739.  
  740.  
  741.         set baudstr "@gosub baud"               : sub below to find speed
  742.         pc60                                    : callout interval = 60 sec
  743.         host
  744.  
  745.         :               >>> Check for Caller Speed <<<
  746.  
  747. baud    pat 1 "CONNECT\r\n"; pat 2 "NO CARRIER"
  748.         pat 3 "CONNECT 1200\r\n"; pat 4 "CONNECT 2400\r\n"
  749.         pe-20
  750.         wait -Ef25
  751.         dis -E
  752.         if 1 speed 300 return
  753.         if 3 speed 1200 sleep 20 return
  754.         if 4 speed 2400 sleep 20 return
  755.         kill create -+ rings
  756.         close
  757.         fail
  758.  
  759. welcome:
  760.             :In HOST mode, below is what the user will see on login
  761.  
  762.     echo "                     >>> Welcome to YAM/ZCOMM Host Mode <<<                    "
  763.  
  764.     : demand %password    :YAM users may uncomment to request password
  765.  
  766. ::    The 'demand' command is only available in YAM and NOT in ZCOMM...
  767. ::    If you are using ZCOMM there is no way to restrict initial access
  768. ::    like you can with YAM.  ZCOMM CAN will RESTRICT access to DOS if
  769. ::    user doesn't know the password ...
  770.  
  771. help:       :Note this is also the help message...
  772.     echo "                                                                               "
  773.     echo "        The thing to remember is that when you see the prompt followed         "
  774.     echo "        by [HOST] it is like you are actually sitting at the host              "
  775.     echo "        terminal...  To execute commands on your own YAM/ZCOMM hit F1          "
  776.     echo "        to call your local terminal program...                                 "
  777.     echo "                                                                               "
  778.     echo "        To open access to the complete disk enter the command: UNRESTRICT      "
  779.     echo "        and then use the system password -- otherwise you will remain in       "
  780.     echo "        the C:\\host directory or one of its subdirectories.                   "
  781.     echo "                                                                               "
  782.     echo "        To see the files on the host enter: 'dir' and hit return.              "
  783.     echo "                                                                               "
  784.     echo "        TO DOWNLOAD a file from the host enter 'sz filename' (wildcards OK)    "
  785.     echo "            (Remember this is just like typing at the HOST keyboard...)        "
  786.     echo "                - For XMODEM enter 'sx filename' at HOST prompt -              "
  787.     echo "           - For KERMIT enter 'kermit sb filename' at Host prompt -            "
  788.     echo "                                                                               "
  789.     echo "        TO UPLOAD a file hit F1 to get into your terminal command mode and     "
  790.     echo "        then enter 'sz filename'.  In ZModem everything else is automatic.     "
  791.     echo "        XMODEM enter 'rx filename' or 'rc filename' for CRCX at HOST prompt    "
  792.     echo "        - KERMIT enter 'kermit rb' at HOST prompt then start your upload -     "
  793.     echo "                                                                               "
  794.     echo "        To leave a MESSAGE enter the command 'message' and follow prompts.     "
  795.     echo "          ---> To see this message anytime enter the command 'help' <---       "
  796.  
  797.  
  798. ::-----------------------------  End of Host Mode ----------------------------::
  799.  
  800. ::------------------------------  Start of Setup  ----------------------------::
  801.  
  802.         : This code segment called from 'setup' label... First thing is to
  803.         : test for the existence of 'PROFILE.DAT' the user's default file.
  804.  
  805. do_it:  cd %home        :first make sure you're in the home directory.  There
  806.                         :are lots of variables, %variable_name activates them.
  807.                         :To see the various variables enter 'set' at the DOS
  808.                         :prompt to see DOS environment and 'set' at YAM/ZCOMM
  809.                         :prompt to see the local variables.
  810.  
  811.         if !fPROFILE.DAT gosub make_profile  :If PROFILE.DAT not found make one
  812.  
  813.         : Initialize Shift-F6 early in case fatal error in PROFILE.DAT produces
  814.         : crashed state (as would happen if you copy the PROFILE.DAT to a system
  815.         : with a different configuration and didn't reinitialize).
  816.  
  817.         set fs6  "@gosub reset"   :Resets PROFILE.DAT containing modem dialing info
  818.  
  819.         source profile.dat      :read and activate PROFILE.DAT file...
  820.  
  821.         set mcommand "gosub dial"
  822.         : The above ^ skips internal dial routine allowing for autospeed sense
  823.  
  824.     : set mcommand "gosub adial"        : select advanced dialer
  825.     : if "!%MODEM" set MODEM hu96.t        : for modem specific dialer
  826.  
  827.         ena -d                  :suppress the Carrier Lost msg during setup
  828.         : ena -D                :establishes a 2 second timing loop for line hits
  829.                                 :(use for call waiting where you can't disable)
  830.         : pa4000                :use for clones running 8 MHz and above...
  831.         pd1                     :turn on time stamping
  832.         pi10                    :set redial for 10 seconds...
  833.         : pt4  :default throttle of 20 char/sec (lower is faster) (see F4)
  834.         pT3                     :set histfile to save commands only if 3 char+
  835.         pv-1                    :Verbose OFF (-1 shows none; 50 shows all)
  836.         pz360                   :set CST timezone (could use DOS: set ZONE=360)
  837.         : p-1                   :for those using MKS ToolKit UNIX Shell
  838.                                 :There are many 'p' parameters you can set,
  839.                                 :these are just examples of some useful one.
  840.  
  841. ::      --------------------------------------------------------------------
  842.  
  843. ::      The option below allows you to hit an up arrow key to use past
  844. ::      commands by setting up a history file.  Since all keystrokes are
  845. ::      recorded (including passwords), the 'onexit' command will delete
  846. ::      the history file when you finish your communications session.  Of
  847. ::      course, you could have more protection by writing over the file with
  848. ::      another.  To do this replace the 'del c:\histfile' with something like
  849. ::      '!copy \command.com \histfile'.  This will write over your history file
  850. ::      with a copy of command.com.  Usually this file deletion is adequate.
  851.  
  852. ::      If you don't want to use this history file option just put a ':' in
  853. ::      front of the command since anything preceded by a ':' is considered
  854. ::      to be a comment.
  855.  
  856.         history c:\histfile   : Setup command line buffer (here in root)
  857.  
  858.         : Note the special construct below.  Since there are quotes in the
  859.         : string, it is put on two lines and will delete histfile on exit...
  860.         : The '\n\n\t' string means two Newlines then TAB over a mark.
  861.  
  862.         set onexit
  863. @cls; history; del c:\histfile ; echo "\n\n\t\t\t History file deleted... "; sleep 5
  864.  
  865.         :: display bell=visual   :turns off bell, comment with ':' for bell
  866.  
  867. ::                             --------------------
  868.  
  869.       :  if c goto online          :if carrier detected skip modem setup.
  870.  
  871. ::    The above line allows you to check the carrier status when YAM/ZCOMM is
  872. ::    loaded.  This means you can take full advantage of the eXit to DOS
  873. ::    function.  Anytime you are on-line you can get to the command line by
  874. ::    hitting F1 then enter 'X'.  What this does is unload the communication
  875. ::    program but leaves the modem and serial port active.  Then you have full
  876. ::    access to DOS and can return on-line as long as the host doesn't time
  877. ::    out (while you are working at the DOS prompt).  Once through with DOS,
  878. ::    re-load YAM/ZCOMM like you did initially and WHAM -- you're back on-line
  879. ::    as if you had never left...
  880.  
  881. ::    To activate remove the ':' from in front of 'if c goto online'.  This
  882. ::    will prevent YAM/ZCOMM from reinitializing the modem.  Then continue and
  883. ::    search for the line 'Second part of testing for on-line conditions' and
  884. ::    comment out the command 'fail'
  885.  
  886. ::                         --- Check Modem Status ---
  887.  
  888.       cls;  lput "\r\n\n\n\t\t\t>>> Modem setup in progress <<<\r\n\n"
  889.  
  890. ::    Below is an example of how to use color and graphics (now turned off).
  891.  
  892.         : echo "\n\n\n\t\t    ╓──────────────────────────────────────╖"
  893.         : echo "\t\t    ║ \E[44;1;33m   >>> Modem setup in progress <<<  \E[0m ║"
  894.         : echo "\t\t    ╙──────────────────────────────────────╜\n"
  895.  
  896.         sp 1200                           : Initially set up speed at 1200 baud
  897.         pat 9 K\r\n                       : Check for OK from modem
  898. rc:     put "AT\r"; wait -f3              : Hayes 'AT' then wait up to 3 sec for OK
  899.  
  900.         :   Modems using stored profiles can have initialization done here
  901.         :   by replacing "AT\r" with ATZ0\r".  Remember you first have to
  902.         :   initialize and store modem string before this functions correctly.
  903.         :   "ATZ0\r" recalls Hayes Profile 0 if already defined.  If this
  904.         :   is done you can have the script skip further modem setup strings...
  905.  
  906.         if 9 goto modset                  : If Modem on (OK) skip error msg
  907.         lput "\E[4f                                                        "
  908.         lput "\E[5f\t\t  Please turn your modem OFF then back ON,\r\n"
  909.         lput "                                  - OR -                           \r\n"
  910.         lput "\t\t   Hit SHIFT-F6 to change your setup..."
  911.         sleep 20                          : You get 2 seconds to turn it on!
  912.         goback rc                    : Check modem again...
  913.  
  914.    --------------------------------------------------------------------------
  915.  
  916. :: <*>     --- Some of the common MODEM SETUP commands definitions ---
  917.  
  918. ::  &C1=Data Carrier Detect  &D2=hang up with change in DTR
  919. ::  E1=modem echos commands back to terminal  V1=Word result codes
  920. ::  &W=Save config to nonvolatile memory  L=speaker low
  921.  
  922. ::  X4=Detect dial tones and busy signals; enable extended result codes.
  923. ::     With this activated (default for most modems) status messages are
  924. ::     sent to the screen about modem activity.  English words instead of
  925. ::     number codes are displayed on the screen.
  926.  
  927. ::  S0=answer rings  S6=dial tone wait  S7= wait for connect  S8=pause for ","
  928. ::  S9=Carrier det response  S10=delay carrier lost and hangup  S11=dial speed
  929.  
  930. ::  Remember if your modem doesn't hang up correctly ADD '&D2' to the string.
  931.  
  932. modset:
  933.         putw "AT E1 V1 X1 S0=0 S7=60 S8=2 S11=60 \r" :Normal 1200 baud setup
  934.                                                      :the default setup!
  935.  
  936.         :       -- Line below is an alternate 1200 baud setup command --
  937.         :  putw "AT E1 Q0 S0=0 S6=3 S7=40 S8=2 S10=10 S11=50 V1\r" ; wait -f2
  938.  
  939.         :: -- Line below supports Hayes/Zenith 2400, Compaq LTE/286, NEC Ultra
  940.         :  putw "AT E1 L X4 V1 &C1 &D2 S0=0 S6=3 S7=60 S10=10 S11=60\r"
  941.  
  942.         :  put "AT E0 V1 X4 &D2 \r"           :for Everex 2400 baud
  943.  
  944.         :  putw "AT &C1 &D2 E1 &Q0 L1 S7=100 S11=50 \r" :Simple Hayes V-9600
  945.         ::       ^^ Once stored using ATW0 it's in PROM, ATZ0 below gets it...
  946.  
  947. ::         -- A suggested ZOOM 2400 baud modem setup is listed below --
  948.  
  949.         :  handshake both        : Handshakes both CTS or XOff
  950.         :  putw "AT &C &D2 &L0 C1 X5 S9=5 S10=10 S11=40 S25=0 +Z0=2 +Z3=45\r"
  951.         :  S25 DTR timing to 0 seconds
  952.         :  wait -f1              : Wait 1 second and let modem catch up...
  953.  
  954. :  --------------------------------------------------------------------------
  955.  
  956.  
  957. ::                   --- Setup Environment Variables ---
  958.  
  959. online:
  960.         set disks "abcdefghi"         :set up active disks (you can restrict)
  961.  
  962. ::    Note the prompts below can be anything you wish...
  963.  
  964.         set mprompt "\r\E[1m(F9=Menu) %drive:\L%pwd-> \E[m"   :Help prompt
  965.         : set mprompt "\r\E[1m%drive:\L%pwd->\E[m "    :Normal path prompt
  966.         set hprompt "\r\E[1m%drive:\L%pwd\U [HOST]->\E[m " :HOST mode prompt
  967.  
  968.         : The special command below allows you to put comments on status line...
  969.         set statliner "[Alt-2=Cmd Line, F2=View, F9=Help] " :maps status line
  970.  
  971.  
  972. ::                          -- HELPFILE Defined Below --
  973.  
  974. ::      Notice that the Flashup help processor is called with F10 as defined
  975. ::      in key setup or when F1 hit at command line.  The test below
  976. ::      'if fFILENAME' checks for the existence of the help files for ZCOMM
  977. ::      or YAM.  If they are found the variable 'helpfile' is set to the
  978. ::      command that will call help.  The string '@!%' is a clever construct
  979. ::      where each character has a meaning.  The '@' says that what follows
  980. ::      is a YAM/ZCOMM command.  The '!' means to run a DOS program, and the
  981. ::      '%' says to replace all YAM/ZCOMM variables (word beginning with '%')
  982. ::      before the DOS program is called.  The %home variable contains the
  983. ::      name of the subdirectory where YAM/ZCOMM was first called.  If you use
  984. ::      the COMM.BAT file I included, this will always be the location
  985. ::      of your communication programs.  First DOS 'echo' if no helpfiles...
  986.  
  987.         set helpfile "@!%echo     No helpfiles located in the home directory: %home"
  988.  
  989.         if fZMANH.HLP set helpfile "@!%yhp %home\zmanh.hlp zmain" :ZCOMM Help
  990.         if fUMANH.HLP set helpfile "@!%yhp %home\umanh.hlp main"  :YAM Help
  991.  
  992.  
  993. ::                          -- Optional setup statements --
  994.  
  995.         set calllog c:/zcomm/calllog :Setup call log (YAM and Registered ZCOMM)
  996.                                      :This file will keep record of calls made
  997.  
  998.         set fleft  "@mput \b"        : Makes left arrow destructive bksp
  999.         set fright "@mput \40"       : Makes right arrow a right space
  1000.         set s8 " \b"    :set string for 'hold' function to space/backspace key
  1001.  
  1002.         set adlopts rm               : Makes ZModem crash recovery / MobyTurbo
  1003.                                      : Note the 'm' will cause an error in pre-
  1004.                                      : MobyTurbo versions
  1005.  
  1006.         set quitcmd \20bye\r\003\336off\r    : maps string given to ALT Q
  1007.                                      :to log off automatically after d/l; here
  1008.                                      :set to ^P,bye<cr> for CIS then OFF.  Once
  1009.                                      :Download starts, just hit Alt-Q to activate
  1010.  
  1011.         set answerback "\r\n %m \r\n\21"  :Stuff in 'm' name variable...
  1012.  
  1013.         set tmp c:/tmp               : Both tmp and lib are shortcut paths
  1014.         set lib c:/yam               : you can use in your script. For example
  1015.                                      : if later you may want to change this to
  1016.                                      : 'set tmp c:/zcomm/temp' to allow %tmp
  1017.                                      : to produce subdirectory location.
  1018.  
  1019.         set dirrx c:/tmp            :Sets up default for downloaded files as
  1020.                                      :above. If you made this 'set dirrx c:\tmp
  1021.                                      :your download would go to the \tmp subdir.
  1022.         : set dircx c:/tmp           :path to capture file directory
  1023.         : set dirfx c:/tmp           :path to files (message) directory
  1024.         : set dirsx c:/tmp           :path to upload dir
  1025.         : set oncloserx "@source c:/yam/gotafile.t"
  1026.  
  1027. :: Above is an example of how you can have a reaction to a file download and
  1028. :: run another file to do special processing.  As you can see you have total
  1029. :: control over where things are placed by the package.
  1030.  
  1031.  
  1032.  
  1033. ::                       -- Define Function Keys --
  1034.  
  1035. key:    cls         :Notice how a label starts in Col 1 and ends in a ":"
  1036.         reskeys     :reset function keys
  1037.  
  1038. ::    Explained below is the function key define command 'set'.  To see all
  1039. ::    the keys defined give the command 'key' at the YAM/ZCOMM prompt.  Note
  1040. ::    below that the command format sets a FUNCTION KEY to a specific task.
  1041. ::    This is just an example, F3 is defined again after this explanation.
  1042.  
  1043.  set f3
  1044. @accept s1 "Enter name of Capture File: " ; create -S+ %s1
  1045.  
  1046.       :  This is just a sample... actual F3 defined below these comments...
  1047.       :  Notice that I used a special case of the 'set' command where the
  1048.       :  key definition actually appears on the next line starting in col #1.
  1049.       :  The reason for this is that normally, function key commands are in
  1050.       :  quotes, yet here I wanted a quoted string inside the command.  To
  1051.       :  avoid having quotes within quotes, there is a special version of the
  1052.       :  set command that accepts the next line starting in column 1, as an
  1053.       :  implied command.  This means you don't need quotes around it...  Note
  1054.       :  as well the 'set' command DOESN'T start in column 1 because if it did
  1055.       :  it would be considered to be a label.
  1056.  
  1057.       :  To explain how the command works remember anything beginning with
  1058.       :  an "@" sign is a YAM/ZCOMM command (a @! allows you to execute a DOS
  1059.       :  program).  Let look at this command defining f3 step by step...
  1060.       :  The command "set" tells the program to set the function key
  1061.       :  (this case F3) to the following string:
  1062.  
  1063.       :        @accept s1 Enter name of Capture File: ;create -S+ %s1
  1064.  
  1065.       :  You could have used an escape sequence \40 to define a space
  1066.       :  in the string but only necessary in single line format.  This will
  1067.       :  make the prompt --> Enter name of Capture File: <--  Now the "accept"
  1068.       :  command assigns anything you type in response to this prompt and
  1069.       :  stores the response in a variable s1.  Remember ";" is just a way to
  1070.       :  separate multiple commands on each line, so you see when we come to
  1071.       :  the next command "create", it causes a capture file to be opened
  1072.       :  using the name you have entered.  The modifiers -S+ means, strip
  1073.       :  off control characters (-S) and append to the file (+) if it already
  1074.       :  exists.  Notice the argument %s1 will insert the file name
  1075.       :  added after the prompt (stored in s1).
  1076.  
  1077.       :  You see the PLUS of YAM/ZCOMM is that you can make things look
  1078.       :  any way you want.  You can set 38 function keys (remember that
  1079.       :  F1 moves you from circular buffer to terminal mode to command mode
  1080.       :  and F2 moves you in the opposite direction).  YAM/ZCOMM has THREE
  1081.       :  displays (command line, terminal mode, and circular buffer) yet this
  1082.       :  is a FAST way to move between them...
  1083.  
  1084.       :  To see variables you have defined just give the 'set' command followed
  1085.       :  by a return at the YAM/ZCOMM prompt.  If you want to see the value of
  1086.       :  a single key or variable for example 'F5' use the  command 'echo f5'.
  1087.       :  To see what KEYS are defined enter the command 'key' at the YAM/ZCOMM
  1088.       :  command line.  Remember command lines can't exceed 132 characters.
  1089.  
  1090.       :  Now set a series of function keys to activate specific commands...
  1091.  
  1092. ::                   --- NORMAL Function Key Definitions ---
  1093.  
  1094.  set f3 "@gosub capture"        :call capture routine just below 'menu:' label
  1095.  
  1096.  set f4
  1097. @accept s1 "Send ASCII Msg named: " f -p %s1  : send ASCII text/mesg -paced
  1098.  
  1099.  set f5
  1100. @accept s1 "Send file using Kermit called: " kermit sb %s1    : send Kermit
  1101.  
  1102.  set f6
  1103. @accept s1 "Send file using ZModem called: "; echo "\n\tStarted upload at: %t\b\b\b\b\b\b\b\b\b\b\b\b Hours      \n"; sz -rZ %s1
  1104.  : above sends file with ZModem (-r) crash recovery and Run Length Encoding
  1105.  : (RLE) using '-Z'.  Echo displays the start time of upload...
  1106.  
  1107.  set f7
  1108. @accept s1 "Receive file using CRCXModem called: " rc %s1   :receive CRCXmodem
  1109.  
  1110.  set f8
  1111. @accept s1 "Send file CRCXModem called: " sx %s1            :send CRC Xmodem
  1112.  
  1113.  set f9  "@gosub menu"                                      :Call Quick Reference
  1114.  : set f9 "@gosub fkeys"  : Call ANSI function key menu (commented out here...)
  1115.  
  1116.  set f10 "@help"   : Call help processor (newer YAM/ZCOMM just hit F1 x3)
  1117.  
  1118.  
  1119. ::                 --- SHIFTED Function Key Definitions ---
  1120.  
  1121.  set fs3 "@gosub hold"    : puts you in a holding pattern while on-line
  1122.  
  1123.  set fs4 "@echo working...;  gosub tlearn"
  1124.  
  1125.  set fs5                                         : check phone dir entries
  1126. @accept s5 "String to find in phones file: "; find \n%s5 %phones
  1127.  
  1128.  set fs6  "@gosub reset"   :Resets PROFILE.DAT containing modem dialing info
  1129.  
  1130.  set fs7  "@gosub start.%home/dial.t"   :setup call to dialing menu...
  1131.  
  1132.  set fs9 "@!chkdsk"        :@! example of how to run DOS program
  1133.                            :In this case CHKDSK used...
  1134.  
  1135. ::                  --- ALT-ed Function Key Definitions ---
  1136.  
  1137.  set fa1 "@kill; call -100 bnf"              : Examples of key assign
  1138.  set fa2 "@kill; call -100 old"              : note "@call -100" will
  1139.  set fa3 "@write; close"                     : call number up to 100
  1140.  set fa4 "@kill; call -100 cis"              : times if busy.
  1141.  set fa5 "@kill; call -100 pcmag"            : kill clears buffer...
  1142.  set fa6 "@kill; bye; gosub host"            : Put into HOST mode
  1143.  set fa7 "\r \r\t\t\t\t %m \r\r"             : When on-line, Alt-F7 signs
  1144.                                              : your name defined in 'm' setup
  1145.                                              : in PROFILE.DAT
  1146.  
  1147. :: Editors are your choice (they just have to be able to save in ASCII format).
  1148.  
  1149. :: I have included version 3.10 of the Colorado State Editor developed by
  1150. :: J. R. Applegate at the Colorado School of Mines.  This full featured
  1151. :: editor is only 13K and features block copies, moves, upcase, lowcase,
  1152. :: deletes, etc.  It is fully configurable and is PUBLIC DOMAIN!
  1153.  
  1154. :: The best ASCII editor I have found that can be configured to run any
  1155. :: command set you want (e.g. WS, WP, Brief, or pull down menus) is a shareware
  1156. :: called QEdit.  It is rated high by many publications (and is my personal
  1157. :: favorite).  QEdit by SemWare is available on most BBS around the country.
  1158. :: Worth a look!
  1159.  
  1160. :: Below I again used the special construct @!% (@=command, !=DOS shell,
  1161. :: %=replace variables before calling DOS command).  If the DOS 'set phones='
  1162. :: command was used to setup environment variable at DOS the %phones will
  1163. :: read it.
  1164.  
  1165.  set fa9                         : Use incase NO editor selected
  1166. @echo " Alt-F9 has no editor defined. Just edit to script under 'set fa9'\n to setup an editor of your choice..."
  1167.  
  1168.  set fa9 "@!%edit %phones"            : example using DOS 5 EDIT
  1169.  : set fa9 "@!%q %phones"            : example using QEdit
  1170.  
  1171. ::  If you want the menu just after loading, remove the ':' in front of the
  1172. ::  line below to comment it in thereby activating the command.
  1173.  
  1174.     : goto menu
  1175.  
  1176. ::  This is an opening msg for new ZCOMM users and can be commented out if
  1177. ::  you want to skip it.
  1178.  
  1179.     lput "\r\n\n\t\t -=* Welcome to the World of Telecommunication *=-\r\n\n"
  1180.     lput "\t\t                     PHOMAST.T                    \r\n"
  1181.     lput "\t\t                   [Version 6.3a]                 \r\n\n"
  1182.     lput "\t\t      >>> Press F9 if you need more help <<<          \E[10f"
  1183.     lput "\t If you want to change your *setup* defaults just hit SHIFT-F6. \r\n\n"
  1184.     lput "\t To view the current defaults stored in 'PROFILE.DAT' just enter\r\n"
  1185.     lput "\t the command 'type profile.dat'.                                \r\n\n"
  1186.     lput "\t Remember, to utilize your Long Distance Service start the number\r\n"
  1187.     lput "\t with a prefix of '\45l,'.  Notice the sample syntax below...   \r\n\n"
  1188.     lput "\t                       '\45l,512-670-0954'                      \E[23f"
  1189.  
  1190. ::                  Second part of testing for on-line conditions
  1191. ::                                 (Optional)
  1192.  
  1193.      fail       : The 'fail' here eliminates the on-line checking... if
  1194.                 : you want on-line checking, comment this 'fail' out (put a
  1195.                 : ':' in front of it) and search from the top of the script
  1196.                 : for the line 'if c goto online' and remove the ':' in front
  1197.                 : of it.
  1198.  
  1199.      if !c return             :if no carrier return, else go online
  1200.      echo "\t\t    System still on-line with remote server..."
  1201.      putw "\r" ; t            :hits return and return to terminal mode
  1202.      return                   :Returns system back
  1203.  
  1204. ::---------------------------  End of Setup Code  ----------------------------::
  1205.  
  1206.                         ---------------------------------
  1207. ::--------------------------  AutoConfiguration Code -------------------------::
  1208.                         ---------------------------------
  1209.  
  1210. ::      This code for PROFILE configuration was put at the bottom of the script
  1211. ::      because the script file is searched from the beginning to end.  Since
  1212. ::      configuration is done only at install and when configuration is
  1213. ::      changed, I put this code at the bottom of the script to allow other
  1214. ::      procedures to be found faster.
  1215.  
  1216.  
  1217. reset:  : This code segment attached to Shift-F6 will delete the old defaults
  1218.         : stored in PROFILE.DAT and start a new one...  It is completely menu
  1219.         : driven.  Once PROFILE.DAT is deleted it branches to 'setup' label
  1220.         : later in the script to do the actual configuration.
  1221.  
  1222.         display nobell=visual   : Turn bell back ON
  1223.         cd %home                : Attempt to return to original directory
  1224.         cls; echo "\n\n\d7\t\t >>> Communications Configuration Setup <<<\n\n"
  1225.         :: display bell=visual     : Turn bell back OFF and ask about delete of file
  1226.         lput "          Don't change your setup if you are currently online...\r\n\n"
  1227.         lput "   Insure you are in directory where phones files stored before making\r\n"
  1228.         lput "   any changes... you are currently in a subdirectory called: "; !cd
  1229.         lput "\r\n\nThis directory contains the following PHONES files:\r\n" ; !dir p*.t
  1230.         lput "\n   Is this the correct directory and do you want to change setup (y/N)? "
  1231.  
  1232.         if !y cls echo "\n\n"  fail
  1233.         del profile.dat             :Delete the old profile data file...
  1234.  
  1235.         :               ---------------------------------
  1236.  
  1237.         : This code segment is where the PROFILE.DAT file is generated in
  1238.         : response to menu selections...
  1239.  
  1240. make_profile:
  1241.         set s0 ""       :initial variable to NULL
  1242.         purgek; kill; pv0; create -y profile.dat   :clear buffer/write profile
  1243.  
  1244.         : Since PROFILE.DAT doesn't exist now, the next code actually writes a
  1245.         : new file (using the echof) called PROFILE.DAT storing your defaults.
  1246.         : What is really happening here is YAM is generating its own script
  1247.         : file that will contain changed configuration information for future
  1248.         : use.  Remember when you use this technique you must have a space or
  1249.         : TAB echoed before every command line so it doesn't write the target
  1250.         : file line in column 1.
  1251.  
  1252.         echof "::                  >>> DON'T DELETE THIS FILE <<<"
  1253.         echof "::                           PROFILE.DAT\n"
  1254.         echof "::  This file contains important setup information used by YAM/ZCOMM "
  1255.         echof "::  and was completely generated by PHOMAST.T file from menu choices!"
  1256.         echof "::  You can edit this file directly or from YAM/ZCOMM; hit Shift-F6"
  1257.         echof "::  to call up configuration menus and have the computer do the work.\n"
  1258.         echof "::  You can change Color default here or in the main PHOMAST.T script"
  1259.         echof "::  but remember ANY changes made here will be changed with Shift-F6."
  1260.         echof "::  To see possible colors enter the command 'gosub color' prompt."
  1261.         echof "\n::  Note: If there is NO port command below, default is 'COM1' \n"
  1262.  
  1263.         :: Note that 'lput' is local echo where 'echof' will write to open file
  1264.         :: Remember that 'lput' doesn't put a hard return at the end of lines.
  1265.         :: Below the \E[xxm just add color to the letters 'COLOR'
  1266.  
  1267.         pn15; cls; lput "\E[m\n\n\n\t\t    Are you using a \E[1m\E[33mC\E[32mO\E[34mL\E[35mO\E[36mR\E[m monitor (y/N)? "
  1268.         if !y echof "    pn15 pr127 pu15 ps112 p*112 p@15   :default monochrome..."; goto mono
  1269.  
  1270.         echof "    if dc pn1055 pr26 pu26 ps26 p*26 p@30    :setup default colors"
  1271.         if dc pn1055 pr26 pu26 ps26 p*26 p@30        :setup colors locally
  1272.  
  1273. :: <*>  -------------------- Optional DISPLAY COLORS Setup -------------------
  1274.  
  1275.         ::  If you don't like the default colors just pick one of the color
  1276.         ::  options below and put one copy inside the quotes of the 'echof'
  1277.         ::  above and another copy just below it (e.g. modify the two lines
  1278.         ::  of code above this comment...)
  1279.         ::
  1280.         ::  if dc means -- If Display Color... and the settings are:
  1281.         ::  n=text, r=reverse, u=underline, s=status line, *=message,
  1282.         ::  @=file indicator (normally blinking i.e. files open)
  1283.         ::  For example: 2=green, 3=blue, 10=bright green etc...
  1284.         ::  By adding 1024 to any number you will get blinking suppression.
  1285.         ::  To see all the possible colors enter the command 'gosub color'
  1286.         ::  at the YAM/ZCOMM prompt...
  1287.  
  1288.         :: pn15 pr127 pu15 ps112 p*112 p@15       :default monochrome string
  1289.         :: pn7  pr7 pu15 ps7  p*112 p@15        :Alternate monochrome setting
  1290.  
  1291.         :: if dc pn1055 pr31 pu26 ps26 p*26 p@30 :default color string
  1292.         :: if dc pn3  pr10 pu10 ps14 p*10 p@10   :works well with RGB
  1293.         :: if dc pn3  pr30 pu15 ps14 p*12 p@79   :color alternate 1
  1294.         :: if dc pn2  pr10 pu6  ps3  p*3  p@3    :color alternate 2
  1295.         :: if dc pn2  pr30 pu15 ps3  p*3  p@79   :color alternate 3
  1296.         :: if dc pn3  pr30 pu15 ps2  p*12 p@79   :Pearson's choice
  1297.         :: if dc pn31 pr30 pu15 ps14 p*15 p@79   :Willoughby's choice
  1298.         :: if dc pn1055 pr26 pu26 ps23 p*26 p@28 :My favorite...
  1299.  
  1300. ::      ----------------------------------------------------------------------
  1301.  
  1302.         cls; lput "\n\n\n\t    Is snow a problem with your monitor (e.g. CGA) (y/N)? "
  1303.         if y echof "    display nowarpdrive       :Turn off high speed display"; goto mono
  1304.         display warpdrive   :turn on high speed display locally
  1305.         echof "    display warpdrive         :Turn ON highspeed display (no snow checking)"
  1306.  
  1307.  
  1308. mono:   cls; lput "\r\n\t\t>>> PULSE / TONE Dial Configuration Menu <<<\r\n\n"
  1309.         lput "\t\t   Your current modem dial string is: %mprefix\r\n"
  1310.         lput "\t\t   (If 'M' above Manual dial selected...)\r\n\n"
  1311.         lput "\t\t    1. Set modem to dial TONE type phone.\r\n"
  1312.         lput "\t\t    2. Set modem to dial PULSE type phone.\r\n"
  1313.         lput "\t\t    3. Dial the number using an EXTERNAL phone.\r\n"
  1314.         lput "\t\t    4. Quit -- Don't change a thing...\r\n\n"
  1315.  
  1316.         acceptl1 s9 "\t\t    Choose one of the above: "  :store ans in s9
  1317.  
  1318.         if "Js9,1234" goto ok   :check for correct input...
  1319.         display nobell=visual
  1320.         lput "\E[24f\7\t\t      You MUST choose between 1 and 4"; sleep 15
  1321.         :: display bell=visual
  1322.         goback mono
  1323.  
  1324. ok:     if is9,3 echof "    sets mprefix M          :setup for MANUAL dial" ; goto pdone :setup for MANUAL dial
  1325.         if is9,4 echof "    sets mprefix %mprefix"; goto pdone :leave unchanged
  1326.         lput "\r\n Excluding long distance service do you need a special dialing prefix (y/N)? "
  1327.  
  1328.         if !y goto pdone
  1329.         accept s0 "\r\n\t\t    Enter the prefix number now: "
  1330.         if %s0<1 set s0 "" ; goto pdone  :Null was entered for prefix number...
  1331.         sets s0 %s0,           :appends a comma after the dial prefix...
  1332.  
  1333.         : Remember you must put a tab/space in echo so it produces a legal
  1334.         : line of code in the PROFILE.DAT file, since without a space or
  1335.         : TAB it would just be a label.  Notice the extra spacing after echof.
  1336.  
  1337. pdone:  if is9,1 echof "    sets mprefix ATDT%s0         :setup for TONE dial" ; goto ok
  1338.         if is9,2 echof "    sets mprefix ATDP%s0         :setup for PULSE dial"; goto ok
  1339.  
  1340.         : The next section of code actually looks at the specific hardware
  1341.         : configuration.  This test will work for the 90% of you that have
  1342.         : COM1 or COM2 active attached to a modem that accepts the HAYES
  1343.         : command set.  What happens is the ATtention command is sent to
  1344.         : each port looking for a response.  If one is found (e.g. the modem
  1345.         : answers 'OK') that port is defined as active.  Once hot port is found
  1346.         : a line is added to PROFILE.DAT which activates that port...  This
  1347.         : is particularly interesting since I know of no comm program that does
  1348.         : auto port configuration...
  1349.  
  1350. ok:     write; close        : Before PORT testing turn off file recording
  1351.  
  1352.         lput "\r\n      If external MODEM, make sure it's ON for testing, then HIT ANY KEY. "
  1353.         : Below will wait for keystroke hit, then it echoes 'working'
  1354.         ife y ;  lput "      ...working"   :special construct to wait for any keyhit...
  1355.         display inhibit     : Turn off echo to screen (avoids the AT and OK)
  1356.  
  1357.         sp 1200             : Initially set up speed at 1200 baud for testing
  1358.         pat 9 K\r\n         : Check for OK from modem indicating port match...
  1359.         port 1              : Try COM1 first
  1360.         put "AT\r"; wait -f3              : AT command and wait 3 sec for OK
  1361.         if 9 set s0 1 ; goto pset         : If PORT 1 set s0=1 to indicate COM1
  1362.         port 2              : Try COM2 now that COM1 has failed
  1363.         put "AT\r"; wait -f3              : AT command and wait 3 sec for OK
  1364.         if 9 set s0 2 ; goto pset         : If PORT 2 set s0=2 to indicate COM2
  1365.         display noinhibit   : Turn local echo back on
  1366.  
  1367.         : If it wasn't PORT 1 or 2 goto ask user what port to use...
  1368.  
  1369.         lput "\r\n\t    Testing hardware I was unable to find an ACTIVE modem..."
  1370.         acceptl1 s0 "\r\n\t    Enter COM port number modem connected to (normally 1): "
  1371.         display nobell=visual
  1372.         if %s0<1 lput "\7\t                    Port 1 assumed...\r\n"; set s0 1
  1373.         :: display bell=visual
  1374.  
  1375. pset:   display noinhibit   : Turn local echo back on
  1376.         purgek; kill; pv0; create -+ profile.dat   :restart code recording
  1377.         lput  "\r\n\t\t\t Now configured for COM%s0\r\n\n"
  1378.         echof "    port %s0                    :setup computer COM port number"
  1379.         lput "\t\t\t Hit Any Key to continue..."
  1380.         ife y  ;        :basically a no-op wait for keystroke (nul else nul)
  1381.  
  1382.         cls; set s0 "1"        :default long distance service as '1' service
  1383.         lput "\r\n\n\t Do you want to add a long distance service so you can utilize"
  1384.         lput "\r\n\t the syntax \45l,213-555-1212 to add MCI or SPRINT service to the"
  1385.         lput "\r\n\t to your call [Return will default to '1' prefix] (y/N)? "
  1386.         if y accept s0 "\r\n\t Enter your carrier number (3) COMMAs then account: "
  1387.         if %s0<1 echo "\t\t   >>>  Service \"1\" assumed <<<" ; set s0 "1"
  1388.         echof "    set l %s0        :setup long distance service variable \45l"
  1389.  
  1390.         :  >>> Notice that setting UPPER CASE variables is only allowed in YAM.
  1391.         :  ZCOMM doesn't allow upper case variables.  This means if a user
  1392.         :  enters %L, for dialing prefix it there is no way to define it to
  1393.         :  prevent an error...  ZCOMM users can only use %l.
  1394.  
  1395.         : echof "    set L %s0        :setup long distance service variable \45L"
  1396.  
  1397.         lput "\r\n\n\t Enter a name you want defined to Alt-F7 to use as a short cut"
  1398.         accept s9 "\t for signing your name to a message: "
  1399.         if %s9<1 set s9 "<Not defined -  Hit Shift-F6 once off line>"
  1400.         sets m "\42%s9\42"         :add the quotes to the string...to %m
  1401.  
  1402.         : Note ProYAM users could have used a variable call 'name' here and
  1403.         : retrieved it with %name; but ZCOMM is more restrictive.  It does
  1404.         : not allow variable names, so I used 'm' here (normally 'm' is the
  1405.         : second Long Distance Service).  It's much more flexible to use
  1406.         : 'name' since the %name variable makes more sense -=- Oh' well,
  1407.         : just a minor limitation in the shareware ZCOMM...
  1408.  
  1409.         echof "    set m %m   :name stored in '\45m'"
  1410.  
  1411.         echof "\n::\t\t     -- End of Setup Information --\n"
  1412.  
  1413.         lput "\n\t Storing your new configuration in file named: PROFILE.DAT\r\n"
  1414.         write; close    : Code generation complete, close the PROFILE.DAT file
  1415.  
  1416.         lput "\t  Configuration complete -=- All variables now defined..."
  1417.         lput "\E[20f\t\tHit Any Key to continue and view new PROFILE.DAT"
  1418.         ife y  ;         :basically a no-op wait for keystroke (nul else nul)
  1419.         cls; type profile.dat
  1420.         lput "\t\t\tHit Any Key to continue..."
  1421.         ife y  ;         :basically a no-op wait for keystroke (nul else nul)
  1422.         cls; goto setup  :Force new PROFILE.DAT to be activated.
  1423.  
  1424. ::----------------------- End of Auto Configuration Code --------------------::
  1425.  
  1426. ::                -------------------------------------------
  1427. ::           --- For Fancy TOP LINE Menu using ANSI Graphics ---
  1428. ::                -------------------------------------------
  1429.  
  1430. ::  Special thanks to Michael Pearson and Ron Ottinger for ANSI menus concept...
  1431.  
  1432. ::      Notice the ANSI color setup using 'echo' or 'lput' is not simple. Shown
  1433. ::      here the \E[44;36m sets up light blue letters on dark blue background.
  1434. ::      To change to yellow on red for example just search and replace \E[44;36m
  1435. ::      with \E[33;41m  --  Notice in this example I change pn (normal color)
  1436. ::      to pn15 to make bright white.  To change back at end of each sequence
  1437. ::      I moved it back to pn3 (blue).  Be sure to change this to whatever
  1438. ::      normal color you want...  This code is completely OPTIONAL and just for
  1439. ::      fun!
  1440.  
  1441. fkeys                                            ::func keys menu
  1442.         pn15                                     ::make normal color WHITE
  1443.         lput "\E[s"                              ::save cursor position
  1444.         lput "\E[1;1f"                           ::move cursor to menu line
  1445.         lput " 1\E[37;44mExit B\E[0;m 2\E[37;44mEnterB\E[0;m 3\E[37;44mO Capt\E[0;m 4\E[37;44mSascii\E[0;m"   ::the menu
  1446.         lput " 5\E[37;44mSKermt\E[0;m 6\E[37;44mSZmodm\E[0;m 7\E[37;44mRec CX\E[0;m 8\E[37;44mSCxmod\E[0;m"   ::the menu
  1447.         lput " 9\E[37;44mA KEYS\E[0;m 0\E[37;44m>HELP<\E[0;m"
  1448.         lput "\E[u"                              ::restore cursor position
  1449.         set f9 "@gosub altkeys"                  ::f9 calls ctrl f keys next
  1450.         pn3                                      ::change normal color to blue
  1451.     return
  1452.  
  1453. altkeys                                          ::alt-func keys menu
  1454.         pn15                                     ::make normal color WHITE
  1455.         lput "\E[s"                              ::save cursor position
  1456.         lput "\E[1;1f"                           ::move cursor to menu line
  1457.         lput "a1\E[37;44mB&F-24\E[0;ma2\E[37;44mGurd12\E[0;ma3\E[37;44mCloseC\E[0;ma4\E[37;44mCISdem\E[0;m"   ::the menu
  1458.         lput "a5\E[37;44mPC Mag\E[0;ma6\E[37;44m-HOST-\E[0;ma7\E[37;44msignat\E[0;ma8\E[37;44m      \E[0;m"   ::the menu
  1459.         lput "a9\E[37;44mEdPhon\E[0;ma0\E[37;44m      \E[0;m"
  1460.         lput "\E[u"                              :: restore cursor position
  1461.         set f9 "@gosub shiftkeys"                :: f9 calls no keys next
  1462.         pn3                                      ::change normal color to blue
  1463.     return
  1464.  
  1465. shiftkeys                                        ::shift-func keys menu
  1466.         pn15                                     ::make normal color WHITE
  1467.         lput "\E[s"                              ::save cursor position
  1468.         lput "\E[1;1f"                           ::move cursor to menu line
  1469.         lput "s1\E[37;44m      \E[0;ms2\E[37;44m      \E[0;ms3\E[37;44mHoldOL\E[0;ms4\E[37;44mTLearn\E[0;m"   ::the menu
  1470.         lput "s5\E[37;44mSearch\E[0;ms6\E[37;44mConfig\E[0;ms7\E[37;44m      \E[0;ms8\E[37;44m      \E[0;m"   ::the menu
  1471.         lput "s9\E[37;44mC KEYS\E[0;ms0\E[37;44m      \E[0;m"
  1472.         lput "\E[u"                              :: restore cursor position
  1473.         set f9 "@gosub ctrlkeys"                 :: f9 calls alt f keys next
  1474.         pn3                                      ::change normal color to blue
  1475.     return
  1476.  
  1477. ctrlkeys                                         ::ctrl-func keys menu
  1478.         pn15                                     ::make normal color WHITE
  1479.         lput "\E[s"                              ::save cursor position
  1480.         lput "\E[1;1f"                           ::move cursor to menu line
  1481.         lput "c1\E[37;44m     1\E[0;mc2\E[37;44m     2\E[0;mc3\E[37;44m      \E[0;mc4\E[37;44m      \E[0;m"   ::the menu
  1482.         lput "c5\E[37;44m      \E[0;mc6\E[37;44m      \E[0;mc7\E[37;44m      \E[0;mc8\E[37;44m      \E[0;m"   ::the menu
  1483.         lput "c9\E[37;44mOFF   \E[0;mc0\E[37;44m      \E[0;m"
  1484.         lput "\E[u"                              :: restore cursor position
  1485.         set f9 "@gosub nokeys"                   :: f9 calls shift keys next
  1486.         pn3                                      ::change normal color to blue
  1487.     return
  1488.  
  1489.  
  1490. nokeys:                                           :: restore status line
  1491.         cls; lput "\E[s"                          :: save cursor position
  1492.         lput "\E[1;1f"                            :: move cursor to menu line
  1493.         lput "                                                                                "
  1494.                                                   :: erase to end of line
  1495.         display nostat                            :: restore status line
  1496.         lput "\E[u"                               :: restore cursor position
  1497.         set f9 "@gosub fkeys"                     :: f9 calls f keys next
  1498.     return
  1499.  
  1500. :: This code demonstrated one way of displaying a HELP MENU using ANSI codes.
  1501. ::
  1502. :: What it does: (by pressing F9)
  1503. ::
  1504. ::    1.  Saves the current cursor position
  1505. ::    2.  Moves cursor to top of screen
  1506. ::    3.  Displays a FUNCTION KEY help menu.
  1507. ::    4.  Puts the cursor back to its original position
  1508. ::    5.  Sets F9 to the next FUNCTION KEY menu in the rotation.
  1509.  
  1510. ::-------------------------- End of ANSI Menu Demo ------------------------::
  1511.  
  1512.  
  1513.     ::  I would like to personally thank Bob Willoughby for the tireless
  1514.     ::  hours he spent proof reading both PHOMAST.T and the supporting
  1515.     ::  document files for this effort.  This release is just over 3000
  1516.     ::  lines went through multiple revisions as I found better and
  1517.     ::  better ways to make both YAM and ZCOMM easier for the user.  Bob
  1518.     ::  was there the whole way finding spelling errors and pointing out
  1519.     ::  areas that needed more explanation.  I owe him lots for sticking
  1520.     ::  with this effort.    Thank you Bob!
  1521.  
  1522.  
  1523. ::---------------------------------------------------------------------------::
  1524.