home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: OtherApp
/
OtherApp.zip
/
rhinodem.zip
/
rcdemo.dat
/
cpcugmix.rrx
< prev
next >
Wrap
Text File
|
1995-09-19
|
3KB
|
126 lines
/* sample RhinoCom script that connects to the MIX */
/* (Capital PC Users Group BBS) */
/*
* Load all the system functions
* ( we will use SysSleep )
*/
call RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs'
call SysLoadFuncs
/*
* create convenient symbols for carriage return and newline
*/
CR = '0d'x
NL = '0a'x
/*
* Check the phone number field of the RhinoCom Notebook.
* If the number has not been filled in, ask the user for one,
* and place it in the field.
*/
RQUERY 'phone-number'
phone = rc
if phone = '' then do
ENTRYFIELD '"Enter Phone Number" "CPCUG MIX"'
phone = rc
if phone = '' then signal error1
rset 'phone-number' phone
end
/*
* Do the same thing for the Username field. This is a
* little different because Username is a named macro.
* Notice that we add a CR to the users response.
*/
RQUERY '@username'
username = rc
if username = '' then do
ENTRYFIELD '"Enter Username" "CPCUG MIX"'
username = rc
if username = '' then signal error1
NMDefine "named M'username'"username
end
/*
* And again for the password. Notice that the entryfield for
* this one echoes *'s instead of the characters typed.
*/
RQUERY 'password'
password = rc
if password = '' then do
ENTRYFIELD 'UNREADABLE "Enter Password" "CPCUG MIX"'
password = rc
if password = '' then signal error1
rset 'password' password
end
/*
* set up response strings
*/
'RESPONSE 1 MATCH /What is your first name?/ /EXEC username/'
'RESPONSE 2 MATCH /Password (Dots will echo)?/ /EXEC password/'
'RESPONSE 3 MATCH /More?/ /WRITE '||CR||'/'
"RESPONSE 4 MATCH /Scan Message Base Since 'Last Read' (Enter)=yes?/ /WRITE y"||CR||'/'
'RESPONSE 5 MATCH /Press (Enter) to continue?/ /WRITE '||CR||'/'
'RESPONSE 6 MATCH /Do you want graphics (Enter)=no?/ /WRITE '||CR||'/'
'RESPONSE 7 MATCH /Main Board Command?/ //'
/*
* dial the phone
*/
DIAL
call SysSleep 1
rsay CR||NL||'Dialing . . .'||CR||NL||CR||NL
/*
* as the response strings are activated, cancel them
* checking for #7, which indicates we are done
*/
TIMEOUT 1
n = 0
resp_num = 0
do while n <= 60
n = n + 1
WAITANY
resp_num = rc
if ( resp_num > 0 ) & ( resp_num < 8 ) then do
RESPONSE resp_num CANCEL
n = n - 5
end
if resp_num = 7 then leave
end
/*
* make sure all the response strings get canceled
*/
RESPONSE 1 CANCEL
RESPONSE 2 CANCEL
RESPONSE 3 CANCEL
RESPONSE 4 CANCEL
RESPONSE 5 CANCEL
RESPONSE 6 CANCEL
RESPONSE 7 CANCEL
if resp_num \= 7 then do
rsay nl cr 'Timeout Error logging onto CPCUG MIX' nl cr
end
exit
/*
* signal errors
*/
error1:
exit