home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 3 Comm / 03-Comm.zip / haotd1_1.zip / BIX.CMD < prev    next >
OS/2 REXX Batch file  |  1995-10-12  |  3KB  |  107 lines

  1. /* This program bix.cmd created by Hilgraeve and assigned to the Bix phonebook*/
  2. /* entry runs an automated logon script for connecting to Bix.                  */
  3.  
  4. /*    $Revision: 1.6 $  */
  5. /*    $Date: 1995/09/15 13:32:41 $  */
  6.  
  7. /* Text within slashes and asterisks (like this line) are comments. */
  8. /* Parse the command line for arguments passed to this program */
  9. PARSE ARG pipename
  10.  
  11. /* Register external functions with REXX */
  12. CALL RxFuncAdd 'haLoadFuncs', 'HA_AUTO', 'RxhaLoadFuncs'
  13. CALL haLoadFuncs
  14.  
  15. /* Establish a link between this script program and HyperACCESS */
  16. scripthandle = 0
  17. scripthandle = haInitialize(1, pipename)
  18. DROP pipename
  19.  
  20. /* Process only if link with HyperACCESS was successful */
  21. IF scripthandle <> 0 THEN
  22.     DO
  23.     /* Initialize useful variables */
  24.     cr = '0D'x
  25.     lf = '0A'x
  26.     nul = '00'x
  27.     returnvalue = 0
  28.  
  29.     /* Type a '@D' */
  30.     IF returnvalue >= 0 THEN
  31.         returnvalue = haTypeText(scripthandle, 0, '@D')
  32.     
  33.     /* Pause 1 second */
  34.     IF (ReturnValue >= 0) THEN  
  35.         returnvalue = haSleep(scripthandle, 1000)
  36.  
  37.     /* Type an <enter> */
  38.     IF returnvalue >= 0 THEN
  39.         returnvalue = haTypeText(scripthandle, 0, cr)
  40.  
  41.     /* Wait for one of three prompts possible - first str is Tymenet, 2nd or 3rd isTelenet */
  42.     IF returnvalue >= 0 THEN
  43.         returnvalue = haWaitForPrompt(scripthandle, 3, 'ERMINAL='nul'r name: 'nul'identifier'nul, 300, 18000) 
  44.  
  45.     /* If Tymenet do this block */
  46.     IF returnvalue == 0 THEN 
  47.         DO
  48.  
  49.         /* Type an <enter> */
  50.         returnvalue = haTypeText(scripthandle, 0, cr)
  51.  
  52.         /* Wait for a prompt */
  53.         IF returnvalue >= 0 THEN
  54.             returnvalue = haWaitForPrompt(scripthandle, 1, '@', 300, 16000)
  55.  
  56.         /* Type text to request Bix */
  57.         IF returnvalue >= 0 THEN 
  58.             returnvalue = haTypeText(scripthandle, 0, 'c bix'cr)
  59.  
  60.         END
  61.  
  62.         /* If Telenet do this block */
  63.     ELSE 
  64.         DO
  65.         /* Type an 'a' */
  66.         returnvalue = haTypeText(scripthandle, 0, 'a')
  67.  
  68.         /* Wait for a prompt */
  69.         IF returnvalue >= 0 THEN
  70.             returnvalue = haWaitForPrompt(scripthandle, 1, 'log in: ', 300, 22000)
  71.  
  72.         /* Type text requesting Bix */
  73.         IF returnvalue >= 0 THEN
  74.             returnvalue = haTypeText(scripthandle, 0, 'bix'cr)
  75.         END
  76.  
  77.     /* Wait for a BIX prompt */
  78.     IF returnValue >= 0 THEN
  79.         returnvalue = haWaitForPrompt(scripthandle, 1, 'Name? ', 300, 11000)
  80.  
  81.     /* Get User ID value from Runtime Values dialog box */
  82.     IF returnvalue >= 0 THEN
  83.         returnvalue = haGetRuntimeValue(scripthandle, 2, 1, 128, 'Buffer')
  84.  
  85.     /* Type the User ID value */
  86.     IF returnvalue >= 0 THEN
  87.         returnvalue = haTypeText(scripthandle, 0, Buffer||cr)
  88.  
  89.     /* Wait for password prompt */
  90.     IF returnvalue >= 0 THEN
  91.         returnvalue = haWaitForPrompt(scripthandle, 1, 'ssword: ', 300, 22000)
  92.  
  93.     /* Get Password value from Runtime Values dialog box */
  94.     IF returnValue >= 0 THEN
  95.         returnvalue = haGetRuntimeValue(scripthandle, 3, 1, 128, 'Buffpas')
  96.  
  97.     /* Type the password value */
  98.     IF returnvalue >= 0 THEN
  99.         returnvalue = haTypeText(scripthandle, 0, Buffpas||cr)
  100.  
  101.     /* Terminate link between HyperACCESS and script program */
  102.     CALL haTerminate scripthandle
  103.     END
  104.  
  105. DROP scripthandle
  106. CALL haDropFuncs
  107.