home *** CD-ROM | disk | FTP | other *** search
Wrap
/* 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:44 $ */ /* This program os2share.cmd, created by Hilgraeve and assigned to the */ /* OS/2 Shareware BBS phonebook entry runs an automated logon script for */ /* connecting to the OS/2 Shareware 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, 'r name: ', 300, 10000) /* Grab the User Name variable from the Runtime Values dialog */ IF returnvalue >= 0 THEN returnvalue = haGetRuntimeValue(scripthandle, 1, 1, 128, 'name') /* Type out the user name */ IF returnvalue >= 0 THEN returnvalue = haTypeText(scripthandle, 0, name || cr) /* Wait for the yes or no prompt and hit carriage return */ IF returnvalue >= 0 THEN returnvalue = haWaitForPrompt(scripthandle, 1, ' [Y,n]? ',300, 10000) IF returnvalue >= 0 THEN returnvalue = haTypeText(scripthandle, 0, cr) /* Wait for the password prompt */ IF returnvalue >= 0 THEN returnvalue = haWaitForPrompt(scripthandle, 2,'ssword: 'nul'vince: 'nul, 300, 10000) /* If we get the password prompt, type the password, otherwise, this person is a new user and must manually login */ IF returnvalue == 0 THEN DO /* Get the password value from the Runtime Values dialog */ returnvalue = haGetRuntimeValue(scripthandle, 3, 1, 128,'password') IF returnvalue >= 0 THEN /* Type the password */ returnvalue = haTypeText(scripthandle, 0, password || cr) /* Wait for the continue prompt and hit carriage return */ IF returnvalue >= 0 THEN returnvalue = haWaitForPrompt(scripthandle, 1, 'ontinue ', 300, 10000) IF returnvalue >= 0 THEN returnvalue = haTypeText(scripthandle, 0, cr) END ELSE /* Prompt with this message when the user is new to the OS/2 Shareware BBS. They need to answer additional questions that we cannot answer with the script */ returnvalue = haMessageBox(scripthandle, "OS/2 Shareware BBS Login","You are a new user to the OS/2 Shareware BBS, please continue to login manually",0, nul, 2) /* Terminate link between HyperACCESS and script program */ CALL haTerminate scripthandle END DROP scripthandle CALL haDropFuncs