home *** CD-ROM | disk | FTP | other *** search
/ Beijing Paradise BBS Backup / PARADISE.ISO / software / BBSDOORW / ZMENU_V2.ZIP / ZMENU.T < prev    next >
Encoding:
Text File  |  1990-04-25  |  31.4 KB  |  814 lines

  1.  :  ZMENU.T  ZCOMM Version 2 90-05-01
  2.  :  previous verions V1 V1A superseded
  3.  :: modem assumed to support full Hayes set.  Limited modem support.
  4.  :  Author:  Bruce E. Högman, 629 S. 24th St., Arlington VA 22202-2525
  5.  :   Phone:  (703) 685-4926 (home)  (703) 644-5200x6470 (work)
  6.  :   FAX:    (703) 685-0478 (home)
  7.  :  Users are encouraged to contact the author with suggestions.
  8.  :  See ZMENU.DOC
  9.  ::
  10.  ::===  Symbols used within zmenu.t
  11.  ::
  12.  :: Labels contained in zmenu.t
  13.  ::
  14.  ::   setup          initializes menu system.  Called by ZCOMM at start,
  15.  ::                  if phones set to zmenu.t
  16.  ::                  setup processing also results in a zmnuparm.t
  17.  ::                  script which is used for all future startups.
  18.  ::                  to alter zmnuparm.ini, edit it, then del zmnuparm.t
  19.  ::                  and call setup.
  20.  ::
  21.  ::   bbs            Direct entry into BBS menu (only after setup)
  22.  ::   boards         Direct entry into BBS menu (only after setup)
  23.  ::
  24.  ::   displayreset   resets display to value in zmnuparm.ini,
  25.  ::                  cancels keyboard customization using 'mk' cmd
  26.  ::
  27.  ::   hangup         puts modem into command mode and issues ATH
  28.  ::
  29.  ::   inigrab        grabs parameters from zmnuparm.ini file
  30.  ::                  (like win.ini for windows, you know)
  31.  ::
  32.  ::   offyam         what do you want to do upon "off" command?
  33.  ::
  34.  ::   online         call online when you tromp on script or
  35.  ::                  exit to command mode.  this is easy return to
  36.  ::                  term mode.
  37.  ::
  38.  ::   your_name      your system names to call.  make a label for the
  39.  ::                  system name, then:  your_name goback rmtcall.
  40.  ::                  ZCOMM nicely sets string 'remote' to your_name,
  41.  ::                  and the 'rmtcall' script carries on from there.
  42.  ::                  You will, however, also need an entry in zmnulgn.T
  43.  ::
  44.  ::   zmenu***       sub-menu scripts
  45.  ::
  46.  ::  Main entry point for "call zmenu"
  47.  ::  string phones is used by ZCOMM as where to go to find scripts
  48.  ::  Symbols used in ZCOMM version:
  49.  ::
  50.  ::  YAM-type        ZCOMM-type
  51.  ::  menumode        fa12  str 1 ` \x60 on/off              z0
  52.  ::  menuinit        fa12  str 2        y/n                 z1
  53.  ::  menupage        fa12  str 3        e/1/2/3/4...        z2
  54.  ::  timezone        fa12  str 4        EST/EDT/CST/CDT...  z3
  55.  ::
  56.  ::  menufone        fa11  whole variable  %lib/zmnufon%page
  57.  ::
  58.  ::  modemspeed      fa10  whole variable
  59.  ::
  60.  ::  menutitle       fa9   whole variable
  61.  ::
  62.  ::  modeminit       fa8   whole variable
  63.  ::
  64.  ::  colordisplay    fa7   str 1 `      y/n
  65.  ::  colornormal     fa7   str 2        \E[0;33;1m yellow
  66.  ::  colorhigh       fa7   str 3        \E[0;31;1m red
  67.  ::
  68.  ::  menumsg         fa6   whole variable
  69.  ::  emulate         fa5   whole variable
  70.  ::  mndispl1        fa4   whole variable
  71.  ::  mndispl2        fa3   whole variable
  72.  ::                  fa2
  73.  ::  termmode        fa1   whole variable
  74.  ::
  75.  ::  (script stuff)
  76.  ::  myfirstname     fc11  whole variable
  77.  ::  mylastname      fc12  whole variable
  78.  ::  mycity          fc10  whole variable
  79.  ::  mystate         fc9   whole variable
  80.  ::  mypassword      fc8   whole variable (set by findq processing)
  81.  ::  rmtcript        fc7   whole variable (set by findq processing)
  82.  ::  rmttitle        fc6   whole variable (set by findq processing)
  83.  ::  myconnect       fc5   whole
  84.  ::  TSOuserid       fc4   whole
  85.  ::  TSOpasswd       fc3   whole
  86.  ::  rmtmsg          fc2   whole message text
  87.  ::  msglevel        fc1   whole numeric range 0-5 0 is silent
  88.  ::  menuhname       fs12  whole
  89.  ::  menuhscr        fs11  whole
  90.  ::
  91.  ::===  zmenu entry point
  92.  ::  If you call zmenu, then I assume you want to use menu system.
  93. zmenu: set phones zmenu.t
  94.  ::
  95.  ::  if menu system is not initialized, go do setup
  96.      if !%fa12 goto setup
  97.  ::
  98.  ::  display zmenu screen
  99.      type zmenu.scr
  100.  ::
  101.  ::  if user has defined a menu title line, display it, centered.
  102.      set ifs "`";split fa7
  103.      if %fa9 setn n1 79-%fa9/2
  104.      if %fa9 lput "\E[s\E[1;%n1\&H%z1 %fa9 \E[u%z2"
  105.  ::
  106.  ::  show the last command entered
  107.      set ifs "`";split fa7
  108.      if !%fa6 set fa6 "None"
  109.      lput "\E[2A\E[17C\E[35;1mLAST:  %fa6\&\E[u%z2"
  110.  ::
  111.  ::===  accept the one-character menu option that says what to do
  112.  ::
  113.      set ifs "`";split fa7
  114.      set s0 "";acceptl1 s0 "\E[3A\E[13C%z1\&_\E[1D\E[s%z2"
  115.  ::  Here's a branch table to go places based on user keyed input:
  116.      if is0,b goto zmnub
  117.      if is0,c goto zmnuc
  118.      if is0,d goto zmnud
  119.      if is0,e goto zmnue
  120.      if is0,g goto zmnug
  121.      if is0,h goto zmnuh
  122.      if is0,i cls;goto setup
  123.      if is0,k goto zmnuk
  124.      if is0,m goto zmnum
  125.      if is0,o goto zmnuo
  126.      if is0,p goto zmnup
  127.      if is0,q goto zmnuq
  128.      if is0,x goto zmnux
  129.      if is0,s goto zmnus
  130.      if is0,t goto zmnut
  131.      set fa6 "not recognized"
  132.      if afc1<4 goback zmenu
  133.      lput "\E[10;1H\E[J\E[1B\E[80D\E[0;36;1mOption %s0 not recognized"
  134.      lput "\E[1B\E[80DOn this panel, you are restricted to entering"
  135.      lput "\E[1B\E[80Djust those letters listed with the menu options."
  136.      lput "\E[1B\E[80DI will display help information now."
  137.      set s1 "-any key to continue-";setn n1 79-%s1/2
  138.      acceptl1 s0 "\E[1B\E[80D\E[%n1\&C%s1"
  139.      set fs12 "";goto zmnuhm
  140.  ::
  141.  ::===  Setup is called by ZCOMM on entry or on first call to zmenu.t
  142.  ::
  143. setup:
  144.  ::  If the script file exists, then use it for faster initialization
  145.      if !fzmnuparm.t goto setupcold
  146. setuphot:
  147.      sets s0 " source %drive:%home/zmnuparm.t";gosub execute
  148. userexit:
  149.      if f%lib/zmnuuser.t source %lib/zmnuuser.t
  150.      set fa6 "Menu system Initialized"
  151.  ::  menumode        fa12  str 1 `      on/off              z0
  152.  ::  menuinit        fa12  str 2        y/n                 z1
  153.  ::  menupage        fa12  str 3        e/1/2/3/4...        z2
  154.  ::  timezone        fa12  str 4        EST/EDT/CST/CDT...  z3
  155.      setc ifs "`";split fa12;set z1 y
  156.      setc fa12 "%z0\&`\&%z1\&`\&%z2\&`\&%z3\&`"
  157.      if iz0,off return
  158.      goback zmenu
  159.      ::
  160.      :: displayreset is used to return to a known mode after doing
  161.      :: strange things in remote logon scripts, maybe (for IBM with
  162.      :: Renex, in particular)  Among other things, it cancels keyboard
  163.      :: mapping which may be used with strange protocol converters.
  164. displayreset:
  165.      if %fa5 sets s0 "%fa5";gosub execute
  166.      if %fa4 sets s0 "%fa4";gosub execute
  167.      if %fa3 sets s0 "%fa3";gosub execute
  168.      mk
  169.      return
  170.  ::  This little routine simply waits for a number of intervals based
  171.  ::  on relative expertise as set in msglevel (fc1).
  172.  ::  This assumes that experts can read faster or don't need help at all.
  173. dwell:
  174.      setn n2 fc1*8;setn n1 0
  175. dwellloop:
  176.      setn n1 n1+8;if an1>n2 return
  177.      sleep 8;goback dwellloop
  178.  ::
  179.  ::  execute gosub supports use of temp file to issue commands
  180.  ::  on input:  s0 has command to execute
  181.  ::  This corresponds to the Pro-YAM "obey" command
  182. execute:
  183.      kill;ki;sets s1 "%dircx";sets dircx "%drive:%home";del zmnumain.tmp
  184.      create zmnumain.tmp;echof " %s0";close;source zmnumain.tmp
  185.      sets dircx "%s1";return
  186.  ::  This routine resets term mode to use-specified values
  187. termmode:
  188.      sets s0 "%dircx";sets dircx "%drive:%home";del zmnumain.tmp
  189.      create zmnumain.tmp;echof " ena %fa1";close;source zmnumain.tmp
  190.      sets dircx "%s0";return
  191.  ::
  192.  ::  This routine is meant to force a hangup.  It usually works.
  193. hangup: bye;o;pat
  194.      mk;dis -t;pat 0 "OK";sets s0 "speed %fa10";gosub execute
  195.      put "+++\r";sleep 5;put "ATH\r"
  196.      wait -f1
  197.      if !0 goto hangup
  198. hangupx: put "\r";pat;gosub displayreset
  199.      lput "\E[80D\E[K\E[1A\E[K\E[1A\E[K"
  200.      if afc1>0 if !jfa6,HUNG sets fa6 "%fa6 HUNG UP"
  201.      echo " MODEM HUNG UP ";if afc1>0 sleep 5
  202.      set ifs "`";split fa12;if i%z0,off return
  203.      if jfa6,BBS goto zmnub
  204.      goback zmenu
  205.   ::
  206.   :: inigrab input:  s0 set to string to find
  207.   :: and zmnuparm.ini contains init values: keyword value value
  208.   :: ZCOMM version of inigrab
  209. inigrab:
  210.   :: zero the hit counter "?"
  211.      p?0
  212.   :: search for requested string
  213.      findq %s0 zmnuparm.ini
  214.   :: if found, set s0 to value found, else set s0 to null
  215.      set s0 "";set ifs ""
  216.      if ?>0;split z0 " " "";sets s0 "%z1"
  217.      return
  218.   ::
  219.   :: the BBS label is available for direct "call bbs" use.
  220.   :: -do- boards label
  221. bbs:
  222. boards:
  223. zmnub:
  224.   :: If no user name yet, go get it.
  225.      if !%fc12 gosub getmyname
  226.   :: If no password set yet, go prompt for it.
  227.   :: (Pro-YAM only):  ZCOMM uses zmnubbpw.ini file
  228.   :: Display the phones list for the user to select from
  229.   :: menupage is set to default, fa12.  menufone is in fa11
  230.      goto zmnubsingl
  231.   :: Handle multiple phone lists here.
  232. zmnubmulti:
  233.      set ifs "`";split fa7
  234.      lput "\E[2J\E[2;25H%z1\& Phone List Selection Menu %z2"
  235.      if %fa9 setn n1 79-%fa9/2
  236.      if %fa9 lput "\E[s\E[1;%n1\&H%z1 %fa9 \E[u%z2"
  237.      sets s0 %lib/zmnufone.scr
  238.      if !f%s0 goto zmnubm2
  239.      set ifs "`";split fa7
  240.      lput "\E[1B\E[80D\E[5C%z1\&e)%z2\E[5C\E[s"
  241.      p?0;findq (title) %s0;if !? set z0 "unknown Untitled entry"
  242.      sets s0 "%z0";set ifs " ";split s0 " " "";sets s1 "%z1"
  243.      set ifs "`";split fa7
  244.      lput "\E[u\E[35mzmnufone.scr\E[5C%z1\&%s1\&%z2"
  245.      set n1 0;gosub zmnubmultin
  246.      set ifs "`";split fa12
  247.      acceptl1 s0 "\E[1B\E[80D\E[5C\E[33;1m\&_\E[31;1m Select\E[33;1m\E[8D"
  248.      if is0,? goback zmnubmulti
  249.      if is0,* goback zmnubmulti
  250.      if fzmnufon%s0.scr sets z2 %s0;sets fa12 "%z0`%z1`%z2`%z3`";sets fa11 "%lib/zmnufon%s0.scr";goto zmnubsingl
  251.      if is0,q goback zmnub
  252.      lput "\E[2B\E[80D\E[5CSelection \E[31;1m%s0\&)\E[33;1m does not exist\E[33;1m"
  253.      sleep 20;goback zmnubmulti
  254. zmnubmultin:
  255.      setn n1 n1+1;sets s0 "zmnufon%n1.scr";if !f%s0 return
  256.      lput "\E[1B\E[80D\E[5C\E[31;1m\&%n1\&)\E[33;1m\E[5C\E[s"
  257.      p?0;findq (title) %s0;if !? return
  258.      sets s0 "%z0";split s0 " " ""
  259.      lput "\E[u\E[35mzmnufon%n1.scr\E[5C\E[33;1m%z1\&\E[33;1m"
  260.      goback zmnubmultin
  261. zmnubsingl:
  262.   :: fa11 has string which is path/filespec of menu phone page
  263.      type %fa11
  264.   :: If the user wants a title, display it, centered.
  265.      set ifs "`";split fa7
  266.      if %fa9 setn n1 79-%fa9/2
  267.      if %fa9 lput "\E[s\E[1;%n1\&H%z1 %fa9 \E[u%z2"
  268.      lput "\E[10C\E[35;1mLAST: %fa6\&\E[u%z2"
  269.   :: Accept the single digit/letter that selects the phone number.
  270.      set s0 "";acceptl1 s0 "\E[1A\E[80D\E[5C\&_\E[1D"
  271.      set fa6 "BBS";sets fa6 "%fa6 %s0"
  272.      if !%s0 goback zmnub
  273.      if is0,q goback zmenu
  274.      if is0,h set fs12 zmnub;set fs11 zmnubh.scr;goto zmnuhm
  275.      if is0,+;goback zmnubmulti
  276.      p?0;sets s0 "%s0\&)";findq %s0 %fa11
  277.      if ?<1 if afc1>3 goto zmnubsh
  278.      if ?<1 goback zmnub
  279.      split z0 " ";sets remote "%z1"
  280.      goto rmtcall
  281. zmnubsh:
  282.      lput "\E[10;1H\E[J\E[1B\E[80D\E[0;36;1mPhone entry %s0 does not exist on this phone list."
  283.      lput "\E[1B\E[80DOn this panel, you are restricted to entering just those characters"
  284.      lput "\E[1B\E[80Dnext to the displayed phone list entries."
  285.      lput "\E[1B\E[80DI will display help information now."
  286.      set s1 "-any key to continue-";setn n1 79-%s1/2
  287.      acceptl1 s0 "\E[1B\E[80D\E[%n1\&C%s1"
  288.      set fs12 zmnub;set fs11 zmnubh.scr;goto zmnuhm
  289.   ::
  290. zmnuc: set fa6 "COLORS";set s0 zmnumain.bak;gosub .%lib/zmnusave.t
  291.      gosub .%lib/zmnucolr.t;goback zmenu
  292. zmnud: set fa6 "DISCONNECT";goback hangup
  293.   :: The e option depends upon the e.bat being present in DOS PATH
  294. zmnue: set s0 "!e";gosub execute
  295.      set fa6 "EDIT";goback zmenu
  296. zmnug:
  297.      set s0 "You entered 'g' on menu to OFF ZCOMM.";setn n1 79-%s0/2
  298.      lput "\E[2J\E[10;%n1\&H%s0\E[12;20H"
  299.      acceptl1 s0 " Do you really want to quit? [%z1\&n\&%z2\&/y]%z2"
  300.      sleep 1;if is0,y;sleep 5;off
  301.      set fa6 "OFF - Undone";goback zmenu
  302. zmnuh: set fa6 "HELP";type zmnuhelp.scr
  303.      set ifs "`";split fa7
  304.      if %fa9 setn n1 79-%fa9/2
  305.      if %fa9 lput "\E[s\E[1;%n1\&H%z1 %fa9 \E[u%z2"
  306.      acceptl1 s0 "\E[3A\E[13C\E[8;30;31m\&_\E[1D\E[s%z2"
  307.      set fs12 zmnuh
  308.      if is0,m set fs11 zmnuh.scr;goto zmnuhm
  309.      if is0,y goto zmnuhy
  310.      if is0,q goback zmenu
  311.      goback zmnuh
  312. zmnuhm: display nostat=off
  313.      sets s0 "page %fs11";gosub execute
  314. zmnuhbranch:
  315.      gosub displayreset
  316.      if !fs12 goback zmenu
  317.      if ifs12,zmnuh goback zmnuh
  318.      if ifs12,zmnum goto zmnum
  319.      goback zmenu
  320. zmnuhy:
  321.      lput "\E[2J\E[10;24HYamhelp is Pro-YAM feature only"
  322.      set s1 "-any key to continue-";setn n1 79-%s1/2
  323.      acceptl1 s0 "\E[12;%n1\&H%s1";goback zmnuhbranch
  324. zmnuk: set fa6 "KEYS"
  325.      lput "\E[2J\E[31;1m\&Function Key definitions\E[33;1m"
  326.      keys;acceptl1 s0 "-any key to continue-";goback zmenu
  327. zmnum: set fa6 "MAINT";type zmnum.scr
  328.      set ifs "`";split fa7
  329.      if %fa9 setn n1 79-%fa9/2
  330.      if %fa9 lput "\E[s\E[1;%n1\&H%z1 %fa9 \E[u%z2"
  331.      acceptl1 s0 "\E[3A\E[8C\&_\E[1D\E[s"
  332.      set fs12 zmnum;set fs11 zmnumh.scr
  333.      if is0,e goto zmnume
  334.      if is0,c set fs11 zmnumc.scr;goto zmnuhm
  335.      if is0,h goto zmnuhm
  336.      if is0,y goto zmnuhy
  337.      if is0,q goback zmenu
  338.      goback zmnum
  339. zmnume: !e zmnufone.scr
  340.      goback zmnum
  341. zmnup: !e zmnuparm.ini
  342.      goback zmenu
  343. zmnuq:
  344.      set ifs "`";split fa7
  345.      lput "\E[2J"
  346.      if afc1>0 lput "\E[35;1m ==> ENTERING ZCOMM COMMAND MODE."
  347.      if afc1>2 lput "\E[36;1m TO RETURN TO MENU, USE %z2\&call zmenu"
  348.      set fa6 "COMMAND MODE"
  349.      return
  350. zmnuo: sets fa6 "%fa6 ONLINE";goto online
  351. zmnus: set fa6 "SETUP";type zmnus.scr
  352.      set ifs "`";split fa7
  353.      if %fa9 setn n1 79-%fa9/2
  354.      if %fa9 lput "\E[s\E[1;%n1\&H%z1 %fa9 \E[u%z2"
  355.      acceptl1 s0 "\E[3A\E[8C\&_\E[1D\E[s"
  356.      set fs12 zmnus;set fs11 zmnush.scr
  357.      if is0,e goto zmnuse
  358.      if is0,u goto zmnusu
  359.      if is0,h goto zmnuhm
  360.      if is0,y goto zmnuhy
  361.      if is0,q goback zmenu
  362.      goback zmnus
  363. zmnuse:
  364.      set fa6 "e.bat zmnuparm.ini"
  365.      !e zmnuparm.ini
  366.      goback zmnus
  367. zmnusu:
  368.      set s1 "Update using ZCOMM not yet available"
  369.      setn n1 79-%s1/2;setn n2 10
  370.      lput "\E[2J\E[%n2;%n1\&H%s1"
  371.      set s1 "-any key to continue-"
  372.      setn n1 79-%s1/2;setn n2 12
  373.      acceptl1 s0 "\E[%n2;%n1\&H%s1"
  374.      goback zmnus
  375.  ::  source %lib/zmnuinit.t
  376.      goback zmnus
  377. zmnut: set fa6 "TESTPW Pro-YAM feature only"
  378.      goback zmenu
  379. zmnux: sets phones %lib/phones.t;echo "%phones";sleep 10
  380.      gosub setup.%phones
  381.      return
  382. online: pat
  383.      pat 24p "NO CARRIER"
  384.      if !c goto onlinex
  385.      display nostat=off
  386.      lput "\E[s\E[1;1H\E[K\E[1;1HONLINE SCRIPT\E[u"
  387.      if !jfa6,ONL sets fa6 "%fa6 ONLINE"
  388.      gosub termmode
  389.      if !c goto onlinex
  390.      t
  391.      if !c goto onlinex
  392.      display nostat=off
  393.      lput "==> ONLINE RETURN"
  394.      set ifs "`";split fa12;if iz0,off return
  395.      if jfa6,BBS goback bbs
  396.      goback zmenu
  397. onlinex:
  398.      pat
  399.      pat 24 ""
  400.      lput "\E[2J\E[10;1H\E[31;1m ==> END OF SESSION with %fc6"
  401.      sleep 5
  402.      lput "\E[1;1H"
  403.      goback hangup
  404. rmtcall:
  405.      if !%fc12 gosub getmyname
  406.      set z9 "";set z8 "";set z7 "";set z6 "";set z5 ""
  407.      set ifs " :"
  408.      split remote;sets remote %z0;findq %remote %fa11
  409.      : notes:  zmnufone.scr has: #)   sysname telno mode script title
  410.      :                           z0   z1      z2    z3   z4     z5-z9
  411.      set ifs " ";split z0
  412.      if %z5 sets z5 "%z5 "
  413.      if %z6 sets z6 "%z6 "
  414.      if %z7 sets z7 "%z7 "
  415.      if %z8 sets z8 "%z8 "
  416.      if %z9 sets z9 "%z9 "
  417.  ::  Set telno string and fa1 string (termmode to use with this remote)
  418.      sets telno "%z2";sets fa1 "%z3"
  419.      sets fc7 "%z4";sets fc6 "%z5%z6%z7%z8%z9"
  420.      sets fa6 "%fa6 %fc6"
  421.      gosub termmode
  422.  ::  routine to obtain BBS-unique password value based on remote name
  423.  ::  mypasswd value is stored in fc8
  424.      set fc8 "";: null password value
  425.      p?0;findq "bbsname=%remote" %lib/zmnubbpw.ini;if ?>0 set ifs " =";split z0;sets fc8 %z3
  426.   :: special routine just for weird IBM mainframe TSO
  427.      if jfc6,TSO gosub getTSOpasswd
  428. rmtsyscall:
  429.   lput "\E[2J\E[33;44;1m\E[1;1H\E[5C"
  430.   lput "╔════════════════════════════════════════════════════════════════════╗"
  431.   lput "\E[B\r\E[5C"
  432.   lput "║                                  To stop, F1 or ALT-N (NUKE)       ║"
  433.   lput "\E[80D\E[11CDialing %remote"
  434.   lput "\E[B\r\E[5C"
  435.   lput "╚════════════════════════════════════════════════════════════════════╝"
  436.   lput "\E[1B\E[80D\E[5C\E[35;1m"
  437.   echo "%telno %fa1 %fc7 %fc6 %fa6"
  438.   set fa6 ""
  439.   set fc5 no;: myconnect
  440.   pat
  441.   pat 0 "CONNECT 2400"
  442.   pat 1 "CONNECT 1200"
  443.   pat 2 "BUSY"
  444.   pat 3 "NO CARRIER"
  445.   put "%mprefix\&%telno\&%msuffix"
  446.   wait -f45
  447.   if 0   goto rmtsyscallon
  448.   if 1   goto rmtsyscall12
  449.   if 2   goto rmtsyscallbusy
  450.   echo " NO CARRIER OR ERROR ";set fc2 "NO CARRIER"
  451.   pat
  452.   goto rmtsyscallret
  453. rmtsyscallbusy: echo " %fc6 NUMBER %telno IS BUSY "
  454.   set fc2 "BUSY last try"
  455.   pat;p?0
  456.   set s0 y
  457.   acceptl1 s0 "Shall I loop on this same number? y/n : [\E[31;1my\E[1;33m]\E[2D"
  458.   if !js0,n goto rmtsyscall
  459.   echo " OK, DIALING IS ABORTED "
  460.   goto rmtsyscallret
  461. rmtsyscall12:
  462.   echo "speed is 1200"
  463.   echo "termmode is %fa1"
  464. rmtsyscallon:
  465.   dis -d;set fc5 yes;set fc2 "CONNECTED"
  466.   lput "\E[4C\E[31;1m%fc6 => CONNECTED.  SCRIPT: %fc7\n\r"
  467.   sleep 10
  468.   goto rmtsyscallret
  469. rmtsyscallret:
  470.      if !c||!jfc5,y goto rmtsysnogo
  471.      source zmnulgn.t
  472.      goback online
  473. rmtsysnogo:
  474.      if jfc5,y source zmnulgn.t;goback online
  475.      sets fa6 "%fa6 NOGO"
  476.      if %fc2 sets fa6 "%fa6 %fc2"
  477.      echo " CALL NOGO ";if afc1>0 gosub dwell
  478.      goback hangup
  479. busy:
  480.      putw "ATM0H1\r"
  481. reset:
  482.      put "+++";sleep 10;put "ATZ\r";sleep 10
  483.      put "%fa8";put \r;sleep 5;put \r;sleep 5;return
  484. getmyname:
  485.   type zmnuname.scr;set fc11 ""
  486.   accept  fc11 "\E[36;1m            Please enter your first name: \E[35;1m"
  487.   p?0; findq %fc11 zmnuownr.dat
  488.   if ?>0 goto getmynameOK
  489.   accept  fc12 "\E[36;1m            Please enter your last  name: \E[s\E[35;1m"
  490.   lput "\E[u\E[12C\E[36;1mHello to you.\n\r"
  491.   sets s0 %fc10;set fc10 ""
  492.   accept  fc10 "\E[36;1m            Please enter your city  name: \E[35;1m\E[s%fc10\E[u"
  493.   if !%fc10 sets fc10 %s0
  494.   sets s0 %fc9;set fc9 ""
  495.   accept  fc9 "\E[36;1m            Please enter your state abbr: \E[35;1m\E[s%fc9\E[u"
  496.   if !%fc9 sets fc9 %s0
  497.   close;sets s0 %dircx;sets dircx %lib;create -+ zmnuownr.dat
  498.   echof "%fc11 %fc12 %fc10 %fc9";close;sets dircx %s0
  499.   return
  500. getmynameOK: set ifs " ";split z0
  501.   sets fc11 %z0
  502.   sets fc12 %z1
  503.   sets fc10 %z2
  504.   sets fc9 %z3
  505.   sets s0 "%fc11 %fc12 calling from %fc10, %fc9"
  506.   setn n1 79-%s0/2
  507.   lput "\n\r\E[31;1m\E[%n1\&C%s0\E[1B\E[80D\E[28C"
  508.   acceptl1 s0 "-any key to continue-"
  509.   return
  510.   ::  The TSO system is IBM mainframe time-sharing.
  511.   ::  There are many flavors of protocol converters used.
  512.   ::  This menu system works with Renex using ZCOMM lsi-adm3a and
  513.   ::  selecting "tvi-950" on the Renex menu.
  514.   ::  The zmnu3270.kbd mk file works for the above setup.
  515. getTSOpasswd:
  516.   if %fc4 if %fc3 return
  517.   set fc3 "";set s0 "";set fc4 ""
  518.   accept  fc4 "\E[2J\E[0;36mEnter your TSO USERID:   "
  519.   accept  fc3 "\E[0;36mEnter your TSO password: \E[8m"
  520.   lput "\E[1B\E[K\E[1A"
  521.   accept  s0 "\E[0;36mCheck your TSO password: \E[8m"
  522.   if Ifc3,s0 return
  523.   lput "\E[1A\E[K\E[1A\E[K\E[2B"
  524.   lput "\E[80D\E[31;1mPassword values do not match exactly\E[2A\E[80D"
  525.   goback getTSOpasswd
  526. reset: set phones %lib/phones.t
  527.      return
  528. offyam: lput "\E[2J\E[3;1H"
  529.      if %fa9 setn n1 79-%fa9/2
  530.      if %fa9 lput "\E[10;%n1\&H\E[0;31;1m %fa9 \E[1B\E[80D"
  531.      lput "\E[34C\E[5;37;1mOFF  ZCOMM\E[1B\E[80D"
  532.      lput "\E[0;31;1m\E[24CRETURNING TO SYSTEM FROM ZCOMM\E[1B\E[80D"
  533.      sleep 20
  534.      return
  535.      :: TEST PASSWORD GENERATION
  536. testpw: lput "\E[2J\E[31;1m\E[1;34HTEST PASSWORD GENERATION\E[1B"
  537.         sets savermt %remote
  538.         sets savepw  %xpassword
  539.         acceptl remote  "\E[33;1m\E[2;5HEnter name of remote system: "
  540.         acceptl xpassword "\E[36;1m\E[3;12HEnter password value: "
  541.         lput "\E[37;1m\E[4;12HGenerated password is \PXXXXXXXX"
  542.         lput "\E[31;1m\E[5;25HAnother? "
  543.         if y goback testpw
  544.         cls
  545.         sets remote %savermt
  546.         sets xpassword %savepw
  547.         set savermt ""
  548.         set savepw ""
  549.         return
  550. download:  obey "@display nostat=off"
  551.         obey "@rb -y"
  552.         if jtermmode,A obey "@display stat=off"
  553.         obey "@ena %termmode"
  554.         return
  555. upload: obey "@display nostat=off"
  556.         acceptl upfile "\E[31;1mFilename(s) to send? "
  557.         obey "@szb %upfile"
  558.         if jtermmode,A obey "@display stat=off"
  559.         return
  560.  ::  This part of the setup script initializes the zmnuparm.t script
  561.  ::  that is the script representation of the .ini file contents and
  562.  ::  is used for speeding up the initialization process.
  563.  ::  This part of the file is placed late in the zmenu.t file in order
  564.  ::  to make the zmenu.t file more efficient.
  565. setupcold:
  566.  ::  nullify dircx and open a new zmnuparm.t file for building
  567.      ki;kill;close
  568.      sets dircx %drive:%home;create zmnuparm.t
  569.      echof "setup:";: include helpful comments in script file
  570.      echof " :: This file contains the .T commands to init your zmenu"
  571.      echof " :: system more quickly than reprocessing the .ini file."
  572.      setc s0
  573.   lput "\E[14;20HSETUP HOT START FILE RUNNING NOW"
  574.      echof "%s0"
  575.      setc s0 "    lput  \"\E[1B\E[80D\E[19C\E[s\"";echof "%s0"
  576.      lput "\E[2J\E[10;20HNow setting up user parameter values from .ini file."
  577.      lput "\E[12;20HPlease stand by...\E[1B\E[80D\E[19C"
  578.  ::  DEFINE CONSTANTS FOR ZMENU.T
  579.  ::  These are variables that are not changed by .ini file
  580.  ::  suppress informational messages from ZCOMM
  581.      pv-1;echof "    pv-1;: verbose switch"
  582.      set fc1 3;set s0 msglevel;gosub inigrab
  583.      echof "    setn fc1 %fc1"
  584.      if %s0 echof "    setn fc1 %s0"
  585.      set s0 \x22
  586.      set s1 "\E[5A\E[80D\E[25C";set s2 "\E[u"
  587.      echof "    if afc1>0 if afc1==1 echo %s0%s1 EXPERT   msglevel%s2%s0"
  588.      echof "    if afc1>0 if afc1==2 echo %s0%s1 ADVANCED msglevel%s2%s0"
  589.      echof "    if afc1>0 if afc1==3 echo %s0%s1 AVERAGE  msglevel%s2%s0"
  590.      echof "    if afc1>0 if afc1==4 echo %s0%s1 LEARNING msglevel%s2%s0"
  591.      echof "    if afc1>0 if afc1==5 echo %s0%s1 NOVICE   msglevel%s2%s0"
  592.  ::  Z: hot key column, d: set incoming dates to local, S: XON timeout
  593.      pZ72;pd1;pS5
  594.      echof " :: Z hot key col, d: incoming dates local, S: XON timeout"
  595.      echof "    pZ72;pd1;pS5"
  596.      setc s0 "    set onexit \"@gosub offyam\""
  597.      echof "%s0"
  598.  ::
  599.  ::  DEFINE VALUES HELD ONLY IN ZCOMM NUMERIC OR STRING PARAMETERS
  600.  ::  USING CONTENTS OF .INI FILE
  601.  ::
  602.  ::  inigrab gosub obtains ini data from zmnuparm.ini given s0 string
  603.  ::  In this block, we initialize user-selectable parameters of all
  604.  ::  types using file zmnuparm.ini
  605.  ::  Example of how this works:
  606.  ::  1.  set string s0 to string value to find in zmnuparm.ini
  607.  ::  2.  gosub inigrab
  608.  ::  3.  inigrab searches file zmnuparm.ini for string whose name is in s0
  609.  ::      If found, the remainder of the line after name is set in
  610.  ::      string s0.
  611.  ::  4.  Set string variable to value in s0
  612.  ::
  613.  ::  Set up our personal numeric parameters
  614.  ::
  615.  ::  colors: 0=blk    1=blu    2=grn    3=cyan    4=red    5=mag    6=brn
  616.  ::          7=white  8=gry    9=brtblu 10=ltgrn  11=ltcyan 12=ltred
  617.  ::         13=ltmag 14=ltyel 15=ltwhite
  618.  ::
  619.  ::  norm color    reverse       hilite   status   blink    dim
  620.  ::  brt yellow    mag on blu    red      dk grn   red      grey
  621.  ::
  622.  ::  set default color codes in ANSI.SYS style
  623.  ::  n=normal, h=high, b=blink, r=rev, s=stats
  624.  ::  set parameters for ZCOMM color modes
  625.      echof " ::  set default color codes in ANSI.SYS style"
  626.      echof " ::  n=normal, h=high, b=blink, r=rev, s=stats"
  627.      echof " ::  set parameters for ZCOMM color modes"
  628.      echof "    if dc pn0x0e;pr0x1d;p*0x0c;ps0x02;p@0x8c;pF0x08"
  629.  ::  if not color display, set alternatives to colors
  630.      echof "    if !dc pn0x07;pr0x70;p*0x0f;ps0x70;p@0x87;pF0x08"
  631.      set fa7 "y`\E[0;31;1m`\E[0;33;1m`";: default color modes: hi/normal
  632.      set s0 fa7;gosub inigrab;if %s0 sets fa7 "%s0"
  633.      setc s0 "    set fa7 \""
  634.      sets  s1 "%fa7";setc s2 "\""
  635.      echof "%s0%s1%s2"
  636.  ::
  637.  ::  Where are scripts stored?  This lets you use something other
  638.  ::  than the home string.
  639.      sets lib "%drive:%home";set s0 zcommlib;gosub inigrab;if %s0 sets lib %s0
  640.      echof " :: Define location of script files "
  641.      ife %s0 echof "    set lib %s0";else echof "    sets lib %drive:%home"
  642.  ::
  643.  ::  what disks are available for ZCOMM to use?
  644.      echof " :: Define which disks can be accessed"
  645.      set disks "abc";set s0 disks;gosub inigrab;if %s0 sets disks %s0
  646.      echof "    set disks %disks"
  647.  ::
  648.  ::  Set up video screen size to be used.  80 cols is almost universal.
  649.      p$80;p#24
  650.      echof " :: Define video screen cols and rows"
  651.      echof "    p$80;p#24"
  652.      set s0 scrcols;gosub inigrab
  653.      if %s0 echof "    p$%s0"
  654.      set s0 scrrows;gosub inigrab
  655.      if %s0 echof "    p#%s0"
  656.  ::
  657.  ::  support graphic displays by default.  Pick up user's termmode
  658.      set fa1 -8n;set s0 termmode;gosub inigrab;if %s0 sets fa1 "%s0"
  659.      echof "    set fa1 %fa1"
  660.  ::
  661.  ::  Set up cpuspeed pa... numeric variable
  662.      set s0 cpuspeed;gosub inigrab;if %s0 sets s1 "pa%s0";sets s0 %s1
  663.      if %s0 echof " :: Override cpu speed"
  664.      if %s0 echof "    %s0"
  665.  ::
  666.  ::  string kbd101 says whether you use 101-key keyboard
  667.  ::  Setting kbd101 yes when you don't have one causes ZCOMM to loop
  668.  ::  numeric parm pK
  669.      set s0 kbd101;gosub inigrab;pK0;if js0,y pK1
  670.      if js0,y echof "    pK1;: declare 101-key keyboard in use"
  671.      set s0 "\x22"
  672.      echof "    if afc1>4 echo %s0 101-key keyboard in use %s0"
  673.  ::
  674.  ::  strings:  KERMITx in zmnuparm.ini are used to set values
  675.  ::
  676.  ::  defaults are set in following section
  677.  ::  K=y is auto-download enable for Kermit
  678.      set s0 KERMITK;gosub inigrab;if js0,y ena -K;echof "    ena -K;: enable kermit auto-download"
  679.  ::  L/l is for kermit protocol packet size
  680.      set s0 KERMITl;gosub inigrab;kermit pl94;echof "    kermit pl94"
  681.      if %s0 sets s1 "kermit pl%s0";sets s0 "%s1";echof "    %s0"
  682.      set s0 KERMITL;gosub inigrab;kermit pL94;echof "    kermit pL94"
  683.      if %s0 sets s1 "kermit pL%s0";sets s0 "%s1";echof "    %s0"
  684.  ::  s is timeout for XON
  685.      set s0 KERMITs;gosub inigrab;kermit ps5;echof "    kermit ps5"
  686.      if %s0 sets s1 "kermit ps%s0";sets s0 "%s1";echof "    %s0"
  687.  ::  w is window size for sliding windows
  688.      set s0 KERMITw;gosub inigrab;pw31;echof "    kermit ps31"
  689.      if %s0 sets s1 "kermit pw%s0";sets s0 "%s1";echof "    %s0"
  690.  ::  7 is 7-bit transmission mode (usually needed for IBM mainframe
  691.  ::  kermit flavors)
  692.      set s0 KERMIT7;gosub inigrab;kermit p71;echof "    kermit p71"
  693.      if %s0 sets s1 "kermit p7%s0";sets s0 "%s1";echof "    %s0"
  694.  ::
  695.  ::  menumode=on/off   on:  menus return to menu display
  696.  ::  fa12=menumode/menuinit/menupage/timezone_name/
  697.  ::  menumode is stored in variable fa12 as "y`" or "n`" 1st string
  698.      set fa12 "off`";set s0 menumode;gosub inigrab;if %s0 sets fa12 "%s0\&`"
  699.      sets s0 "%fa12"
  700.      setc fa12 "%s0\&y`"
  701.      set s0 menupage;gosub inigrab;sets s1 "%fa12";sets s2 %s0
  702.      setc fa12 "e`";set s2 ""
  703.      if %s0 sets s2 %s0;setc fa12 "%s0\&`"
  704.      sets fa11 "%lib/zmnufone.scr"
  705.      if %s2 setc fa11 %lib/zmnufon%s2\&.scr
  706.  ::  Record default menupage value in fa11 for menufone filename
  707.      echof "    set fa11 %fa11"
  708.      setc s0 "%s1\&%fa12"
  709.      sets fa12 "%s0"
  710.      set s0 timezone;gosub inigrab;sets s1 "%fa12"
  711.      set fa12 EST;if %s0 sets fa12 "%s0"
  712.      if ifa12,GMT pz0
  713.      if ifa12,EST pz300
  714.      if ifa12,EDT pz240
  715.      if ifa12,CST pz360
  716.      if ifa12,CDT pz300
  717.      if ifa12,MST pz420
  718.      if ifa12,MDT pz360
  719.      if ifa12,PST pz480
  720.      if ifa12,PDT pz420
  721.      if ifa12,AST pz460
  722.  ::  OK, so what timezone names for Alaska and Hawaii??
  723.      setc s0 "%s1\&%fa12\&`"
  724.      sets fa12 "%s0";echof "    set fa12 %s0"
  725.  ::
  726.  ::  modem initialization string defined by user as "modeminit"
  727.      set fa8 "ATS11=45L1H&C1";set s0 modeminit;gosub inigrab
  728.      set s1 \x22
  729.      if %s0 setc fa8 "%s0"
  730.      echof "    set fa8 %s1%fa8%s1"
  731.  ::
  732.  ::  pick up modem speed
  733.      set fa10 1200;set s0 modemspeed;gosub inigrab;if %s0 sets fa10 %s0
  734.      if %s0 sets s1 "speed %s0";sets s0 "%s1"
  735.      echof "    %s0"
  736.      echof "    set fa10 %fa10"
  737.  ::
  738.  ::  init modem with user's string
  739.      set s0 \x22
  740.      echof "    if afc1>4 echof %s0 Issuing modem init string %s0"
  741.      set s0 "\""
  742.      set s1 "\\"
  743.      set s2 "r"
  744.      echof "    put %s0+++%s0;sleep 5"
  745.      echof "    put %s0%fa8%s1%s2%s0;sleep 5"
  746.      echof "    put %s0%s1%s2%s0"
  747.      echof "    ki;kill;close"
  748.  ::
  749.  ::  string partfile says whether you want to keep partial downloaded files
  750.  ::  any value other than "keep" means delete.
  751.      set s0 partfile;gosub inigrab;if !jpartfile,keep pR1;echof "    pR1"
  752.  ::
  753.  ::  set up some common function key values (allow zmnuparm.ini override)
  754.      set f6 "@accept s2 Receive-File:;rc %s2";set s0 f6;gosub inigrab
  755.      setc s0 "\"";setc s1 "\""
  756.      if %f6 echof "    set f6 %s0%f6%s1"
  757.      set f7 "@accept s1 Send-File:;sz %s1";set s0 f7;gosub inigrab
  758.      setc s0 "\"";setc s1 "\""
  759.      if %f7 echof "    set f7 %s0%f7%s1"
  760.  ::
  761.  ::  what sort of handshake do you use?
  762.      set s0 handshake;gosub inigrab
  763.      if %s0 sets s1 %s0;sets s0 "ha %s1";echof "%s0"
  764.  ::
  765.  ::  what dialing prefix does your modem use?
  766.      set mprefix "ATDP";set s0 mprefix;gosub inigrab;if %s0 sets mprefix %s0
  767.      echof "    set mprefix %mprefix"
  768.  ::
  769.  ::  menutitle for menu pages
  770.  ::  set menutitle "";set s0 menutitle;gosub inigrab
  771.      set fa9 "";set s0 menutitle;gosub inigrab;if %s0 sets fa9 "%s0"
  772.      if %s0 setc s1 "    set fa9 \"";sets s2 "%s1%s0";setc s0 "%s2\""
  773.      echof "%s0"
  774.  ::
  775.  ::  process display stuff mndispl1, mndispl2, emulate for video
  776.  ::  emulate         fa5   whole variable
  777.  ::  mndispl1        fa4   whole variable
  778.  ::  mndispl2        fa3   whole variable
  779.      set fa4 "";set fa3 "";set fa5 vt100
  780.      set s0 emulate;gosub inigrab
  781.      if %s0 setc s1 "\"";sets fa5 " display %s0";sets s2 "    set fa5 %s1 display %s0 %s1";echof "%s2"
  782.      set s0 mndispl1;gosub inigrab
  783.      if %s0 setc s1 "\"";sets fa4 " display %s0";sets s2 "    set fa4 %s1 display %s0 %s1";echof "%s2"
  784.      set s0 mndispl2;gosub inigrab
  785.      if %s0 setc s1 "\"";sets fa3 " display %s0";sets s2 "    set fa3 %s1 display %s0 %s1";echof "%s2"
  786.      echof " %fa5";echof " %fa4";echof " %fa3"
  787.      mk
  788.      set fc11 "";set fc12 "";: first and last name variables
  789.  ::
  790.  ::  set up directory names where to capture/ZCOMM/download/upload
  791.  ::  Set up defaults to point using symbolic drive, home directories
  792.      sets dircx "%drive:/capture";set s0 dircx;gosub inigrab;if %s0 sets dircx "%s0"
  793.      sets dirfx "%drive:%home";set s0 dirfx;gosub inigrab;if %s0 sets dirfx "%s0"
  794.      sets dirrx "%drive:/download";set s0 dirrx;gosub inigrab;if %s0 sets dirrx "%s0"
  795.      sets dirsx "%drive:/upload";set s0 dirsx;gosub inigrab;if %s0 sets dirsx "%s0"
  796.      echof "    set dircx %dircx;: capture "
  797.      echof "    set dirfx %dirfx;: files"
  798.      echof "    set dirrx %dirrx;: download"
  799.      echof "    set dirsx %dirsx;: upload/send"
  800.      set s0 \x22
  801.      echof "    if afc1>0 echof %s0 zmnuparm.t complete %s0"
  802.      close;goback setuphot
  803.  : ==== System names to call
  804. vaxlug:  goback rmtcall
  805. customs: goback rmtcall
  806. follies: goback rmtcall
  807. freesp:  goback rmtcall
  808. freesp2: goback rmtcall
  809. glib:    goback rmtcall
  810. glib1:   goback rmtcall
  811. glib2:   goback rmtcall
  812. glib3:   goback rmtcall
  813. mframe:  goback rmtcall
  814.