home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 3 Comm
/
03-Comm.zip
/
AUTOPO.ZIP
/
POSTREP.ASP
< prev
next >
Wrap
Text File
|
1991-08-28
|
7KB
|
143 lines
;POSTREP.ASP IBM EEP BBS posting script for automatically dialing,
;logging in, and posting reply messages generated from READBBS.CMD
;as modified for REPnnnnn.m naming convention where nnnnn is the message
;number and m is the message base
;Public Domain....by Don Babcock Jr. P.E. 8/91
proc main
set baudrate 2400
init n1 4 ;initialize a retry variable for 3 tries
start: ;retry label
dec n1 ;decrement retry counter
if zero n1 ;if expired execute another scrip
execute "postrep" ;in this case, retry this one indefinitely
endif
hangup ;hangup the line
transmit "AT^M" ;have we got a live modem?
waitfor "OK" 4
if not waitfor ;if not start over
GOTO start
endif
transmit "ATZ^M" ;reset modem
pause 1 ;wait a second
transmit "ATV1^M" ;set up verbal result codes level 1
waitfor "OK" 4 ;ack
if not waitfor ;not ack-ed, start over
GOTO start
endif
pause 1 ;wait a second
transmit "ATX6^M" ;set up response level
waitfor "OK"
if not waitfor ;if not set up start over
GOTO start
endif
pause 1 ;wait a second
transmit "ATDT9,18004263389^M" ;dial the IBM EEP BBS
waitfor "CONNECT 2400" 60 ;wait for a connection
if not waitfor ;if we didn't get it start over
GOTO start
endif
pause 1 ;wait a second
waitfor "First Name ->" 60 ;wait for login prompt
if not waitfor
GOTO start ;didn't get it, start over
endif
pause 1 ;wait a second
transmit "Don^M" ;send first name
waitfor "Last Name ->" 60 ;wait for login prompt
if not waitfor
GOTO start ;didn't get it, start over
endif
pause 1 ;wait a second
transmit "Babcock^M" ;send last name
waitfor "(Not Displayed) ->" 60 ;wait for password prompt
if not waitfor
GOTO start ;didn't get it, start over
endif
pause 1
transmit "(your password)^M" ;send password
waitfor "ontinue?" 60 ;wait for next prompt
transmit "^M" ;send a carriage return (CARET)
waitfor "execute ?" 60 ;waitfor BBS command prompt
string msgbase ;initialize string variable for message base file name
string msg ;initialize string varialbe for message number
integer another=0 ;initialize another file flag
findfirst "rep?????.?" ;search for files using wildcard
if found ;we found at least 1
another = 1 ;set flag to look for another
when 0 "[N]o?" transmit "N" ;set up when condition to handle messages longer than 1 screen
;by sending a CARET when prompted for more
assign msgbase $FEXT ;parse the message base from the file extension
strcmp msgbase "7" 1 ;if it is message base 7 map it to 20
if SUCCESS
assign msgbase "20"
endif
substr msg $FNAME 3 5 ;parse the message number from REPnnnnn
transmit "J " ;send J [message base] <CR> to join
transmit msgbase ;the appropriate message base
transmit "^M"
waitfor "execute ?" 60 ;wait for the command prompt
transmit "R " ;send R [msg] <CR> to read the message
transmit msg ;that we wish to reply to.
transmit "^M"
waitfor "Read message(s)?" 120 ;wait for the sub-command prompt
transmit "R^M" ;transmit R <CR> to reply.
transmit "^M" ;Accept the next 5 default responses
transmit "^M"
transmit "^M"
transmit "^M"
transmit "^M"
waitfor "1]" 180 ;wait for the line input prompt
sendfile ascii $FILENAME ;ASCII send the reply file
transmit "^M" ;end the last line sent
transmit "^M" ;send a blank line to get into sub-command mode
transmit "S^M" ;send S <CR> to save the file
waitfor "Read message(s)?" 120 ;wait for the sub-command prompt
WHILE another ;There was at least one reply file so check for
findnext ;another and loop until no more are found
if found ;we found one
assign msgbase $FEXT
strcmp msgbase "7" 1
if SUCCESS
assign msgbase "20"
endif
strcmp msgbase "7" 1 ;if it is message base 7 map it to 20
if SUCCESS
assign msgbase "20"
endif
substr msg $FNAME 3 5 ;parse the message number from REPnnnnn
transmit "J " ;send J [message base] <CR> to join
transmit msgbase ;the appropriate message base
transmit "^M"
waitfor "Read message(s)?" 60 ;wait for the command prompt
transmit msg ;send [msg] <CR> to read the message
transmit "^M" ;that we wish to reply to.
waitfor "Read message(s)?" 120 ;wait for the sub-command prompt
transmit "R^M" ;transmit R <CR> to reply.
transmit "^M" ;Accept the next 5 default responses
transmit "^M"
transmit "^M"
transmit "^M"
transmit "^M"
waitfor "1]" 180 ;wait for the line input prompt
sendfile ascii $FILENAME ;ASCII send the reply file
transmit "^M" ;end the last line sent
transmit "^M" ;send a blank line to get into sub-command mode
transmit "S^M" ;send S <CR> to save the file
waitfor "Read message(s)?" 120 ;wait for the sub-command prompt
ELSE
exitwhile ;no more REP files found.
endif
endwhile
endif
transmit "Q^M" ;get back to the command prompt"
waitfor "execute ?" 60 ;wait for it
transmit "G^M" ;send G <CR> for goodbye
pause 2 ;wait two seconds
transmit "^M" ;transmit a CARET to speed logoff
hangup ;hangup the modem
quit ;exit PROCOMM
endproc