home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 3 Comm
/
03-Comm.zip
/
haotd1_1.zip
/
NEWSNET.CMD
< prev
next >
Wrap
OS/2 REXX Batch file
|
1995-10-12
|
3KB
|
112 lines
/* This program newsnet.cmd created by Hilgraeve and assigned to the Newsnet */
/* phonebook entry runs an automated logon script for connecting to Newsnet.*/
/* $Revision: 1.5 $ */
/* $Date: 1995/09/15 13:41:40 $ */
/* 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', 'HA_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
/* Pause 1 second */
IF (ReturnValue >= 0) THEN
ReturnValue = haSleep(scripthandle, 1000)
/* 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 is Tymenet, 2nd or 3rd is Telenet */
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 Newsnet */
IF returnvalue >= 0 THEN
returnvalue = haTypeText(scripthandle, 0, 'c net'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, 'net'cr)
END
/* Wait for a Newsnet prompt */
IF returnvalue >= 0 THEN
returnvalue = haWaitForPrompt(scripthandle, 1, '-->', 300, 11000)
/* Get User ID value from Runtime Values dialog box */
IF returnvalue >= 0 THEN
returnvalue = haGetRuntimeValue(scripthandle, 2, 1, 128, 'Buffer')
/* Add value to the login line */
IF returnvalue >= 0 THEN
DO
Buffer = LEFT(Buffer, LENGTH(Buffer) - 1)
logline = 'ID ' || Buffer
END
/* Get Password value from Runtime Values dialog box */
IF returnvalue >= 0 THEN
returnvalue = haGetRuntimeValue(scripthandle, 3, 1, 128, 'Bufferpas')
/* Add value to the log line */
IF returnvalue >= 0 THEN
logline = logline || ' ' || Bufferpas
/*Type the login line */
IF returnvalue >= 0 THEN
returnvalue = haTypeText(scripthandle, 0, logline || cr)
/* Terminate link between HyperACCESS and script program */
CALL haTerminate scripthandle
END
DROP scripthandle
CALL haDropFuncs