home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 3 Comm
/
03-Comm.zip
/
CJBNIT.CMD
< prev
next >
Wrap
OS/2 REXX Batch file
|
1992-01-10
|
6KB
|
169 lines
/* Nitewing BBS Frontdoor 2.02 (for OS/2 PMCOMM 1.09) */
/* Using either RAMAIL or MKQWK */
/* 12/7/91 Chuck Brazie RD3 Box 226 Newark Valley, NY 13811 */
Signal ON SYNTAX NAME SYNTAX_ERROR
TRACE O
Parse arg port portname screen_handle dde_output dde_input semaphore
Parse source . . fn .
Call RxFuncAdd "init_dll","RxPmcomm","init_dll"
Call init_dll
cr = '0d'x
crlf = '0a0d'x
esc = '1B'x
Call read_timeout "20000",port
/*********************************************************************/
/* Set up the download and upload paths for the mail packets */
/*********************************************************************/
DownloadPacketDir = "C:\SLMR\READ"
UploadPacket = "C:\SLMR\REPLY\NITEWING.REP"
DownloadPacket = "C:\SLMR\READ\NITEWING.QWK"
MailDoor = 'M' /* R=RAMail M=MKQwk */
/*Call wait_fore "twice for NiteWing",port,screen_handle*/
Call put_s esc||esc,port
Call put_s 'Escape Escape was entered...',screen_handle
Call wait_fore "Last Name:","Full Name",port,screen_handle
Call put_s "xxxxxxxxxxxx"||cr,port
Call wait_fore "Password: ",port,screen_handle
Call put_s "xxxxxxxxxxxxx"||cr,port
Call wait_fore "to Continue",port,screen_handle
Call put_s cr,port
ContinueFlag = 1
/**********************************************************************/
/* Skip by the logo, quickflash, and message scan. */
/**********************************************************************/
Do Forever
Call Wait_fore 'new files',, /* 1 */
'Continue [Y/n/=]?',, /* 2 */
'Press [Enter] ',, /* 3 */
'TOP Command',, /* 4 */
'read this mail now',, /* 5 */
'Check for waiting mail',, /* 6 */
'More(Y/n/=)',, /* 7 */
'Press (Enter)',, /* 8 */
'Press [Return]',, /* 9 */
'QuickFlash',, /* 10 */
port,screen_handle
match = result
Select
When (match=1 | match=5 | match=6) then Call Put_s 'n',port
When (match=2) then Call Put_s 'y',port
When (match=7 & (ContinueFLag = 1)) then Call Put_s 'y',port
When (match=7 & (ContinueFLag = 0)) then Call Put_s 'n',port
When (match=3 | match=8 | match=9) then Call Put_s cr,port
When (match=10) then ContinueFlag = 0
When match=4 then leave
Otherwise nop
End/* select */
End/* do forever*/
/**********************************************************************/
/* Go to the express mail area. */
/**********************************************************************/
Call Put_s 'M',port /* message area */
Call wait_fore "Select",port,screen_handle
Call Put_s 'X',port /* express mail */
Call wait_fore "Select",port,screen_handle
IF MailDoor = 'R' THEN
DO /*RaMail */
Call Put_s 'R',port /* Ramail System */
Call wait_fore "press any key",port,screen_handle
Call Put_s cr,port
Call wait_fore "uit to BBS",port,screen_handle
END /* Ramail */
ELSE
DO /* MKQwk */
Call Put_s 'M',port /* MKQwk System */
Call wait_fore "uit to Bbs",port,screen_handle
END /* MKQwk */
/**********************************************************************/
/* If we have a reply to upload, do it now. */
/**********************************************************************/
replyfile = stream(UploadPacket,'c','query exists')
If Replyfile <> '' THEN
DO
Call Put_s 'U',port /* Upload packet */
IF MailDoor = 'R' THEN /* RaMail system */
Call wait_fore "Start your upload NOW!",port,screen_handle
ELSE
Call wait_fore "Ready to receive:",port,screen_handle
Call zmodem_send UploadPacket,dde_output,dde_input
IF (result <> 0) THEN
DO /* upload successful */
'@ERASE 'UploadPacket
END
IF MailDoor = 'R' THEN /* RaMail */
DO
Call wait_fore "press any key",port,screen_handle
Call Put_s cr,port
Call wait_fore "uit to BBS",port,screen_handle
END
ELSE /* MKQwk */
Call wait_fore "uit to Bbs",port,screen_handle
END /* there was data to send */
/**********************************************************************/
/* Download any mail. */
/**********************************************************************/
Call Put_s 'D',port /* Download packet */
IF MailDoor = 'R' THEN /* RaMail */
DO
Call wait_fore "oodbye after Transfer",,
"Press any key",, /* no Mail to send */
port,screen_handle
END /* RaMail */
ELSE
DO /* MKQwk */
Call wait_fore "oodbye after transfer",port,screen_handle
Call Put_s 'Y',port
Call wait_fore "Packing",,
"No Messages Found To Send",,
port,screen_handle
END /* MKQwk */
IF (result = 1) THEN /* mail to download and goodbye after */
DO
IF MailDoor = 'R' THEN /* RaMail */
DO
Call Put_s 'G',port
Call wait_fore "Start your download NOW!",,
port,screen_handle
END /* RaMail */
ELSE
DO /* MKQwk */
Call wait_fore "Ready to send:",,
port,screen_handle
END /* MKQwk */
IF (result = 1) THEN
DO
'@ERASE 'DownloadPacket
Call Set_download_path DownloadPacketDir,dde_output
Call zmodem_receive dde_output,dde_input
END
END/* mail to download */
ELSE /* no mail */
IF ((result=2) & (MailDoor = 'R')) THEN
DO /* RaMail */
Call Put_s cr,port /* no mail today */
Call wait_fore "uit to BBS",,
port,screen_handle
Call Put_s 'G',port /* Goodbye */
END /* RaMail */
Call beep 350,100
Call beep 150,100
Call beep 350,100
RETURN
/* Standard handler for SIGNAL on ERROR, will help in the debuging */
syntax_error:
fp = filespec("path",fn)
fd = filespec("drive",fn)
errormsg = 'REXX error' rc 'in line' sigl':' errortext(rc)
errorfile = fd||fp||"SCRIPT.ERR"
rc = lineout(errorfile,date() time() fn '-' errormsg)
rc = lineout(errorfile,date() time() fn '-' sourceline(sigl))
Exit