home *** CD-ROM | disk | FTP | other *** search
- /* This program bix.cmd created by Hilgraeve and assigned to the Bix phonebook*/
- /* entry runs an automated logon script for connecting to Bix. */
-
- /* $Revision: 1.1 $ */
- /* $Date: 1996/07/02 14:53:47 $ */
-
- /* Text within slashes and asterisks (like this line) are comments. */
- /* Parse the command line for arguments passed to this program */
- PARSE ARG pipename
-
- /* Register external functions with REXX */
- CALL RxFuncAdd 'haLoadFuncs', 'HAP_AUTO', 'RxhaLoadFuncs'
- CALL haLoadFuncs
-
- /* Establish a link between this script program and HyperACCESS */
- scripthandle = 0
- scripthandle = haInitialize(1, pipename)
- DROP pipename
-
- /* Process only if link with HyperACCESS was successful */
- IF scripthandle <> 0 THEN
- DO
- /* Initialize useful variables */
- cr = '0D'x
- lf = '0A'x
- nul = '00'x
- returnvalue = 0
-
- /* Type a '@D' */
- IF returnvalue >= 0 THEN
- returnvalue = haTypeText(scripthandle, 0, '@D')
-
- /* Pause 1 second */
- IF (ReturnValue >= 0) THEN
- returnvalue = haSleep(scripthandle, 1000)
-
- /* Type an <enter> */
- IF returnvalue >= 0 THEN
- returnvalue = haTypeText(scripthandle, 0, cr)
-
- /* Wait for one of three prompts possible - first str is Tymenet, 2nd or 3rd isTelenet */
- IF returnvalue >= 0 THEN
- returnvalue = haWaitForPrompt(scripthandle, 3, 'ERMINAL='nul'r name: 'nul'identifier'nul, 300, 18000)
-
- /* If Tymenet do this block */
- IF returnvalue == 0 THEN
- DO
-
- /* Type an <enter> */
- returnvalue = haTypeText(scripthandle, 0, cr)
-
- /* Wait for a prompt */
- IF returnvalue >= 0 THEN
- returnvalue = haWaitForPrompt(scripthandle, 1, '@', 300, 16000)
-
- /* Type text to request Bix */
- IF returnvalue >= 0 THEN
- returnvalue = haTypeText(scripthandle, 0, 'c bix'cr)
-
- END
-
- /* If Telenet do this block */
- ELSE
- DO
- /* Type an 'a' */
- returnvalue = haTypeText(scripthandle, 0, 'a')
-
- /* Wait for a prompt */
- IF returnvalue >= 0 THEN
- returnvalue = haWaitForPrompt(scripthandle, 1, 'log in: ', 300, 22000)
-
- /* Type text requesting Bix */
- IF returnvalue >= 0 THEN
- returnvalue = haTypeText(scripthandle, 0, 'bix'cr)
- END
-
- /* Wait for a BIX prompt */
- IF returnValue >= 0 THEN
- returnvalue = haWaitForPrompt(scripthandle, 1, 'Name? ', 300, 11000)
-
- /* Get User ID value from Runtime Values dialog box */
- IF returnvalue >= 0 THEN
- returnvalue = haGetRuntimeValue(scripthandle, 2, 1, 128, 'Buffer')
-
- /* Type the User ID value */
- IF returnvalue >= 0 THEN
- returnvalue = haTypeText(scripthandle, 0, Buffer||cr)
-
- /* Wait for password prompt */
- IF returnvalue >= 0 THEN
- returnvalue = haWaitForPrompt(scripthandle, 1, 'ssword: ', 300, 22000)
-
- /* Get Password value from Runtime Values dialog box */
- IF returnValue >= 0 THEN
- returnvalue = haGetRuntimeValue(scripthandle, 3, 1, 128, 'Buffpas')
-
- /* Type the password value */
- IF returnvalue >= 0 THEN
- returnvalue = haTypeText(scripthandle, 0, Buffpas||cr)
-
- /* Terminate link between HyperACCESS and script program */
- CALL haTerminate scripthandle
- END
-
- DROP scripthandle
- CALL haDropFuncs
-