home *** CD-ROM | disk | FTP | other *** search
- /* A REXX script MUST begin with a commented line */
- /* Text within slashes and asterisks (like this line) are comments. */
-
- /* $Revision: 1.1 $ */
- /* $Date: 1996/07/02 14:53:41 $ */
-
- /* This program ibm.cmd, created by Hilgraeve and assigned to the */
- /* IBM National Support BBS phonebook entry runs an automated logon script */
- /* for connecting to the IBM National Support BBS. */
-
- /* 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 /* This is the hex value for carriage return */
- lf = '0A'x /* This is the hex value for line feed */
- nul = '00'x /* This is the hex value for null */
-
- returnvalue = 0
-
- /* Wait for the name prompt */
- IF returnvalue >= 0 THEN
- returnvalue = haWaitForPrompt(scripthandle, 1, '-> ', 300, 19000)
-
- /* Grab the user name from the Runtime Values dialog */
- IF returnvalue >= 0 THEN
- returnvalue = haGetRuntimeValue(scripthandle, 1, 1, 128, 'szName')
-
- /* Type the user name in */
- IF returnvalue >= 0 THEN
- returnvalue = haTypeText(scriptHandle, 0, szName || cr)
-
- /* Wait for the password or new user prompt */
- IF returnvalue >= 0 THEN
- returnvalue = haWaitForPrompt(scripthandle, 2, '>'||'1B'x'[33;1m'nul', [N]o? 'nul, 300, 120000)
-
- /* If we get the first prompt, this means this person is already a user
- on IBM's BBS. We'll query their password setting and log them in,
- otherwise, this person will need to provide some additional information
- that we cannot answer with the script */
- IF returnvalue == 0 THEN
- DO
- /* Grab the password from the Runtime Values dialog */
- returnvalue = haGetRuntimeValue(scripthandle, 3, 1, 128, 'szPassword')
-
- /* Type the password in */
- IF returnvalue >= 0 THEN
- returnvalue = haTypeText(scripthandle, 0, szPassword || cr)
-
- /* Wait for the continue prompt and hit carriage return */
- IF returnvalue >= 0 THEN
- returnvalue = haWaitForPrompt(scripthandle, 1, 'ntinue? ', 300, 16000)
- IF returnvalue >= 0 THEN
- returnvalue = haTypeText(scripthandle, 0, cr)
- END
- ELSE
- /* Inform this person that they are a new user and must login manually */
- returnvalue = haMessageBox(scripthandle, "IBM National Support BBS", "You are a new user to IBM's BBS, please continue to login manually",0, nul, 2)
-
- /* Terminate link between HyperACCESS and script program */
- CALL haTerminate scripthandle
- END
-
- DROP scripthandle
- CALL haDropFuncs
-