home *** CD-ROM | disk | FTP | other *** search
/ Piper's Pit BBS/FTP: ibm 0020 - 0029 / ibm0020-0029 / ibm0028.tar / ibm0028 / BLST10_1.ZIP / BLASTDIR / SYSTEMS.SCR < prev   
Encoding:
Text File  |  1990-09-25  |  52.7 KB  |  2,471 lines

  1. #INDEX
  2. >None    00000705 000030
  3. >PC      00000710 000031
  4. >Mac     00000716 000032
  5. >Slave   00000724 000033
  6. >Wang    00000731 000034
  7. >BHost   00001926 000094
  8. >Satellit00001937 000095
  9. >Unix    00007743 000347
  10. >Xenix   00007751 000348
  11. >AIX     00007757 000349
  12. >Ultrix  00007766 000350
  13. >SunOS   00007774 000351
  14. >A/UX    00007781 000352
  15. >Demo    00007788 000353
  16. >VMS     00015723 000690
  17. >AOS     00023098 001013
  18. >CEO     00030819 001357
  19. >MVS/TSO 00038627 001714
  20. >VM/CMS  00041705 001871
  21. >Primos  00044798 002025
  22. >HP1000  00047907 002171
  23. >HP3000  00050847 002316
  24. :
  25. #########################################################
  26. #
  27. # Slave or other system running BLAST w/o logins
  28. #
  29. :None
  30. :PC
  31. :Mac
  32. :Slave
  33. :Wang
  34. #
  35. # No LOGON required on PC's or slave scripts
  36. #
  37. .LOGON
  38.     if @USERIF = "1" and @SCRFILE = "AutoPoll"
  39.         set @SCRLREG = "1"
  40.         cursor 12,0
  41.         put " "
  42.         cursor 12,0
  43.         put "   * "
  44.         cursor 12,15
  45.         put "No logon required for ",@SYSTYPE," system"
  46.         set @SCRLREG = "0"
  47.     end
  48.     return 0
  49. .LOGOFF
  50.     if @USERIF = "1" and @SCRFILE = "AutoPoll"
  51.         set @SCRLREG = "1"
  52.         cursor 14,0
  53.         put " "
  54.         cursor 14,0
  55.         put "   *"
  56.         cursor 14,15
  57.         put "No logoff required for ",@SYSTYPE," system"
  58.         set @SCRLREG = "0"
  59.     end
  60.     return 0
  61. .TRANSFER
  62.     if @USERIF = "1" and @SCRFILE = "AutoPoll"
  63.         set @SCRLREG = "1"
  64.         cursor 13,0
  65.         put " "
  66.         cursor 13,0
  67.         put "--> "
  68.         cursor 13,15
  69.         put "Waiting for BLAST protocol"
  70.         set @SCRLREG = "0"
  71.     end
  72.     return 0
  73. .UPLOAD
  74.     if @SCRFILE = "AutoPoll"
  75.         werror "UPLOAD not supported"
  76.         fwrite 4, "                  >> UPLOAD not supported"
  77.         return -2
  78.     end
  79.     ask "enter filename to upload", @filename
  80.     if null @filename return 0
  81.     if exist @filename goto .UPL10
  82.     werror "can't open ", @filename
  83.     return 1
  84. .UPL10
  85.     tupload @filename
  86.     return 0
  87. .END
  88. :
  89. #########################################################
  90. #
  91. # BLAST Plus Host Systems
  92. #
  93. :BHost
  94. :Satellit
  95. #
  96. # LOGON to remote BLAST Plus Host system
  97. #
  98. .LOGON
  99.     if not null @USERID goto .LOG10
  100.     if @SCRFILE not = "AutoPoll" ask "enter account", @USERID
  101.     if null @USERID goto .LOG20
  102. .LOG10
  103.     if not null @PASSWORD goto .LOG15
  104.     if @SCRFILE not = "AutoPoll"
  105.         ask noecho "enter password", @PASSWORD
  106.         if null @PASSWORD return 0
  107.         goto .LOG15
  108.     end
  109.     fwrite 4, "                  >> CHECK SETUP FILE (",@su_fil,") - No PASSWORD specified"
  110.     if @USERIF = "1"
  111.         set @SCRLREG = "1"
  112.         cursor 12,0
  113.         put " "
  114.         cursor 12,0
  115.         put "   X"
  116.         cursor 12,15
  117.         put "SETUP FILE ",@su_fil," - No PASSWORD specified"
  118.         cleol
  119.         set @SCRLREG = "0"
  120.     end
  121.     return -2
  122. .LOG15
  123.     if @USERIF = "1" and @SCRFILE = "AutoPoll"
  124.         set @SCRLREG = "1"
  125.         cursor 12,0
  126.         put " "
  127.         cursor 12,0
  128.         put "--> "
  129.         set @SCRLREG = "0"
  130.     end
  131.     reps 5
  132. .LOG20
  133.     if @USERIF = "1" and @SCRFILE = "AutoPoll"
  134.         set @SCRLREG = "1"
  135.         cursor 12,15
  136.         put " "
  137.         cursor 12,15
  138.         put "Looking for ",@SYSTYPE," logon prompt"
  139.         cleol
  140.         set @SCRLREG = "0"
  141.     end
  142.     tsend CR
  143.     ttrap 10 "in:","tocol",">","\\","word:"
  144.     if @STATUS = "1" goto .LOG30
  145.     if @STATUS = "2" or @STATUS = "3" or @STATUS = "4" goto .LOG50
  146.     if @STATUS = "5"
  147.         tsend CR
  148.         wait 1 idle
  149.     end
  150. .LOG25
  151.     tsend "\021"
  152.     if @SCRFILE = "AutoPoll" fwrite 4, "                  * Attempting to get ",@SYSTYPE," system's attention"
  153.     if reps goto .LOG20
  154. #
  155. #    Can't log in, inform user and exit
  156. #
  157.     if @SCRFILE = "AutoPoll" fwrite 4, "                  >> CHECK SETUP FILE (",@su_fil,") - Remote not responding with Userid prompt for ",@SYSTYPE
  158.     else return 1
  159.     if @USERIF = "1"
  160.         set @SCRLREG = "1"
  161.         cursor 12,0
  162.         put " "
  163.         cursor 12,0
  164.         put "   X "
  165.         cursor 12,15
  166.         put "CHECK SETUP ",@su_fil," - Wrong System Type?"
  167.         cleol
  168.         set @SCRLREG = "0"
  169.     end
  170.     return -2
  171. #
  172. .LOG30
  173.     if @USERIF = "1" and @SCRFILE = "AutoPoll"
  174.         set @SCRLREG = "1"
  175.         cursor 12,15
  176.         put " "
  177.         cursor 12,15
  178.         put "Sending UserId"
  179.         cleol
  180.         set @SCRLREG = "0"
  181.     end
  182.     tsend @USERID, CR            # enter USERID
  183.     ttrap 5 "word:","tocol",">","\\","in:"
  184.     if @STATUS = "2" or @STATUS = "3" or @STATUS = "4" goto .LOG50
  185.     if @STATUS not = "1" goto .LOG55
  186.     if @USERIF = "1" and @SCRFILE = "AutoPoll"
  187.         set @SCRLREG = "1"
  188.         cursor 12,15
  189.         put " "
  190.         cursor 12,15
  191.         put "Sending Password"
  192.         cleol
  193.         set @SCRLREG = "0"
  194.     end
  195.     tsend @PASSWORD, CR            # enter PASSWORD
  196.     ttrap 10 "tocol",">","\\","Invalid"
  197.     if @STATUS = "0" or @STATUS ="4" goto .LOG55
  198. .LOG50
  199.     if @USERIF = "0" or @SCRFILE NOT = "AutoPoll" return 0
  200.     set @SCRLREG = "1"
  201.     cursor 12,0
  202.     put " "
  203.     cursor 12,0
  204.     put "   *"
  205.     cursor 12,15
  206.     put "Logged on"
  207.     cleol
  208.     set @SCRLREG = "0"
  209.     return 0                            # got a system prompt
  210. #
  211. #    Incorrect USERID/PASSWORD - perhaps it was corrupted in transit
  212. #
  213. .LOG55
  214.     if @SCRFILE = "AutoPoll" fwrite 4, "                  * Re-trying LOGIN - noise may have corrupted Username/Password exchange"
  215.     if reps goto .LOG20
  216.     if @SCRFILE = "AutoPoll" fwrite 4, "                  >> CHECK SETUP FILE (",@su_fil,") - Userid/Password not valid or noisy line"
  217.     else return 1
  218.     if @USERIF = "1"
  219.         set @SCRLREG = "1"
  220.         cursor 12,0
  221.         put " "
  222.         cursor 12,0
  223.         put "   X"
  224.         cursor 12,15
  225.         put "CHECK SETUP ",@su_fil," - bad UserID/Password or line noise"
  226.         cleol
  227.         set @SCRLREG = "0"
  228.     end
  229.     return -2
  230. #
  231. #    LOGOFF the remote system
  232. #
  233. .LOGOFF
  234.     if @USERIF = "1" and @SCRFILE = "AutoPoll"
  235.         set @SCRLREG = "1"
  236.         cursor 14,0
  237.         put " "
  238.         cursor 14,0
  239.         put "--> "
  240.         cursor 14,15
  241.         put "Looking for operating system prompt"
  242.         set @SCRLREG = "0"
  243.     end
  244.     reps 4                    # try 4 times
  245. #
  246. .LGF10
  247.     tsend CR                # get system prompt
  248.     ttrap 10 "in:","word:","ogout at","tocol",">","\\"
  249.     if @STATUS = "1" or @STATUS = "2" or @STATUS = "3" goto .LGF20
  250.     if @STATUS = "4" tsend ";DISC.",CR
  251.     if @STATUS = "5" or @STATUS = "6" tsend "\033\014"
  252.     tsend "\021"
  253. #
  254.     if reps goto .LGF10
  255. #
  256. #    Unable to get anything recognizable - abort
  257. #
  258.     if @SCRFILE = "AutoPoll" fwrite 4, "                  >> CHECK SETUP FILE (",@su_fil,") - LOGOFF Failed: Remote not responding as expected for ",@SYSTYPE
  259.     else return 1
  260.     if @USERIF = "1"
  261.         set @SCRLREG = "1"
  262.         cursor 14,0
  263.         put " "
  264.         cursor 14,0
  265.         put "   X"
  266.         cursor 14,15
  267.         put "CHECK SETUP ",@su_fil," - Could not find operating system prompt"
  268.         cleol
  269.     if @SCRFILE = "AutoPoll" set @SCRLREG = "0"
  270.     end
  271.     return -2
  272. #
  273. .LGF20                        # VMS logout
  274.     if @USERIF = "1" and @SCRFILE = "AutoPoll"
  275.         set @SCRLREG = "1"
  276.         cursor 14,0
  277.         put " "
  278.         cursor 14,0
  279.         put "   *"
  280.         cursor 14,15
  281.         put "Logged off"
  282.         cleol
  283.         set @SCRLREG = "0"
  284.     end
  285.     return 0
  286. #
  287. #
  288. #    UPLOAD a file to the remote system
  289. #
  290. .UPLOAD
  291.     if @SCRFILE = "AutoPoll"
  292.         werror "UPLOAD not supported by AutoPoll"
  293.         fwrite 4, "                  >> UPLOAD not supported"
  294.         return -2
  295.     end
  296.     return 1
  297. #
  298. #    START file transfer on remote system
  299. #
  300. .TRANSFER
  301.     if @USERIF = "1" and @SCRFILE = "AutoPoll"
  302.         set @SCRLREG = "1"
  303.         cursor 13,0
  304.         put " "
  305.         cursor 13,0
  306.         put "--> "
  307.         cursor 13,15
  308.         put "Waiting for BLAST protocol"
  309.         cleol
  310.         set @SCRLREG = "0"
  311.     end
  312.     reps 4
  313. #
  314. .TRANS10
  315.     tsend CR
  316.     ttrap 5 "tocol",">","\\"
  317.     if @STATUS = "1" return 0
  318. .TRANS15
  319.     if reps
  320.         tsend "\021\033\030"
  321.         goto .TRANS10
  322.     end
  323. #
  324. #    Unable to get anything recognizable on remote computer - abort
  325. #
  326.     if @SCRFILE = "AutoPoll" fwrite 4, "                  >> CHECK REMOTE SYSTEM - Unable to get ",@SYSTYPE," system prompt after login"
  327.     else return 1
  328.     if @USERIF = "1"
  329.         set @SCRLREG = "1"
  330.         cursor 13,0
  331.         put " "
  332.         cursor 13,0
  333.         put "  X "
  334.         cursor 13,15
  335.         put "CHECK REMOTE - System not responding in time"
  336.         cleol
  337.         set @SCRLREG = "0"
  338.     end
  339.     return -3
  340. .END
  341. :
  342. #########################################################
  343. #
  344. # AT&T Unix and similar systems
  345. #
  346. :Unix
  347. :Xenix
  348. :AIX
  349. :Ultrix
  350. :SunOS
  351. :A/UX
  352. :Demo
  353. #
  354. # LOGON to remote UNIX(-like) system
  355. #
  356. .LOGON
  357.     if not null @USERID goto .LOG10
  358.     if @SCRFILE not = "AutoPoll"
  359.         ask "enter account", @USERID
  360.         if null @USERID return 0
  361.         goto .LOG10
  362.     end
  363.     fwrite 4, "                  >> CHECK SETUP FILE (",@su_fil,") - No USERID specified"
  364.     if @USERIF = "1"
  365.         set @SCRLREG = "1"
  366.         cursor 12,0
  367.         put " "
  368.         cursor 12,0
  369.         put "   X"
  370.         cursor 12,15
  371.         put "SETUP FILE ",@su_fil," - No USERID specified"
  372.         cleol
  373.         set @SCRLREG = "0"
  374.     end
  375.     return -2
  376. .LOG10
  377.     if not null @PASSWORD goto .LOG15
  378.     if @SCRFILE not = "AutoPoll"
  379.         ask noecho "enter password", @PASSWORD
  380.         if null @PASSWORD return 0
  381.         goto .LOG15
  382.     end
  383.     fwrite 4, "                  >> CHECK SETUP FILE (",@su_fil,") - No PASSWORD specified"
  384.     if @USERIF = "1"
  385.         set @SCRLREG = "1"
  386.         cursor 12,0
  387.         put " "
  388.         cursor 12,0
  389.         put "   X"
  390.         cursor 12,15
  391.         put "SETUP FILE ",@su_fil," - No PASSSWORD specified"
  392.         cleol
  393.         set @SCRLREG = "0"
  394.     end
  395.     return -2
  396. .LOG15
  397.     if @USERIF = "1" and @SCRFILE = "AutoPoll"
  398.         set @SCRLREG = "1"
  399.         cursor 12,0
  400.         put " "
  401.         cursor 12,0
  402.         put "--> "
  403.         set @SCRLREG = "0"
  404.     end
  405.     reps 5
  406. .LOG20
  407.     if @USERIF = "1" and @SCRFILE = "AutoPoll"
  408.         set @SCRLREG = "1"
  409.         cursor 12,15
  410.         put " "
  411.         cursor 12,15
  412.         put "Looking for ",@SYSTYPE," logon prompt"
  413.         cleol
  414.         set @SCRLREG = "0"
  415.     end
  416.     tsend CR, CR
  417.     ttrap 5 "ogin:","word:","$","#","%","ogin incorrect"
  418.     if @STATUS = "1" goto .LOG30
  419.     if @STATUS = "2"
  420.         tsend CR
  421.         goto .LOG20
  422.     end
  423.     if @STATUS = "3" or @STATUS = "4" or @STATUS = "5"
  424.         tsend "exit", CR
  425.         goto .LOG20
  426.     end
  427. .LOG25
  428.     tsend "\021\377"
  429.     if @SCRFILE = "AutoPoll" fwrite 4, "                  * Attempting to get ",@SYSTYPE," system's attention"
  430.     if reps goto .LOG20
  431. #
  432. #    Can't log in, inform user and exit
  433. #
  434.     if @SCRFILE = "AutoPoll" fwrite 4, "                  >> CHECK SETUP FILE (",@su_fil,") - Remote not responding with Userid prompt for ",@SYSTYPE
  435.     else return 1
  436.     if @USERIF = "1"
  437.         set @SCRLREG = "1"
  438.         cursor 12,0
  439.         put " "
  440.         cursor 12,0
  441.         put "   X "
  442.         cursor 12,15
  443.         put "CHECK SETUP ",@su_fil," - Wrong System Type?"
  444.         cleol
  445.         set @SCRLREG = "0"
  446.     end
  447.     return -2
  448. #
  449. .LOG30
  450.     if @USERIF = "1" and @SCRFILE = "AutoPoll"
  451.         set @SCRLREG = "1"
  452.         cursor 12,15
  453.         put " "
  454.         cursor 12,15
  455.         put "Sending UserId"
  456.         cleol
  457.         set @SCRLREG = "0"
  458.     end
  459.     tsend @USERID, CR            # enter USERID
  460.     ttrap 10 "word:","$","#","%","ogin incorrect"
  461.     if @STATUS = "2" or @STATUS = "3" or @STATUS = "4" goto .LOG50
  462.     if @STATUS = "0" or @STATUS = "5" goto .LOG25
  463.     if @USERIF = "1" and @SCRFILE = "AutoPoll"
  464.         set @SCRLREG = "1"
  465.         cursor 12,15
  466.         put " "
  467.         cursor 12,15
  468.         put "Sending Password"
  469.         cleol
  470.         set @SCRLREG = "0"
  471.     end
  472.     tsend @PASSWORD, CR            # enter PASSWORD
  473.     ttrap 20 "$","#","%","your name","ogin incorrect"
  474.     if @STATUS = "1" or @STATUS = "2" or @STATUS = "3" goto .LOG70
  475.     if @STATUS = "4" goto .LOG50
  476. #
  477. #    Incorrect USERID/PASSWORD - perhaps it was corrupted in transit
  478. #
  479.     if @SCRFILE = "AutoPoll" fwrite 4, "                  * Re-trying LOGIN - noise may have corrupted Username/Password exchange"
  480.     if reps goto .LOG20
  481.     if @SCRFILE = "AutoPoll" fwrite 4, "                  >> CHECK SETUP FILE (",@su_fil,") - Userid/Password not valid or noisy line"
  482.     else return 1
  483.     if @USERIF = "1"
  484.         set @SCRLREG = "1"
  485.         cursor 12,0
  486.         put " "
  487.         cursor 12,0
  488.         put "   X"
  489.         cursor 12,15
  490.         put "CHECK SETUP ",@su_fil," - bad UserID/Password or line noise"
  491.         cleol
  492.         set @SCRLREG = "0"
  493.     end
  494.     return -2
  495. .LOG50
  496.     upper @SYSTYPE
  497.     if @SYSTYPE not = "DEMO" goto .LOG70
  498.     if @SCRFILE = "AutoPoll" set @value = @SCRFILE
  499.     else ask "Please enter your name" @value
  500.     if null @value goto .LOG50
  501.     tsend @value, CR
  502.     ttrap 10 "$","#","%","company"
  503.     if @STATUS not = "4" goto .LOG50
  504. .LOG60
  505.     if @SCRFILE not = "AutoPoll" ask "Please enter your company name" @value
  506.     if null @value goto .LOG60
  507.     tsend @value, CR
  508. .LOG70
  509.     if @USERIF = "0" or @SCRFILE NOT = "AutoPoll" return 0
  510.     set @SCRLREG = "1"
  511.     cursor 12,0
  512.     put " "
  513.     cursor 12,0
  514.     put "   *"
  515.     cursor 12,15
  516.     put "Logged on"
  517.     cleol
  518.     set @SCRLREG = "0"
  519.     return 0                            # got a system prompt
  520. #
  521. #    LOGOFF the remote system
  522. #
  523. .LOGOFF
  524.     if @USERIF = "1" and @SCRFILE = "AutoPoll"
  525.         set @SCRLREG = "1"
  526.         cursor 14,0
  527.         put " "
  528.         cursor 14,0
  529.         put "--> "
  530.         cursor 14,15
  531.         put "Looking for operating system prompt"
  532.         set @SCRLREG = "0"
  533.     end
  534.     reps 4                    # try 4 times
  535. #
  536. .LGF10
  537.     tsend CR                # get system prompt
  538.     ttrap 5 "ogin:","word:","$","#","%","ogin incorrect",">"
  539.     if @STATUS = "1" or @STATUS = "2" or @STATUS = "6" goto .LGF25
  540.     if @STATUS not = "0" goto .LGF20
  541. #
  542.     if reps
  543.         tsend "\021\377"
  544.         goto .LGF10
  545.     end
  546. #
  547. #    Unable to get anything recognizable - abort
  548. #
  549.     if @SCRFILE not = "AutoPoll" return 1
  550.     fwrite 4, "                  >> CHECK SETUP FILE (",@su_fil,") - LOGOFF Failed: Remote not responding as expected for ",@SYSTYPE
  551.     if @USERIF = "1"
  552.         set @SCRLREG = "1"
  553.         cursor 14,0
  554.         put " "
  555.         cursor 14,0
  556.         put "   X"
  557.         cursor 14,15
  558.         put "CHECK SETUP ",@su_fil," - Could not find operating system prompt"
  559.         cleol
  560.         set @SCRLREG = "0"
  561.     end
  562.     return -2
  563. #
  564. .LGF20                        # VMS logout
  565.     tsend  "exit",CR
  566. .LGF25
  567.     if @USERIF = "1" and @SCRFILE = "AutoPoll"
  568.         set @SCRLREG = "1"
  569.         cursor 14,0
  570.         put " "
  571.         cursor 14,0
  572.         put "   *"
  573.         cursor 14,15
  574.         put "Logged off"
  575.         cleol
  576.         set @SCRLREG = "0"
  577.     end
  578.     return 0
  579. #
  580. #
  581. #    UPLOAD a file to the remote system
  582. #
  583. .UPLOAD
  584.     if @SCRFILE = "AutoPoll"
  585.         werror "UPLOAD not supported"
  586.         fwrite 4, "                  >> UPLOAD not supported"
  587.         return -2
  588.     end
  589.     ask "enter remote filename or <RETURN> to upload to system", @remotefn
  590.     if null @remotefn goto .UPL20
  591.     tsend cr
  592.     ttrap 5 "$","#","%"
  593.     if 0 return 1
  594. #
  595. #    If no remote filename given, assume file already open on receiving system
  596. #
  597.     tsend "ed ", @remotefn, cr      # start the ed
  598.     ttrap 2
  599.     tsend "a", cr           # put it into append mode
  600. .UPL20
  601.     tupload @filename
  602.     wait 2 idle
  603. #
  604.     if null @remotefn return 0
  605.     tsend cr, ".", cr
  606.     ttrap 2
  607.     tsend "w", cr
  608.     ttrap 2
  609.     tsend "q", cr
  610.     ttrap 8 "$","%","#"
  611.     if 1 or 2 return 0
  612.     if 3 return 0
  613.     return 1
  614. #
  615. #    START file transfer on remote system
  616. #
  617. .TRANSFER
  618.     if @USERIF = "1" and @SCRFILE = "AutoPoll"
  619.         set @SCRLREG = "1"
  620.         cursor 13,0
  621.         put " "
  622.         cursor 13,0
  623.         put "--> "
  624.         cursor 13,15
  625.         put "Looking for operating system prompt"
  626.         set @SCRLREG = "0"
  627.     end
  628.     reps 4
  629. .TRANS10
  630.     tsend CR
  631. .TRANS12
  632.     ttrap 10 "$","#","%","protocol","ppp","not found",">"
  633.     if @STATUS = "4" or @STATUS = "5" return 0
  634.     if @STATUS = "1" or @STATUS = "2" or @STATUS = "3" goto .TRANS20
  635.     if @STATUS = "0" or @SCRFILE = not "AutoPoll" goto .TRANS15
  636.     fwrite 4, "                  * CHECK REMOTE SYSTEM - blast executable(s) not in PATH"
  637.     if @USERIF = "1"
  638.         set @SCRLREG = "1"
  639.         cursor 13,0
  640.         put " "
  641.         cursor 13,0
  642.         put "   X"
  643.         cursor 13,15
  644.         put "CHECK REMOTE SYSTEM - blast executable(s) not in PATH"
  645.         cleol
  646.         set @SCRLREG = "0"
  647.     end
  648.     return -3
  649. .TRANS15
  650.     if reps
  651.         tsend "\021\377"
  652.         goto .TRANS10
  653.     end
  654. #
  655. #    Unable to get anything recognizable on remote computer - abort
  656. #
  657.     if @SCRFILE not = "AutoPoll" return 1
  658.     fwrite 4, "                  >> CHECK REMOTE SYSTEM - Unable to get ",@SYSTYPE," system prompt after login"
  659.     if @USERIF = "1"
  660.         set @SCRLREG = "1"
  661.         cursor 13,0
  662.         put " "
  663.         cursor 13,0
  664.         put "  X "
  665.         cursor 13,15
  666.         put "CHECK REMOTE - System not responding in time"
  667.         cleol
  668.         set @SCRLREG = "0"
  669.     end
  670.     return -3
  671. .TRANS20
  672.     tsend "blast -h",CR               # invoke BLAST in host mode
  673.     if @USERIF = "1" and @SCRFILE = "AutoPoll"
  674.         set @SCRLREG = "1"
  675.         cursor 13,15
  676.         put " "
  677.         cursor 13,15
  678.         put "Waiting for BLAST protocol"
  679.         cleol
  680.         set @SCRLREG = "0"
  681.     end
  682.     goto .TRANS12
  683. .END
  684. :
  685. #########################################################
  686. #
  687. # Digital Equipment Corp (DEC) VAX VMS
  688. #
  689. :VMS
  690. #
  691. # LOGON to the remote VAX
  692. #
  693. .LOGON
  694.     if not null @USERID goto .LOG10
  695.     if @SCRFILE not = "AutoPoll"
  696.         ask "enter account", @USERID
  697.         if null @USERID return 0
  698.         goto .LOG10
  699.     end
  700.     fwrite 4, "                  >> CHECK SETUP FILE (",@su_fil,") - No USERID specified"
  701.     if @USERIF = "1"
  702.         set @SCRLREG = "1"
  703.         cursor 12,0
  704.         put " "
  705.         cursor 12,0
  706.         put "   X"
  707.         cursor 12,15
  708.         put "SETUP FILE ",@su_fil," - No USERID specified"
  709.         cleol
  710.         set @SCRLREG = "0"
  711.     end
  712.     return -2
  713. .LOG10
  714.     if not null @PASSWORD goto .LOG15
  715.     if @SCRFILE not = "AutoPoll"
  716.         ask noecho "enter password", @PASSWORD
  717.         if null @PASSWORD return 0
  718.         goto .LOG15
  719.     end
  720.     fwrite 4, "                  >> CHECK SETUP FILE (",@su_fil,") - No PASSWORD specified"
  721.     if @USERIF = "1"
  722.         set @SCRLREG = "1"
  723.         cursor 12,0
  724.         put " "
  725.         cursor 12,0
  726.         put "   X"
  727.         cursor 12,15
  728.         put "SETUP FILE ",@su_fil," - No PASSWORD specified"
  729.         cleol
  730.         set @SCRLREG = "0"
  731.     end
  732.     return -2
  733. .LOG15
  734.     if @USERIF = "1" and @SCRFILE = "AutoPoll"
  735.         set @SCRLREG = "1"
  736.         cursor 12,0
  737.         put " "
  738.         cursor 12,0
  739.         put "--> "
  740.         set @SCRLREG = "0"
  741.     end
  742.     reps 5
  743. .LOG20
  744.     if @USERIF = "1" and @SCRFILE = "AutoPoll"
  745.         set @SCRLREG = "1"
  746.         cursor 12,15
  747.         put " "
  748.         cursor 12,15
  749.         put "Looking for ",@SYSTYPE," Username prompt"
  750.         cleol
  751.         set @SCRLREG = "0"
  752.     end
  753.     tsend CR, CR
  754.     ttrap 5 "name:","word:","$","authorization fail"
  755.     if @STATUS = "1" goto .LOG30
  756.     if @STATUS = "2"
  757.         tsend CR
  758.         goto .LOG20
  759.     end
  760.     if @STATUS = "3"
  761.         tsend "LOGOFF", CR
  762.         goto .LOG20
  763.     end
  764. .LOG25
  765.     tsend "\021\031"
  766.     if @SCRFILE = "AutoPoll" fwrite 4, "                  * Attempting to get ",@SYSTYPE," system's attention"
  767.     if reps goto .LOG20
  768. #
  769. #    Can't log in, inform user and exit
  770. #
  771.     if @SCRFILE = "AutoPoll" fwrite 4, "                  >> CHECK SETUP FILE (",@su_fil,") - Remote not responding with Userid prompt for ",@SYSTYPE
  772.     else return 1
  773.     if @USERIF = "1"
  774.         set @SCRLREG = "1"
  775.         cursor 12,0
  776.         put " "
  777.         cursor 12,0
  778.         put "   X "
  779.         cursor 12,15
  780.         put "CHECK SETUP ",@su_fil," - Wrong System Type?"
  781.         cleol
  782.         set @SCRLREG = "0"
  783.     end
  784.     return -2
  785. #
  786. .LOG30
  787.     if @USERIF = "1" and @SCRFILE = "AutoPoll"
  788.         set @SCRLREG = "1"
  789.         cursor 12,15
  790.         put " "
  791.         cursor 12,15
  792.         put "Sending UserId"
  793.         cleol
  794.         set @SCRLREG = "0"
  795.     end
  796.     tsend @USERID, CR            # enter USERID
  797.     ttrap 10 "word:","$","authorization fail"                    # wait for PASSWORD prompt
  798.     if @STATUS = "2" goto .LOG50
  799.     if @STATUS = "0" or @STATUS = "3" goto .LOG25
  800.     if @USERIF = "1" and @SCRFILE = "AutoPoll"
  801.         set @SCRLREG = "1"
  802.         cursor 12,15
  803.         put " "
  804.         cursor 12,15
  805.         put "Sending Password"
  806.         cleol
  807.         set @SCRLREG = "0"
  808.     end
  809.     tsend @PASSWORD, CR            # enter PASSWORD
  810.     ttrap 20 "$","authorization fail"
  811.     if @STATUS = "1"
  812. .LOG50
  813.         if @USERIF = "0" or @SCRFILE NOT = "AutoPoll" return 0
  814.         set @SCRLREG = "1"
  815.         cursor 12,0
  816.         put " "
  817.         cursor 12,0
  818.         put "   *"
  819.         cursor 12,15
  820.         put "Logged on"
  821.         cleol
  822.         set @SCRLREG = "0"
  823.         return 0                            # got a system prompt
  824.     end
  825. #
  826. #    Incorrect USERID/PASSWORD - perhaps it was corrupted in transit
  827. #
  828.     if @SCRFILE = "AutoPoll" fwrite 4, "                  * Re-trying LOGIN - noise may have corrupted Username/Password exchange"
  829.     if reps goto .LOG20
  830.     if @SCRFILE = "AutoPoll" fwrite 4, "                  >> CHECK SETUP FILE (",@su_fil,") - Userid/Password not valid or noisy line"
  831.     else return 1
  832.     if @USERIF = "1"
  833.         set @SCRLREG = "1"
  834.         cursor 12,0
  835.         put " "
  836.         cursor 12,0
  837.         put "   X"
  838.         cursor 12,15
  839.         put "CHECK SETUP ",@su_fil," - bad Username/Password or line noise"
  840.         cleol
  841.         set @SCRLREG = "0"
  842.     end
  843.     return -2
  844. #
  845. #    LOGOFF the remote system
  846. #
  847. .LOGOFF
  848.     if @USERIF = "1" and @SCRFILE = "AutoPoll"
  849.         set @SCRLREG = "1"
  850.         cursor 14,0
  851.         put " "
  852.         cursor 14,0
  853.         put "--> "
  854.         cursor 14,15
  855.         put "Looking for operating system prompt"
  856.         set @SCRLREG = "0"
  857.     end
  858.     reps 4                    # try 4 times
  859. #
  860. .LGF10
  861.     tsend CR                # get system prompt
  862.     ttrap 5 "$","name:","word:","authorization fail"
  863.     if @STATUS = "1" goto .LGF20                        # VMS sys prompt
  864.     if @STATUS = "2" or @STATUS = "4" goto .LGF25
  865. #
  866.     if reps
  867.         tsend "\021\031"
  868.         goto .LGF10
  869.     end
  870. #
  871. #    Unable to get anything recognizable - abort
  872. #
  873.     if @SCRFILE = "AutoPoll" fwrite 4, "                  >> CHECK SETUP FILE (",@su_fil,") - LOGOFF Failed: Remote not responding as expected for ",@SYSTYPE
  874.     else return 1
  875.     if @USERIF = "1"
  876.         set @SCRLREG = "1"
  877.         cursor 14,0
  878.         put " "
  879.         cursor 14,0
  880.         put "   X"
  881.         cursor 14,15
  882.         put "CHECK SETUP ",@su_fil," - Could not find operating system prompt"
  883.         cleol
  884.         set @SCRLREG = "0"
  885.     end
  886.     return -2
  887. #
  888. .LGF20                        # VMS logout
  889.     tsend  "LOGOFF",CR
  890. .LGF25
  891.     if @USERIF = "1" and @SCRFILE = "AutoPoll"
  892.         set @SCRLREG = "1"
  893.         cursor 14,0
  894.         put " "
  895.         cursor 14,0
  896.         put "   *"
  897.         cursor 14,15
  898.         put "Logged off"
  899.         cleol
  900.         set @SCRLREG = "0"
  901.     end
  902.     return 0
  903. #
  904. #
  905. #    UPLOAD a file to the remote system
  906. #
  907. .UPLOAD
  908.     if @SCRFILE = "AutoPoll"
  909.         werror "UPLOAD not supported by AutoPoll"
  910.         fwrite 4, "                  >> UPLOAD not supported"
  911.         return -2
  912.     end
  913.     ask "enter filename to upload", @filename
  914.     if null @filename return 0
  915.     if exist @filename goto .UPL10
  916.     werror "can't open ", @filename
  917.     return 1
  918. #
  919. .UPL10
  920.     ask "enter remote filename or <RETURN> to upload to system", @remotefn
  921.     if null @remotefn goto .UPL20
  922.     tsend "\031",cr
  923.     ttrap 5 "$"
  924.     if 0 return 1
  925. #
  926. #    If no remote filename given, assume file already open on receiving system
  927. #
  928.     tsend "create ",@remotefn,cr
  929.     ttrap 2
  930. .UPL20
  931.     tupload @filename
  932.     wait 2 idle
  933. #
  934.     if null @remotefn return 0
  935.     tsend "\032"
  936.     ttrap 5 "$"
  937.     if 1 return 0
  938.     return 1
  939. #
  940. #    START file transfer on remote system
  941. #
  942. .TRANSFER
  943.     if @USERIF = "1" and @SCRFILE = "AutoPoll"
  944.         set @SCRLREG = "1"
  945.         cursor 13,0
  946.         put " "
  947.         cursor 13,0
  948.         put "--> "
  949.         cursor 13,15
  950.         put "Looking for operating system prompt"
  951.         set @SCRLREG = "0"
  952.     end
  953.     reps 4
  954. #
  955. .TRANS10
  956.     tsend CR
  957.     ttrap 10 "$","protocol","ppp","%DCL-"
  958.     if @STATUS = "2" or @STATUS = "3" return 0
  959.     if @STATUS = "1" goto .TRANS20
  960.     if @STATUS = "4"
  961.         if @SCRFILE = "AutoPoll" fwrite 4, "                  * CHECK REMOTE SYSTEM - BLAST symbol incorrectly defined"
  962.         else goto .TRANS15
  963.         if @USERIF = "0" goto .TRANS15
  964.         set @SCRLREG = "1"
  965.         cursor 13,15
  966.         put " "
  967.         cursor 13,15
  968.         put "CHECK REMOTE SYSTEM - BLAST symbol incorrectly defined"
  969.         cleol
  970.         set @SCRLREG = "0"
  971.     end
  972. .TRANS15
  973.     if reps
  974.         tsend "\021\031"
  975.         goto .TRANS10
  976.     end
  977. #
  978. #    Unable to get anything recognizable on remote computer - abort
  979. #
  980.     if @SCRFILE = "AutoPoll" fwrite 4, "                  >> CHECK REMOTE SYSTEM - Unable to get ",@SYSTYPE," system prompt after login"
  981.     else return 1
  982.     if @USERIF = "1"
  983.         set @SCRLREG = "1"
  984.         cursor 13,0
  985.         put " "
  986.         cursor 13,0
  987.         put "  X "
  988.         cursor 13,15
  989.         put "CHECK REMOTE - System not responding in time"
  990.         cleol
  991.         set @SCRLREG = "0"
  992.     end
  993.     return -3
  994. .TRANS20
  995.     tsend "BLAST /H",CR               # invoke BLAST in host mode
  996.     if @USERIF = "1" and @SCRFILE = "AutoPoll"
  997.         set @SCRLREG = "1"
  998.         cursor 13,15
  999.         put " "
  1000.         cursor 13,15
  1001.         put "Waiting for BLAST protocol"
  1002.         cleol
  1003.         set @SCRLREG = "0"
  1004.     end
  1005.     goto .TRANS10
  1006. .END
  1007. :
  1008. #########################################################
  1009. #
  1010. # Data General AOS & AOS/VS systems
  1011. #
  1012. :AOS
  1013. #
  1014. # LOGON to the remote DG
  1015. #
  1016. .LOGON
  1017.     if not null @USERID goto .LOG10
  1018.     if @SCRFILE not = "AutoPoll"
  1019.         ask "enter account", @USERID
  1020.         if null @USERID return 0
  1021.         goto .LOG10
  1022.     end
  1023.     fwrite 4, "                  >> CHECK SETUP FILE (",@su_fil,") - No USERID specified"
  1024.     if @USERIF = "1"
  1025.         set @SCRLREG = "1"
  1026.         cursor 12,0
  1027.         put " "
  1028.         cursor 12,0
  1029.         put "   X"
  1030.         cursor 12,15
  1031.         put "SETUP FILE ",@su_fil," - No USERID specified"
  1032.         cleol
  1033.         set @SCRLREG = "0"
  1034.     end
  1035.     return -2
  1036. .LOG10
  1037.     if not null @PASSWORD goto .LOG15
  1038.     if @SCRFILE not = "AutoPoll"
  1039.         ask noecho "enter PASSWORD", @PASSWORD
  1040.         if null @PASSWORD return 0
  1041.         goto .LOG15
  1042.     end
  1043.     fwrite 4, "                  >> CHECK SETUP FILE (",@su_fil,") - No PASSWORD specified"
  1044.     if @USERIF = "1"
  1045.         set @SCRLREG = "1"
  1046.         cursor 12,0
  1047.         put " "
  1048.         cursor 12,0
  1049.         put "   X"
  1050.         cursor 12,15
  1051.         put "SETUP FILE ",@su_fil," - No PASSWORD specified"
  1052.         cleol
  1053.         set @SCRLREG = "0"
  1054.     end
  1055.     return -2
  1056. .LOG15
  1057.     if @USERIF = "1" and @SCRFILE = "AutoPoll"
  1058.         set @SCRLREG = "1"
  1059.         cursor 12,0
  1060.         put " "
  1061.         cursor 12,0
  1062.         put "--> "
  1063.         set @SCRLREG = "0"
  1064.     end
  1065.     reps 5
  1066. .LOG20
  1067.     if @USERIF = "1" and @SCRFILE = "AutoPoll"
  1068.         set @SCRLREG = "1"
  1069.         cursor 12,15
  1070.         put " "
  1071.         cursor 12,15
  1072.         put "Looking for ",@SYSTYPE," Username prompt"
  1073.         cleol
  1074.         set @SCRLREG = "0"
  1075.     end
  1076.     tsend LF
  1077.     ttrap 5 "name:","word:","console locking",")"
  1078.     if @STATUS = "1" goto .LOG30
  1079.     if @STATUS = "2" goto .LOG40
  1080.     if @STATUS = "3"
  1081.         wait 11
  1082.         goto .LOG20
  1083.     end
  1084.     if @STATUS = "4"
  1085.         tsend "BYE", LF
  1086.         goto .LOG20
  1087.     end
  1088. .LOG25
  1089.     tsend "\021"
  1090.     if @SCRFILE = "AutoPoll" fwrite 4, "                  * Attempting to get ",@SYSTYPE," system's attention"
  1091.     if reps goto .LOG20
  1092. #
  1093. #    Can't log in, inform user and exit
  1094. #
  1095.     if @SCRFILE not = "AutoPoll" return 1
  1096.     fwrite 4, "                  >> CHECK SETUP FILE (",@su_fil,") - Remote not responding with USERID prompt for ",@SYSTYPE
  1097.     if @USERIF = "1"
  1098.         set @SCRLREG = "1"
  1099.         cursor 12,0
  1100.         put " "
  1101.         cursor 12,0
  1102.         put "   X "
  1103.         cursor 12,15
  1104.         put "CHECK SETUP ",@su_fil," - Wrong System Type?"
  1105.         cleol
  1106.         set @SCRLREG = "0"
  1107.     end
  1108.     return -2
  1109. #
  1110. .LOG30
  1111.     if @USERIF = "1" and @SCRFILE = "AutoPoll"
  1112.         set @SCRLREG = "1"
  1113.         cursor 12,15
  1114.         put " "
  1115.         cursor 12,15
  1116.         put "Sending USERID"
  1117.         cleol
  1118.         set @SCRLREG = "0"
  1119.     end
  1120.     tsend @USERID, LF            # enter USERID
  1121.     ttrap 10 "word:",")"                    # wait for PASSWORD prompt
  1122.     if @STATUS = "2" goto .LOG50
  1123.     if @STATUS = "0" goto .LOG25
  1124. #
  1125. .LOG40
  1126.     if @USERIF = "1" and @SCRFILE = "AutoPoll"
  1127.         set @SCRLREG = "1"
  1128.         cursor 12,15
  1129.         put " "
  1130.         cursor 12,15
  1131.         put "Sending Password"
  1132.         cleol
  1133.         set @SCRLREG = "0"
  1134.     end
  1135.     tsend @PASSWORD, LF            # enter PASSWORD
  1136.     ttrap 20 ")","name - pass"              # trap for AOS prompt
  1137.     if @STATUS = "1"
  1138. .LOG50
  1139.         if @USERIF = "0" or @SCRFILE not = "AutoPoll" return 0
  1140.         set @SCRLREG = "1"
  1141.         cursor 12,0
  1142.         put " "
  1143.         cursor 12,0
  1144.         put "   *"
  1145.         cursor 12,15
  1146.         put "Logged on"
  1147.         cleol
  1148.         set @SCRLREG = "0"
  1149.         return 0                            # got a system prompt
  1150.     end
  1151. #
  1152. #    Incorrect USERID/PASSWORD - perhaps it was corrupted in transit
  1153. #
  1154.     if @SCRFILE = "AutoPoll" fwrite 4, "                  * Re-trying LOGIN - noise may have corrupted Username/Password exchange"
  1155.     if reps goto .LOG20
  1156.     if @SCRFILE = "AutoPoll" fwrite 4, "                  >> CHECK SETUP FILE (",@su_fil,") - USERID/Password not valid or noisy line"
  1157.     else return 1
  1158.     if @USERIF = "1"
  1159.         set @SCRLREG = "1"
  1160.         cursor 12,0
  1161.         put " "
  1162.         cursor 12,0
  1163.         put "   X"
  1164.         cursor 12,15
  1165.         put "CHECK SETUP ",@su_fil," - bad Username/Password or line noise"
  1166.         cleol
  1167.         set @SCRLREG = "0"
  1168.     end
  1169.     return -2
  1170. #
  1171. #    LOGOFF the remote system
  1172. #
  1173. .LOGOFF
  1174.     if @USERIF = "1" and @SCRFILE = "AutoPoll"
  1175.         set @SCRLREG = "1"
  1176.         cursor 14,0
  1177.         put " "
  1178.         cursor 14,0
  1179.         put "--> "
  1180.         cursor 14,15
  1181.         put "Looking for operating system prompt"
  1182.         set @SCRLREG = "0"
  1183.     end
  1184.     reps 4                    # try 4 times
  1185. #
  1186. .LGF10
  1187.     tsend LF                # get system prompt
  1188.     ttrap 5 ")","name:","word:","console locking"
  1189.     if @STATUS = "1" goto .LGF20                        # AOS sys prompt
  1190.     if @STATUS = "2" or @STATUS = "4" goto .LGF25
  1191. #
  1192.     if reps
  1193.         tsend "\021\003\002"
  1194.         goto .LGF10
  1195.     end
  1196. #
  1197. #    Unable to get anything recognizable - abort
  1198. #
  1199.     if @SCRFILE = "AutoPoll" fwrite 4, "                  >> CHECK SETUP FILE (",@su_fil,") - LOGOFF Failed: Remote not responding as expected for ",@SYSTYPE
  1200.     else return 1
  1201.     if @USERIF = "1"
  1202.         set @SCRLREG = "1"
  1203.         cursor 14,0
  1204.         put " "
  1205.         cursor 14,0
  1206.         put "   X"
  1207.         cursor 14,15
  1208.         put "CHECK SETUP ",@su_fil," - Could not find operating system prompt"
  1209.         cleol
  1210.         set @SCRLREG = "0"
  1211.     end
  1212.     return -2
  1213. #
  1214. .LGF20                        # AOS logout
  1215.     tsend  "BYE", LF
  1216. .LGF25
  1217.     if @USERIF = "1" and @SCRFILE = "AutoPoll"
  1218.         set @SCRLREG = "1"
  1219.         cursor 14,0
  1220.         put " "
  1221.         cursor 14,0
  1222.         put "   *"
  1223.         cursor 14,15
  1224.         put "Logged off"
  1225.         cleol
  1226.         set @SCRLREG = "0"
  1227.     end
  1228.     return 0
  1229. #
  1230. #    UPLOAD a file to the remote system
  1231. #
  1232. .UPLOAD
  1233.     if @SCRFILE = "AutoPoll"
  1234.         werror "UPLOAD not supported by AutoPoll"
  1235.         fwrite 4, "                  >> UPLOAD not supported"
  1236.         return -2
  1237.     end
  1238.     ask "enter filename to upload", @filename
  1239.     if null @filename return 0
  1240.     if exist @filename goto .UPL10
  1241.     werror "can't open ", @filename
  1242.     return 1
  1243. #
  1244. .UPL10
  1245.     ask "enter remote filename or <RETURN> to upload to system", @remotefn
  1246.     if null @remotefn goto .UPL20
  1247.     tsend LF
  1248.     ttrap 5 ")"
  1249.     if 0 return 1
  1250. #
  1251. #    If no remote filename given, assume file already open on receiving system
  1252. #
  1253.     tsend "CHAR/NAS", LF
  1254.     ttrap 5 ")"
  1255.     if 1 goto .UPL20
  1256.     ttrap 2
  1257.     return 1
  1258. .UPL20
  1259.     tsend "CRE/I ", @remotefn, LF                    # create file w/insert
  1260.     ttrap 10 "))","EXISTS"
  1261.     if 0 or 2
  1262.         tsend "CHAR/OFF/NAS", LF
  1263.         return 1
  1264.     end
  1265. #
  1266.     tupload @filename
  1267.     wait 2 idle
  1268. #
  1269.     if null @remotefn return 0
  1270.     tsend LF
  1271.     ttrap 5 "))"
  1272.     if 1
  1273.         tsend ")", LF
  1274.         ttrap 5 ")"
  1275.         if 1
  1276.             tsend "CHAR/OFF/NAS", LF
  1277.             return 0
  1278.         end
  1279.         return 0
  1280.     end
  1281. #else error
  1282.     return 1
  1283. #
  1284. #    START file transfer on remote system
  1285. #
  1286. .TRANSFER
  1287.     if @USERIF = "1" and @SCRFILE = "AutoPoll"
  1288.         set @SCRLREG = "1"
  1289.         cursor 13,0
  1290.         put " "
  1291.         cursor 13,0
  1292.         put "--> "
  1293.         cursor 13,15
  1294.         put "Looking for operating system prompt"
  1295.         set @SCRLREG = "0"
  1296.     end
  1297.     reps 4
  1298. #
  1299. .TRANS10
  1300.     tsend LF
  1301.     ttrap 10 ")","protocol","ppp","Error"   # see what's happening
  1302.     if @STATUS = "2" or @STATUS = "3" return 0
  1303.     if @STATUS = "1" goto .TRANS20
  1304.     if @STATUS = "0" got .TRANS15
  1305.     if @SCRFILE = "AutoPoll" fwrite 4, "                  * CHECK REMOTE SYSTEM - BLAST not in SEARCHLIST or not installed"
  1306.     else goto .TRANS15
  1307.     if @USERIF = "1"
  1308.         set @SCRLREG = "1"
  1309.         cursor 13,15
  1310.         put " "
  1311.         cursor 13,15
  1312.         put "CHECK REMOTE setup.cli - BLAST not found in SEARCHLIST"
  1313.         cleol
  1314.         set @SCRLREG = "0"
  1315.     end
  1316. .TRANS15
  1317.     if reps
  1318.         tsend "\021\003\001"
  1319.         goto .TRANS10
  1320.     end
  1321. #
  1322. #    Unable to get anything recognizable on remote computer - abort
  1323. #
  1324.     if @SCRFILE = "AutoPoll" fwrite 4, "                  >> CHECK REMOTE SYSTEM - Unable to get ",@SYSTYPE," system prompt after login"
  1325.     else return 1
  1326.     if @USERIF = "1"
  1327.         set @SCRLREG = "1"
  1328.         cursor 13,0
  1329.         put " "
  1330.         cursor 13,0
  1331.         put "  X "
  1332.         cursor 13,15
  1333.         put "CHECK REMOTE - System not responding in time"
  1334.         cleol
  1335.         set @SCRLREG = "0"
  1336.     end
  1337.     return -3
  1338. .TRANS20
  1339.     tsend "X BLAST /H", LF               # invoke BLAST in host mode
  1340.     if @USERIF = "1" and @SCRFILE = "AutoPoll"
  1341.         set @SCRLREG = "1"
  1342.         cursor 13,15
  1343.         put " "
  1344.         cursor 13,15
  1345.         put "Waiting for BLAST protocol"
  1346.         cleol
  1347.         set @SCRLREG = "0"
  1348.     end
  1349.     goto .TRANS10
  1350. .END
  1351. :
  1352. ########################################
  1353. #
  1354. #    Data General CEO AOS & AOS/VS systems running CEO
  1355. #
  1356. :CEO
  1357. #
  1358. .LOGON
  1359.     if not null @USERID goto .LOG10
  1360.     if @SCRFILE not = "AutoPoll"
  1361.         ask "enter account", @USERID
  1362.         if null @USERID return 0
  1363.         goto .LOG10
  1364.     end
  1365.     fwrite 4, "                  >> CHECK SETUP FILE (",@su_fil,") - No USERID specified"
  1366.     if @USERIF = "1"
  1367.         set @SCRLREG = "1"
  1368.         cursor 12,0
  1369.         put " "
  1370.         cursor 12,0
  1371.         put "   X"
  1372.         cursor 12,15
  1373.         put "SETUP FILE ",@su_fil," - No USERID specified"
  1374.         cleol
  1375.         set @SCRLREG = "0"
  1376.     end
  1377.     return -2
  1378. .LOG10
  1379.     if not null @PASSWORD goto .LOG15
  1380.     if @SCRFILE not = "AutoPoll"
  1381.         ask noecho "enter PASSWORD", @PASSWORD
  1382.         if null @PASSWORD return 0
  1383.         goto .LOG15
  1384.     end
  1385.     fwrite 4, "                  >> CHECK SETUP FILE (",@su_fil,") - No PASSWORD specified"
  1386.     if @USERIF = "1"
  1387.         set @SCRLREG = "1"
  1388.         cursor 12,0
  1389.         put " "
  1390.         cursor 12,0
  1391.         put "   X"
  1392.         cursor 12,15
  1393.         put "SETUP FILE ",@su_fil," - No PASSWORD specified"
  1394.         cleol
  1395.         set @SCRLREG = "0"
  1396.     end
  1397.     return -2
  1398. .LOG15
  1399.     if @USERIF = "1" and @SCRFILE = "AutoPoll"
  1400.         set @SCRLREG = "1"
  1401.         cursor 12,0
  1402.         put " "
  1403.         cursor 12,0
  1404.         put "--> "
  1405.         set @SCRLREG = "0"
  1406.     end
  1407.     reps 5
  1408. .LOG20
  1409.     if @USERIF = "1" and @SCRFILE = "AutoPoll"
  1410.         set @SCRLREG = "1"
  1411.         cursor 12,15
  1412.         put " "
  1413.         cursor 12,15
  1414.         put "Looking for ",@SYSTYPE," Username prompt"
  1415.         cleol
  1416.         set @SCRLREG = "0"
  1417.     end
  1418.     tsend LF                # get response from remote
  1419.     ttrap 5 "name:","word:","console locking",")","FS01"
  1420.     if 1 goto .LOG30
  1421.     if 3 wait 11
  1422.     if 4 tsend "BYE", LF
  1423.     if 5 goto .LOG70
  1424. .LOG25
  1425.     tsend "\021"
  1426.     if @SCRFILE = "AutoPoll" fwrite 4, "                  * Attempting to get ",@SYSTYPE," system's attention"
  1427.     if reps goto .LOG20
  1428. #
  1429. #    Can't log in, inform user and exit
  1430. #
  1431.     if @SCRFILE not = "AutoPoll" return 1
  1432.     fwrite 4, "                  >> CHECK SETUP FILE (",@su_fil,") - Remote not responding with USERID prompt for ",@SYSTYPE
  1433.     if @USERIF = "1"
  1434.         set @SCRLREG = "1"
  1435.         cursor 12,0
  1436.         put " "
  1437.         cursor 12,0
  1438.         put "   X "
  1439.         cursor 12,15
  1440.         put "CHECK SETUP ",@su_fil," - Wrong System Type?"
  1441.         cleol
  1442.         set @SCRLREG = "0"
  1443.     end
  1444.     return -2
  1445. #
  1446. .LOG30
  1447.     if @USERIF = "1" and @SCRFILE = "AutoPoll"
  1448.         set @SCRLREG = "1"
  1449.         cursor 12,15
  1450.         put " "
  1451.         cursor 12,15
  1452.         put "Sending USERID"
  1453.         cleol
  1454.         set @SCRLREG = "0"
  1455.     end
  1456.     tsend @USERID, LF            # enter USERID
  1457.     ttrap 10 "word:","FS01"             # wait for PASSWORD prompt
  1458.     if @STATUS = "2" goto .LOG50
  1459.     if @STATUS = "0" goto .LOG25
  1460. .LOG40
  1461.     if @USERIF = "1" and @SCRFILE = "AutoPoll"
  1462.         set @SCRLREG = "1"
  1463.         cursor 12,15
  1464.         put " "
  1465.         cursor 12,15
  1466.         put "Sending Password"
  1467.         cleol
  1468.         set @SCRLREG = "0"
  1469.     end
  1470.     tsend @PASSWORD, LF            # enter PASSWORD
  1471.     ttrap 20 "FS01","name - pass"              # trap for AOS prompt
  1472.     if @STATUS = "1"
  1473. .LOG50
  1474.         if @USERIF = "0" or @SCRFILE not = "AutoPoll" return 0
  1475.         set @SCRLREG = "1"
  1476.         cursor 12,0
  1477.         put " "
  1478.         cursor 12,0
  1479.         put "   *"
  1480.         cursor 12,15
  1481.         put "Logged on"
  1482.         cleol
  1483.         set @SCRLREG = "0"
  1484.         return 0                            # got a system prompt
  1485.     end
  1486. #
  1487. #    Incorrect USERID/PASSWORD - perhaps it was corrupted in transit
  1488. #
  1489.     if @SCRFILE = "AutoPoll" fwrite 4, "                  * Re-trying LOGIN - noise may have corrupted Username/Password exchange"
  1490.     if reps goto .LOG20
  1491.     if @SCRFILE = "AutoPoll" fwrite 4, "                  >> CHECK SETUP FILE (",@su_fil,") - USERID/Password not valid or noisy line"
  1492.     else return 1
  1493.     if @USERIF = "1"
  1494.         set @SCRLREG = "1"
  1495.         cursor 12,0
  1496.         put " "
  1497.         cursor 12,0
  1498.         put "   X"
  1499.         cursor 12,15
  1500.         put "CHECK SETUP ",@su_fil," - bad Username/Password or line noise"
  1501.         cleol
  1502.         set @SCRLREG = "0"
  1503.     end
  1504.     return -2
  1505. #
  1506. #    LOGOFF the remote system
  1507. #
  1508. .LOGOFF
  1509.     if @USERIF = "1" and @SCRFILE = "AutoPoll"
  1510.         set @SCRLREG = "1"
  1511.         cursor 14,0
  1512.         put " "
  1513.         cursor 14,0
  1514.         put "--> "
  1515.         cursor 14,15
  1516.         put "Looking for CEO prompts"
  1517.         set @SCRLREG = "0"
  1518.     end
  1519.     reps 10                  # try 10 times
  1520. .LGF10
  1521.     tsend "\021\036\173"            # get logoff prompt
  1522.     ttrap 5,"exit?","\136\136{","menu? (Y/N)","Execute? (Y/N)","choice:","Pick one","name:",")"
  1523.     if 0
  1524.         wait 2 idle
  1525.         if reps goto .LGF10
  1526.         return 1
  1527.     end
  1528.     if 1                    # CEO logoff prompt
  1529.         tsend  "Y", LF
  1530.         ttrap 10,"NEW-LINE",")"
  1531.         if 0 goto .LGF10
  1532.         if 2 goto .LGF20
  1533.         goto .LGF25
  1534.     end
  1535.     if 2
  1536.         tsend LF,LF
  1537.         wait 2 idle
  1538.         goto .LGF10
  1539.     end
  1540.     if 3
  1541.         tsend "Y",LF                    # sending mail, exit
  1542.         wait 2 idle
  1543.         goto .LGF10
  1544.     end
  1545.     if 4
  1546.         tsend "N",LF                    # sending mail, exit
  1547.         wait 2 idle
  1548.         goto .LGF10
  1549.     end
  1550.     if 5
  1551.         goto .LGF10
  1552.     end
  1553.     if 6
  1554.         goto .LGF10
  1555.     end
  1556.     if 7
  1557.         return 0                # logon prompt
  1558.     end
  1559.     if 8
  1560.         goto .LGF20
  1561.     end
  1562.     if 9
  1563.         goto .LGF10
  1564.     end
  1565.     return -2
  1566. .LGF20                        # AOS logout
  1567.     tsend  "BYE", LF
  1568. .LGF25
  1569.     if @USERIF = "1" and @SCRFILE = "AutoPoll"
  1570.         set @SCRLREG = "1"
  1571.         cursor 14,0
  1572.         put " "
  1573.         cursor 14,0
  1574.         put "   *"
  1575.         cursor 14,15
  1576.         put "Logged off"
  1577.         cleol
  1578.         set @SCRLREG = "0"
  1579.     end
  1580.     return 0
  1581. #
  1582. #    UPLOAD a file to the remote system
  1583. #
  1584. .UPLOAD
  1585.     if @SCRFILE = "AutoPoll"
  1586.         werror "UPLOAD not supported by AutoPoll"
  1587.         fwrite 4, "                  >> UPLOAD not supported"
  1588.         return -2
  1589.     end
  1590.     ask "enter filename to upload", @filename
  1591.     if null @filename return 0
  1592.     if exist @filename goto .UPL10
  1593.     werror "can't open ", @filename
  1594.     return 1
  1595. .UPL10
  1596.     ask "enter remote filename or <RETURN> to upload to system", @remotefn
  1597.     if null @remotefn goto .UPL20
  1598.     tsend LF
  1599.     ttrap 5 ")"
  1600.     if 0 return 1
  1601. #
  1602. #    If no remote filename given, assume file already open on receiving system
  1603.     tsend "CHAR/NAS",LF
  1604.     ttrap 5 ")"
  1605.     if 1 goto .UPL20
  1606.     ttrap 2
  1607.     return 1
  1608. .UPL20
  1609.     tsend "CRE/I ", @remotefn,LF                    # create file w/insert
  1610.     ttrap 10 "))","EXISTS"
  1611.     if 0 or 2
  1612.         tsend "CHAR/OFF/NAS",LF
  1613.         return 1
  1614.     end
  1615.     tupload @filename
  1616.     wait 2 idle
  1617.     if null @remotefn return 0
  1618.     tsend LF
  1619.     ttrap 5 "))"
  1620.     if 1
  1621.         tsend ")",LF
  1622.         ttrap 5 ")"
  1623.         if 1
  1624.             tsend "CHAR/OFF/NAS",LF
  1625.             return 0
  1626.         end
  1627.         return 0
  1628.     end
  1629. #else error
  1630.     return 1
  1631. end
  1632. #
  1633. #    START file transfer on remote system
  1634. .TRANSFER
  1635.     if @USERIF = "1" and @SCRFILE = "AutoPoll"
  1636.         set @SCRLREG = "1"
  1637.         cursor 13,0
  1638.         put " "
  1639.         cursor 13,0
  1640.         put "--> "
  1641.         cursor 13,15
  1642.         put "Looking for operating system prompt"
  1643.         set @SCRLREG = "0"
  1644.     end
  1645.     reps 3
  1646. .TRANS10
  1647.     tsend "\036\162"
  1648.     ttrap 10 "What command",")","protocol","ppp","Error"    # see what's happening
  1649.     if @STATUS = "3" or @STATUS = "4" return 0
  1650.     if @STATUS = "1"
  1651.         tsend "CLI", LF
  1652.         goto .TRANS15
  1653.     end
  1654.     if @STATUS = "2" goto .TRANS20
  1655.     if @STATUS = "0" got .TRANS15
  1656.     if @SCRFILE not = "AutoPoll" goto .TRANS15
  1657.     fwrite 4, "                  * CHECK REMOTE SYSTEM - BLAST not in SEARCHLIST or not installed"
  1658.     if @USERIF = "1"
  1659.         set @SCRLREG = "1"
  1660.         cursor 13,15
  1661.         put " "
  1662.         cursor 13,15
  1663.         put "CHECK REMOTE setup.cli - BLAST not found in SEARCHLIST"
  1664.         cleol
  1665.         set @SCRLREG = "0"
  1666.     end
  1667. .TRANS15
  1668.     if reps
  1669.         tsend "\021"
  1670.         goto .TRANS10
  1671.     end
  1672. #
  1673. #    Unable to get anything recognizable on remote computer - abort
  1674. #
  1675.     if @SCRFILE not = "AutoPoll" return 1
  1676.     fwrite 4, "                  >> CHECK REMOTE SYSTEM - Unable to get ",@SYSTYPE," system prompt after login"
  1677.     if @USERIF = "1"
  1678.         set @SCRLREG = "1"
  1679.         cursor 13,0
  1680.         put " "
  1681.         cursor 13,0
  1682.         put "  X "
  1683.         cursor 13,15
  1684.         put "CHECK REMOTE - System not responding in time"
  1685.         cleol
  1686.         set @SCRLREG = "0"
  1687.     end
  1688.     return -3
  1689. .TRANS20
  1690.     tsend "X BLAST /H ; BYE", LF               # invoke BLAST in host mode
  1691.     if @USERIF = "1" and @SCRFILE = "AutoPoll"
  1692.         set @SCRLREG = "1"
  1693.         cursor 13,15
  1694.         put " "
  1695.         cursor 13,15
  1696.         put "Waiting for BLAST protocol"
  1697.         cleol
  1698.         set @SCRLREG = "0"
  1699.     end
  1700.     goto .TRANS10
  1701. .END
  1702.  
  1703. :
  1704. #
  1705. ########################################
  1706. #
  1707. #    IBM MVS/TSO routines
  1708. #
  1709. #    NOTE:  This script assumes you are using the
  1710. #    standard prompt.  Problems may occur
  1711. #    otherwise.
  1712. #
  1713. :MVS/TSO
  1714. #
  1715. .LOGON
  1716. #
  1717. #    Initialize flag, get necessary information
  1718. #
  1719. #
  1720.     if not null @userid goto .LOG10     # verify existence of userid
  1721.     ask "enter Login ID", @userid
  1722.     if null @userid  return 0        # return ok no error
  1723. #
  1724. .LOG10                        # ask for password
  1725.     if null @password
  1726.        ask noecho "enter password", @password
  1727.     end
  1728. #
  1729. #    Try to log in to the remote computer
  1730. #
  1731.     reps 5                    # repeat login procedure up to
  1732.                         # 5 times
  1733. #
  1734. .LOG20
  1735.     tsend cr                # get response from remote
  1736.     ttrap 10 "LOGON","ID","WORD"
  1737.     if 1
  1738.         ttrap 3
  1739.         tsend "LOGON",cr
  1740.         ttrap 5 "ID"
  1741.         if 1 goto .LOG30
  1742.     end
  1743.     if 2 goto .LOG30
  1744.     if 3 goto .LOG40
  1745.     if reps goto .LOG20
  1746. #
  1747. #    Can't log in, inform user and exit
  1748. #
  1749.     return 1
  1750. #
  1751. .LOG30
  1752.     ttrap 4
  1753.     tsend @userid, cr            # enter userid
  1754.     ttrap 10 "WORD"                         # wait for password prompt
  1755.     if 1 goto .LOG40
  1756.     if reps goto .LOG20
  1757.     return 1
  1758. #
  1759. .LOG40
  1760.     ttrap 4
  1761.     tsend @password,cr            # enter password
  1762.     ttrap 20 "READY","INCORRECT"            # trap for unix xenix prompt
  1763.     if 1 return 0                # got a system prompt
  1764. #
  1765. #    Incorrect userid/password - perhaps it was garbaged.
  1766. #    If we've only tried once, try again, otherwise exit.
  1767. #
  1768.     if reps goto .LOG20
  1769.     return 1
  1770. #
  1771. #    LOGOFF the remote system
  1772. #
  1773. .LOGOFF
  1774.     reps 4                    # try 4 times
  1775. #
  1776. .LGF10
  1777.     tsend cr                # get system prompt
  1778.     ttrap 10 "READY"
  1779.     if 1 goto .LGF20
  1780. #
  1781.     if reps goto .LGF10
  1782. #
  1783. #    Unable to get anything recognizable - abort
  1784. #
  1785.     return 1
  1786. #
  1787. .LGF20                        # TSO logout
  1788.     tsend "LOGOFF",cr
  1789.     return 0
  1790. #
  1791. #
  1792. #    UPLOAD a file to the remote system
  1793. #
  1794. .UPLOAD
  1795. #
  1796. .UPL10
  1797.     ask "enter remote filename or <RETURN> to upload to system", @remotefn
  1798.     if null @remotefn goto .UPL20
  1799.     tsend cr
  1800.     ttrap 5 "READY"
  1801.     if 0 return 1
  1802. #
  1803. #    If no remote filename given, assume file already open on receiving system
  1804. #
  1805. reps 2
  1806.     ttrap 2
  1807.     tsend "EDIT '",@userid,".",@remotefn,"' TEXT NONUM",cr
  1808.     ttrap 10 "INPUT","EDIT"
  1809.     if 1 goto .UPL20
  1810.     if 2 tsend cr
  1811.     if 0 return 1
  1812. .UPL20
  1813.     ttrap 2
  1814.     set @HLINDLY = @LINEDLY
  1815.     set @LINEDLY = "15"
  1816.     tupload @filename
  1817.     set @LINEDLY = @HLINDLY
  1818.     wait 2 idle
  1819. #
  1820.     if null @remotefn return 0
  1821. #
  1822. .UPL25
  1823.     tsend cr
  1824.     ttrap 10 "EDIT","INPUT","READY"
  1825.     if 1 goto .UPL30
  1826.     if 0 or 3 return 1
  1827.     if reps goto .UPL25
  1828. .UPL30
  1829.     tsend "END S",cr
  1830.     ttrap 10 "READY"
  1831.     if 1 return 0
  1832.     return 1
  1833. end
  1834. #
  1835. #    START file transfer on remote system
  1836. #
  1837. .TRANSFER
  1838.     reps 3
  1839. #
  1840. .TRANS10
  1841.     tsend cr
  1842.     ttrap 5 "READY","protocol","ppp"        # see what's happening
  1843.     if 1 goto .TRANS20            # we need to invoke BLAST
  1844.     if 2 or 3 return 0            # BLAST is already started
  1845.     if reps goto .TRANS10
  1846. #
  1847. #    Unable to get anything recognizable on remote computer - abort
  1848. #
  1849.     return 1
  1850. #
  1851. .TRANS20
  1852.     tsend "BLAST",cr                        # invoke BLAST in host mode
  1853.     ttrap 20 "ppp", "protocol","READY"
  1854. #
  1855.     if 1 or 2 return 0            # BLAST started!
  1856.     if reps goto .TRANS20
  1857. #
  1858. #
  1859.     return 1
  1860. .END
  1861. :
  1862. ########################################
  1863. #
  1864. #    IBM VM/CMS routines
  1865. #
  1866. #    NOTE:  This script assumes you are using the
  1867. #    standard prompt.  Problems may occur
  1868. #    otherwise.
  1869. #
  1870. :VM/CMS
  1871. #
  1872. .LOGON
  1873. #
  1874. #    Initialize flag, get necessary information
  1875. #
  1876. #
  1877.     if not null @userid goto .LOG10     # verify existence of userid
  1878.     ask "enter login", @userid
  1879.     if null @userid  return 0        # return ok no error
  1880. #
  1881. .LOG10                        # ask for password
  1882.     if null @password
  1883.        ask noecho "enter password", @password
  1884.     end
  1885. #
  1886. #    Try to log in to the remote computer
  1887. #
  1888.     reps 5                    # repeat login procedure up to
  1889.                         # 5 times
  1890. #
  1891. .LOG20
  1892.     tsend "h",cr                            # get response from remote
  1893.     ttrap 10 "restart"
  1894.     if 1 goto .LOG30
  1895.     if reps goto .LOG20
  1896. #
  1897. #    Can't log in, inform user and exit
  1898. #
  1899.     return 1
  1900. #
  1901. .LOG30
  1902.     ttrap 4
  1903.     tsend "l ",@userid, cr                  # enter userid
  1904.     ttrap 10 "word:"                        # wait for password prompt
  1905.     if 1 goto .LOG40
  1906.     if reps goto .LOG20
  1907.     return 1
  1908. #
  1909. .LOG40
  1910.     ttrap 4
  1911.     tsend @password,cr            # enter password
  1912.     ttrap 20 "."                            # trap for system prompt
  1913.     if 1 return 0                # got a system prompt
  1914. #
  1915. #    Incorrect userid/password - perhaps it was garbaged.
  1916. #    If we've only tried once, try again, otherwise exit.
  1917. #
  1918.     if reps goto .LOG20
  1919.     return 1
  1920. #
  1921. #    LOGOFF the remote system
  1922. #
  1923. .LOGOFF
  1924.     reps 4                    # try 4 times
  1925. #
  1926. .LGF10
  1927.     tsend cr                # get system prompt
  1928.     ttrap 10 "CMS"
  1929.     if 1 goto .LGF20
  1930. #
  1931.     if reps goto .LGF10
  1932. #
  1933. #    Unable to get anything recognizable - abort
  1934. #
  1935.     return 1
  1936. #
  1937. .LGF20                        # TSO logout
  1938.     tsend "LOGOFF",cr
  1939.     return 0
  1940. #
  1941. #
  1942. #    UPLOAD a file to the remote system
  1943. #
  1944. .UPLOAD
  1945.     ask "enter filename to upload", @filename
  1946.     if null @filename return 0
  1947.     if exist @filename goto .UPL10
  1948.     werror "can't open ", @filename
  1949.     return 1
  1950. #
  1951. .UPL10
  1952.     ask "enter remote filename or <RETURN> to upload to system", @remotefn
  1953.     if null @remotefn goto .UPL20
  1954.     tsend cr
  1955.     ttrap 5 "cms","CMS"
  1956.     if 0 return 1
  1957. #
  1958. #    If no remote filename given, assume file already open on receiving system
  1959. #
  1960. reps 2
  1961.     ttrap 2
  1962.     tsend "EDIT ",@remotefn," TEXT",cr
  1963.     ttrap 10 "NEW FILE"
  1964.     if 1 goto .UPL20
  1965.     if 0 return 1
  1966. .UPL20
  1967.     ttrap 2
  1968.     tsend "INPUT",cr
  1969.     ttrap 10 "INPUT"
  1970.     if 1 goto .UPL25
  1971.     return 1
  1972. .UPL25
  1973.     ttrap 4
  1974.     set @HLINDLY = @LINEDLY
  1975.     set @LINEDLY = "5"
  1976.     tupload @filename
  1977.     set @LINEDLY = @HLINDLY
  1978.     wait 2 idle
  1979. #
  1980.     if null @remotefn return 0
  1981. #
  1982.     tsend cr
  1983.     ttrap 2
  1984.     tsend "SAVE",cr
  1985.     ttrap 2
  1986.     tsend "QUIT",cr
  1987.     return 0
  1988. #
  1989. #    START file transfer on remote system
  1990. #
  1991. .TRANSFER
  1992.     reps 3
  1993. #
  1994. .TRANS10
  1995.     tsend cr
  1996.     ttrap 5 "CMS",";start","ppp"            # see what's happening
  1997.     if 1 goto .TRANS20            # we need to invoke BLAST
  1998.     if 2 or 3 return 0            # BLAST is already started
  1999.     if reps goto .TRANS10
  2000. #
  2001. #    Unable to get anything recognizable on remote computer - abort
  2002. #
  2003.     return 1
  2004. #
  2005. .TRANS20
  2006.     tsend "BLAST",cr                        # invoke BLAST in host mode
  2007.     ttrap 20 "ppp", ";start","CMS"
  2008. #
  2009.     if 1 or 2 return 0            # BLAST started!
  2010.     if reps goto .TRANS20
  2011. #
  2012. #
  2013.     return 1
  2014. .END
  2015. :
  2016. ########################################
  2017. #
  2018. #    PRIME PRIMOS
  2019. #
  2020. #    NOTE:  This script assumes you are using the
  2021. #    standard brief (OK) prompt.  Problems may occur
  2022. #    otherwise.
  2023. #
  2024. :Primos
  2025. #
  2026. .LOGON
  2027. #
  2028. #    Initialize flag, get necessary information
  2029. #
  2030. #
  2031.     if not null @userid goto .LOG10     # verify existence of userid
  2032.     ask "enter login", @userid
  2033.     if null @userid
  2034.     return 0                # return ok no error
  2035. end
  2036. #
  2037. .LOG10                        # ask for password
  2038.     if null @password
  2039.        ask noecho "enter password", @password
  2040.     end
  2041. #
  2042. #    Try to log in to the remote computer
  2043. #
  2044.     reps 5                    # repeat login procedure up to
  2045.                         # 5 times
  2046. #
  2047. .LOG20
  2048.     tsend cr,"H",cr                         # get response from remote
  2049.     ttrap 5 "ER","LOGIN","Login"
  2050.     if not 0 goto .LOG30
  2051.     if reps goto .LOG20
  2052. #
  2053. #    Can't log in, inform user and exit
  2054. #
  2055.     return 1
  2056. #
  2057. .LOG30
  2058.     tsend cr,"login ",@userid, cr           # enter userid
  2059.     ttrap 10 "WORD","word","OK"             # wait for password prompt
  2060.     if 1 or 2 goto .LOG40
  2061.     if 3 return 0                # no password for username
  2062.     if reps goto .LOG20
  2063.     return 1
  2064. #
  2065. .LOG40
  2066.     tsend @password,cr            # enter password
  2067.     ttrap 30 "OK"                           # trap for prime prompt
  2068.     if 1 return 0                # got a system prompt
  2069. #
  2070. #    Incorrect userid/password - perhaps it was garbaged.
  2071. #    If we've only tried once, try again, otherwise exit.
  2072. #
  2073.     if reps goto .LOG20
  2074.     return 1
  2075. #
  2076. #    LOGOFF the remote system
  2077. #
  2078. .LOGOFF
  2079.     reps 4                    # try 4 times
  2080. #
  2081. .LGF10
  2082.     tsend "rdy",cr                          # get system prompt
  2083.     ttrap 10 "OK"
  2084.     if 1 goto .LGF20
  2085. #
  2086.     if reps goto .LGF10
  2087. #
  2088. #    Unable to get anything recognizable - abort
  2089. #
  2090.     return 1
  2091. #
  2092. .LGF20                        # prime logout
  2093.     tsend "log",cr
  2094.     return 0
  2095. #
  2096. #
  2097. #    UPLOAD a file to the remote system
  2098. #
  2099. .UPLOAD
  2100.     ask "enter filename to upload", @filename
  2101.     if null @filename return 0
  2102.     if exist @filename goto .UPL10
  2103.     werror "can't open ", @filename
  2104.     return 1
  2105. #
  2106. .UPL10
  2107.     ask "enter remote filename or <RETURN> to upload to system", @remotefn
  2108.     if null @remotefn goto .UPL20
  2109.     tsend "rdy",cr
  2110.     ttrap 5 "OK"
  2111.     if 0 return 1
  2112. #
  2113. #    If no remote filename given, assume file already open on receiving system
  2114. #
  2115.     tsend "ED",cr
  2116.     ttrap 2
  2117. .UPL20
  2118.     tupload @filename
  2119.     wait 2 idle
  2120. #
  2121.     if null @remotefn return 0
  2122.     tsend cr
  2123.     ttrap 5 "EDIT"
  2124.         if 0 return 1
  2125.     tsend "FILE ",@remotefn,cr
  2126.     ttrap 10 "OK"
  2127.     if 1 return 0
  2128.     return 1
  2129. end
  2130. #
  2131. #    START file transfer on remote system
  2132. #
  2133. .TRANSFER
  2134.     reps 3
  2135. #
  2136. .TRANS10
  2137.     tsend "rdy",cr
  2138.     ttrap 5 "OK","protocol","ppp"           # see what's happening
  2139.     if 1 goto .TRANS20            # we need to invoke BLAST
  2140.     if 2 or 3 return 0            # BLAST is already started
  2141.     if reps goto .TRANS10
  2142. #
  2143. #    Unable to get anything recognizable on remote computer - abort
  2144. #
  2145.     return 1
  2146. #
  2147. .TRANS20
  2148.     tsend "RESUME BLAST -H ",cr           # invoke BLAST in host mode
  2149.     ttrap 30 "ppp", "protocol","OK","ER"
  2150.     if 1 or 2 return 0            # BLAST started!
  2151. #
  2152.     tsend "SEG BLAST -H ",@BAUDRATE,cr      # invoke BLAST in host mode
  2153.     ttrap 30 "ppp", "protocol","OK","ER"
  2154. #
  2155.     if 1 or 2 return 0            # BLAST started!
  2156.     if reps goto .TRANS20
  2157. #
  2158. #
  2159.     return 1
  2160. .END
  2161. :
  2162. ########################################
  2163. #
  2164. #    HP 1000 RTE
  2165. #
  2166. #    NOTE:  This script assumes you are using the
  2167. #    standard prompt.  Problems may occur
  2168. #    otherwise.
  2169. #
  2170. :HP1000
  2171. #
  2172. .LOGON
  2173. #
  2174. #    Initialize flag, get necessary information
  2175. #
  2176. #
  2177.     if not null @userid goto .LOG10     # verify existence of userid
  2178.     ask "enter account",@userid
  2179.     if null @userid
  2180.     return 0                # return ok no error
  2181. end
  2182. #
  2183. .LOG10                        # ask for password
  2184.     if null @password
  2185.        ask noecho "enter password", @password
  2186.     end
  2187. #
  2188. #    Try to log in to the remote computer
  2189. #
  2190.     reps 5                    # repeat login procedure up to
  2191.                         # 5 times
  2192. #
  2193. .LOG20
  2194.     tsend cr                # get response from remote
  2195.     ttrap 5 ":"
  2196.     if 1 goto .LOG30
  2197.     if reps goto .LOG20
  2198. #
  2199. #    Can't log in, inform user and exit
  2200. #
  2201.     return 1
  2202. #
  2203. .LOG30
  2204.     tsend @userid,cr            # enter userid
  2205.     ttrap 10 "WORD",">"                     # wait for password prompt
  2206.     if 1 goto .LOG40
  2207.     if 2 return 0                # no password for username
  2208.     if reps goto .LOG20
  2209.     return 1
  2210. #
  2211. .LOG40
  2212.     tsend @password,cr            # enter password
  2213.     ttrap 20 ">"                            # trap for HP prompt
  2214.     if 1 return 0                # got a system prompt
  2215. #
  2216. #    Incorrect userid/password - perhaps it was garbaged.
  2217. #    If we've only tried once, try again, otherwise exit.
  2218. #
  2219.     if reps goto .LOG20
  2220.     return 1
  2221. #
  2222. #    LOGOFF the remote system
  2223. #
  2224. .LOGOFF
  2225.     reps 4                    # try 4 times
  2226. #
  2227. .LGF10
  2228.     tsend cr                # get system prompt
  2229.     ttrap 10 ">"
  2230.     if 1 goto .LGF20            # OK log off
  2231. #
  2232.     if reps goto .LGF10
  2233. #
  2234. #    Unable to get anything recognizable - abort
  2235. #
  2236.     return 1
  2237. #
  2238. .LGF20                        # hp logout
  2239.     tsend "ex,sp",cr
  2240.     return 0
  2241. #
  2242. #
  2243. #    UPLOAD a file to the remote system
  2244. #
  2245. .UPLOAD
  2246.     ask "enter filename to upload", @filename
  2247.     if null @filename return 0
  2248.     if exist @filename goto .UPL10
  2249.     werror "can't open ", @filename
  2250.     return 1
  2251. #
  2252. .UPL10
  2253.     ask "enter remote filename or <RETURN> to upload to system", @remotefn
  2254.     if null @remotefn goto .UPL20
  2255.     tsend cr
  2256.     ttrap 5 ">"
  2257.     if 0 return 1
  2258. #
  2259. #    If no remote filename given, assume file already open on receiving system
  2260. #
  2261.     tsend "CO 1 ",@remotefn,cr
  2262.     ttrap 5 "..."
  2263.     if 1 goto .UPL20
  2264.     return 1
  2265. .UPL20
  2266.     ttrap 2
  2267.     set @HLINDLY = @LINEDLY
  2268.     set @LINEDLY = "3"
  2269.     tupload @filename
  2270.     set @LINEDLY = @HLINDLY
  2271.     wait 2 idle
  2272. #
  2273.     if null @remotefn return 0
  2274.     tsend "^D"
  2275.     ttrap 5 ">"
  2276.     if 1 return 0
  2277.     return 1
  2278. end
  2279. #
  2280. #    START file transfer on remote system
  2281. #
  2282. .TRANSFER
  2283.     reps 3
  2284. #
  2285. .TRANS10
  2286.     tsend cr
  2287.     ttrap 5 ">","protocol","ppp"            # see what's happening
  2288.     if 1 or 2 goto .TRANS20         # we need to invoke BLAST
  2289.     if 3 return 0                # BLAST is already started
  2290.     if reps goto .TRANS10
  2291. #
  2292. #    Unable to get anything recognizable on remote computer - abort
  2293. #
  2294.     return 1
  2295. #
  2296. .TRANS20
  2297.     tsend "BLAST",cr                     # invoke BLAST in host mode
  2298.     ttrap 10 "ppp", "protocol",">"
  2299. #
  2300.     if 1 or 2 return 0            # BLAST started!
  2301.     if reps goto .TRANS20
  2302. #
  2303. #
  2304.     return 1
  2305. .END
  2306. :
  2307. ########################################
  2308. #
  2309. #    HP3000 MPE
  2310. #
  2311. #    NOTE:  This script assumes you are using the
  2312. #        standard prompt.  Problems may occur
  2313. #        otherwise.
  2314. #
  2315. :HP3000
  2316. #
  2317. .LOGON
  2318. #
  2319. #    Initialize flag, get necessary information
  2320. #
  2321. #
  2322.     if not null @userid goto .LOG10     # verify existence of userid
  2323.     ask "enter USER.ACCT",@userid
  2324.     if null @userid
  2325.     return 0                # return ok no error
  2326. end
  2327. #
  2328. .LOG10                        # ask for password
  2329.     if null @password
  2330.        ask noecho "enter password", @password
  2331.     end
  2332. #
  2333. #    Try to log in to the remote computer
  2334. #
  2335.     reps 5                    # repeat login procedure up to
  2336.                         # 5 times
  2337. #
  2338. .LOG20
  2339.     tsend cr,"\006",cr,cr                   # get response from remote
  2340.     ttrap 5 ":"
  2341.     if 1 goto .LOG30
  2342.     if reps goto .LOG20
  2343. #
  2344. #    Can't log in, inform user and exit
  2345. #
  2346.     return 1
  2347. #
  2348. .LOG30
  2349.     tsend "HELLO ",@userid,";TERM=18",cr                    # enter userid
  2350.     ttrap 10 "WORD","HP3000"                # wait for password prompt
  2351.     if 1 goto .LOG40
  2352.     if 2 return 0                # no password for username
  2353.     if reps goto .LOG20
  2354.     return 1
  2355. #
  2356. .LOG40
  2357.     tsend @password,cr            # enter password
  2358.     ttrap 20 "HP3000"                       # trap for HP prompt
  2359.     if 1 return 0                # got a system prompt
  2360. #
  2361. #    Incorrect userid/password - perhaps it was garbaged.
  2362. #    If we've only tried once, try again, otherwise exit.
  2363. #
  2364.     if reps goto .LOG20
  2365.     return 1
  2366. #
  2367. #    LOGOFF the remote system
  2368. #
  2369. .LOGOFF
  2370.     reps 4                    # try 4 times
  2371. #
  2372. .LGF10
  2373.     tsend BREAK,cr                # get system prompt
  2374.     ttrap 10 ":"
  2375.     if 1 goto .LGF20            # OK log off
  2376. #
  2377.     if reps goto .LGF10
  2378. #
  2379. #    Unable to get anything recognizable - abort
  2380. #
  2381.     return 1
  2382. #
  2383. .LGF20                        # hp logout
  2384.     tsend "BYE",cr
  2385.     return 0
  2386. #
  2387. #
  2388. #    UPLOAD a file to the remote system
  2389. #
  2390. .UPLOAD
  2391.     ask "enter filename to upload", @filename
  2392.     if null @filename return 0
  2393.     if exist @filename goto .UPL10
  2394.     werror "can't open ", @filename
  2395.     return 1
  2396. #
  2397. .UPL10
  2398.     ask "enter remote filename or <RETURN> to upload to system", @remotefn
  2399.     if null @remotefn goto .UPL20
  2400.     tsend cr
  2401.     ttrap 5 ":"
  2402.     if 0 return 1
  2403. #
  2404. #    If no remote filename given, assume file already open on receiving system
  2405. #
  2406.     tsend "EDITOR",cr
  2407.     ttrap 10 "/","CIERR"
  2408.     if 1 goto .UPL15
  2409.     return 1
  2410. .UPL15
  2411.     tsend "A",cr
  2412.     ttrap 4
  2413. .UPL20
  2414.     set @HLINDLY = @LINEDLY
  2415.     set @LINEDLY = "10"
  2416.     tupload @filename
  2417.     set @LINEDLY = @HLINDLY
  2418.     wait 2 idle
  2419.     tsend "\031"
  2420.     ttrap 5 "/"
  2421.     if 1
  2422.         tsend "K ",@remotefn,",UNN",cr
  2423.         ttrap 10 "/","OLD"
  2424.         if 1
  2425.             tsend "EXIT",cr
  2426.             return 0
  2427.         end
  2428.         if 2
  2429.             tsend "no"
  2430.             ttrap  10 "/"
  2431.             if 1 tsend "exit",cr
  2432.             ttrap 10 "CLEAR"
  2433.             if 1 tsend "Y",cr
  2434.             return 1
  2435.         end
  2436.         return 1
  2437. #
  2438.     if null @remotefn return 0
  2439.     tsend "\031"
  2440.     ttrap 5 ":"
  2441.     if 1 return 0
  2442.     return 1
  2443. end
  2444. #
  2445. #    START file transfer on remote system
  2446. #
  2447. .TRANSFER
  2448.     reps 3
  2449. #
  2450. .TRANS10
  2451.     tsend BREAK,cr
  2452.     ttrap 5 ":","protocol","ppp"            # see what's happening
  2453.     if 1 goto .TRANS20            # we need to invoke BLAST
  2454.     if 2 or 3 return 0            # BLAST is already started
  2455.     if reps goto .TRANS10
  2456. #
  2457. #    Unable to get anything recognizable on remote computer - abort
  2458. #
  2459.     return 1
  2460. #
  2461. .TRANS20
  2462.     tsend "RUN BLAST",cr                     # invoke BLAST in host mode
  2463.     ttrap 10 "ppp", "protocol","$","%"
  2464. #
  2465.     if 1 or 2 return 0            # BLAST started!
  2466.     if reps goto .TRANS20
  2467. #
  2468. #
  2469.     return 1
  2470. .END
  2471.