home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Fresh Fish 8
/
FreshFishVol8-CD2.bin
/
bbs
/
comm
/
dcdd-1.8.lha
/
DCDD
/
Do_FAAX.rexx
< prev
next >
Wrap
OS/2 REXX Batch file
|
1993-08-26
|
5KB
|
209 lines
/*
Do_FAAX.rexx 930826.2144
(you can follow along on the ZZZ_FAAX_session_log file)
*/
address BAUD /* must have this here */
OPTIONS RESULTS
timeout 30
auto = 'n'
waitlost = ' '
if exists('ram:AUTO')~=0 then
auto = 'y'
call LOGON
if auto = 'y' then do
if waitlost = 'n' then do
call AUTO_NEW_FILE_LIST
end
end
if auto = 'y' then do
if waitlost = 'n' then do
call LOGOFF
end
else
call LOGOFF
end
if waitlost = 'y' then do
if exists('RAM:continue')~=0 then do
address command 'delete RAM:continue'
end
end
return
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* *
* Functions / Subroutines *
* *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
LOGON:
address BAUD /* must have this here */
waitlost = ' '
waitlost_LO_hold = ' '
do forever
nput='Escape twice,First and Last name,Password:,continue,mail now? [Y/n]:,DDDDDDY,quit):'
wait nput
NRC = RC
NRESULT = RESULT
if NRC > 0 then do /* waited 30 seconds & no nput items on serial port */
waitlost = 'y'
msg '****** Logon wait is LOST! ******'
end
if NRESULT = 'Escape twice' then /* A */
send '\w\w\x1B\x1B'
if NRESULT = 'First and Last name' then /* B */
send '\wYour Name\r'
if NRESULT = 'Password:' then /* C */
send 'Your Password\r'
if NRESULT = 'Press enter...' then /* D */
send '\r'
if NRESULT = 'continue' then /* E F */
send '\r'
if NRESULT = 'mail now? [Y/n]:' then do /* G */
if auto = 'y' then do
send 'y\r'
waitlost_LO_hold = waitlost
call MAIL_CALL
if waitlost = 'n' then
waitlost = waitlost_LO_hold
end
else do
send 'n\r'
end
end
if NRESULT = 'DDDDDDY' then /* Q R */
send '\r'
if NRESULT = 'quit):' then do /* S */
waitlost = 'n'
send '\r'
end
if waitlost ~= ' ' then
leave
end
return
MAIL_CALL:
address BAUD /* must have this here */
waitlost = ' '
do forever
nput='More(Y/n/=),(E)nter? (S)top:,(F)iles? (S)top:,to continue:,(Enter to continue):,(A)bort:,here [y/N],End of messages'
/* note use of ? to allow entry of a comma into nput above "(E)nter? (S)top:" */
wait nput
NRC = RC
NRESULT = RESULT
if NRC > 0 then do /* waited 30 seconds & no nput items on serial port */
waitlost = 'y'
msg '****** Mail_Now - wait is LOST! ******'
end
if NRESULT = 'More(Y/n/=)' then /* */
send '='
if NRESULT = '(E)nter, (S)top:' then /* H N O */
send 'n\r'
if NRESULT = '(F)iles, (S)top:' then /* I */
send 'f\r'
if NRESULT = 'to continue:' then /* J */
send '\r'
if NRESULT = '(Enter to continue):' then /* K */
send '\r'
if NRESULT = '(A)bort:' then /* L */
send 's\r'
if NRESULT = 'here [y/N]' then /* M */
send 'y\r'
if NRESULT = 'End of messages' then /* P */
waitlost = 'n'
if waitlost ~= ' ' then
leave
end
return
AUTO_NEW_FILE_LIST:
address BAUD /* must have this here */
waitlost = ' '
loop_count = 0
do forever
nput='Command ->,Enter Disk Number:,Time Left [,Search Date,Previous Page:'
wait nput
NRC = RC
NRESULT = RESULT
if NRC > 0 then do /* waited 30 seconds & no nput items on serial port */
waitlost = 'y'
msg '****** Auto_New_File_List wait is LOST! ******'
end
if NRESULT = 'Command ->' then /* T */
send 't\r'
if NRESULT = 'Enter Disk Number:' then /* U */
send '0\r'
if NRESULT = 'Time Left [' then do /* V W */
loop_count = loop_count + 1
if loop_count = 1 then
send '#' /* V */
if loop_count = 2 then
send 'n' /* W */
if loop_count = 3 then do
waitlost = 'n'
send 'q' /* Z */
end
if loop_count > 3 then do
waitlost = 'y'
msg '****** Auto_New_File_List (time left) > 3 ******'
end
end
if NRESULT = 'Search Date' then /* X */
send '\r'
if NRESULT = 'Previous Page:' then /* Y */
send 'y'
if waitlost ~= ' ' then
leave
end
return
LOGOFF:
address BAUD /* must have this here */
waitlost = ' '
loop_count = 0
do forever
nput='Command ->'
wait nput
NRC = RC
NRESULT = RESULT
if NRC > 0 then do /* waited 30 seconds & no nput items on serial port */
waitlost = 'y'
msg '****** Logoff wait is LOST! ******'
end
if NRESULT = 'Command ->' then do /* A1 A2 */
loop_count = loop_count + 1
if loop_count = 1 then
send 'g\r' /* A1 */
if loop_count = 2 then do
waitlost = 'n'
send 'y\r' /* A2 */
end
if loop_count > 2 then do
waitlost = 'y'
msg '****** Logoff (command ->) > 2 ******'
end
end
if waitlost ~= ' ' then
leave
end
return