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