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

  1. /* This program sio.cmd created by Hilgraeve and assigned to the SIO support*/
  2. /* phonebook entry runs an automated logon script for connecting to the SIO support service  */
  3.  
  4. /*    $Revision: 1.4 $  */
  5. /*    $Date: 1995/09/13 15:02:07 $  */
  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.     /* Wait for initail prompt */
  30.     IF returnvalue >= 0 THEN
  31.         returnvalue = haWaitForPrompt(scripthandle, 1, 'er)=no? ', 300, 15000)
  32.     /* Type Y for yes, ANSI graphics */
  33.     IF returnvalue >= 0 THEN
  34.         returnvalue = haTypeText(scripthandle, 0, 'y'cr)
  35.  
  36.     /* Wait for  name prompt */
  37.     IF returnvalue >= 0 THEN
  38.         returnvalue = haWaitForPrompt(scripthandle, 1, 'me? '||'1B'x'[0m', 300, 14000)
  39.  
  40.     /* Get/prompt for User ID value from Runtime Values dialog box--full name first and last */
  41.     IF returnvalue >= 0 THEN
  42.         returnvalue = haGetRuntimeValue(scripthandle, 1, 1, 128, 'nameval')
  43.  
  44.     /* Type the User Name  */
  45.     IF returnvalue >= 0 THEN
  46.         returnvalue = haTypeText(scripthandle, 0, nameval||cr)
  47.  
  48.     /* Wait for password prompt or new caller prompt */
  49.     IF returnvalue >= 0 THEN
  50.         returnvalue = haWaitForPrompt(scripthandle, 2, '[13D'||'1B'x'[0m'nul'[0mC'||'1B'x'[1D'nul , 300, 13000)
  51.  
  52.  
  53.     /* If std login - do this block */
  54.     IF returnvalue == 0 THEN DO
  55.         
  56.         /* Get/prompt for Password value from Runtime Values dialog box */
  57.         IF returnvalue >= 0 THEN
  58.             returnvalue = haGetRuntimeValue(scripthandle, 3, 1, 128, 'passval')
  59.  
  60.         /* Type the password value */
  61.         IF returnvalue >= 0 THEN
  62.             returnvalue = haTypeText(scripthandle, 0, passval||cr)
  63.  
  64.         /* Wait for message prompt */
  65.         IF returnvalue >= 0 THEN
  66.             returnvalue = haWaitForPrompt(scripthandle, 1, 'es? '||'1B'x'[0m', 300, 19000)
  67.  
  68.         /* Type ENTER for message search */
  69.         IF returnvalue >= 0 THEN
  70.             returnvalue = haTypeText(scripthandle, 0, cr)
  71.  
  72.     END
  73.  
  74.         /* If first time caller to SIO BBS do this block */
  75.     ELSE DO
  76.  
  77.         /* DIsplay message box telling user to continue reg but abort script */
  78.         IF returnvalue >= 0 THEN
  79.             returnvalue = haMessageBox(scripthandle, 'HyperACCESS Message', 'Your name was not found in the User file of this BBS. Please continue BBS logon manually as a new user', 0, nul, 1)
  80.         
  81.     END
  82.  
  83.     
  84.     /* Terminate link between HyperACCESS and script program */
  85.     CALL haTerminate scripthandle
  86.     END
  87. DROP scripthandle
  88. CALL haDropFuncs
  89.