home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 3 Comm
/
03-Comm.zip
/
hab4_d1.zip
/
HAOS2D.Z
/
IBM.CMD
< prev
next >
Wrap
OS/2 REXX Batch file
|
1995-08-10
|
3KB
|
77 lines
/* A REXX script MUST begin with a commented line */
/* Text within slashes and asterisks (like this line) are comments. */
/* $Revision: 1.3 $ */
/* $Date: 1995/08/09 17:00:05 $ */
/* 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', 'HA_AUTO', 'RxhaLoadFuncs'
CALL haLoadFuncs
/* Establish a link between this script program and HyperACCESS */
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
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 */
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