home *** CD-ROM | disk | FTP | other *** search
- /* Answer.baud Executed by Baud Bandit when RING is detected. */
-
- /* set up a list of names and passwords. expand as needed (all uppercase) */
- names. = '(not found)'
- names.GREG = 'NOT'
- names.DARYL = 'PUNK'
-
- Send 'ATA\r' /* Answer command */
- pull string /* Modems send a linefeed before responce */
- pull string /* Get modem responce */
- Msg '(' string ')' /* Display it local (DEBUG) */
-
- if left(string,7) ~= 'CONNECT' then exit
-
- Remote ON /* Enable remote echo */
-
- /* Welcome message */
- say '0C'x || 'Welcome to the Baud Bandit remote server demo.'
- say ''
-
- /* Ask for first name */
- options prompt 'Please enter first name: '
- pull name
-
- /* see if name is in database */
- if names.name = '(not found)' then do
- say 'Private system, access denied.'
- Remote OFF /* shut off remote echo. or something bad happens */
- Send '\ah' /* Amiga-H */
- exit
- end
-
- /* Ask for password */
- options prompt 'Password: '
- pull password
-
- /* see if password matches what we have */
- if names.name ~= password then do
- say 'Password incorrect, access denied.'
- Remote OFF
- Send '\ah'
- exit
- end
-
-
- /* get current data directory */
- OPTIONS RESULTS
- Status Dir
- directory = result
-
- /* Get current protocol */
- Status Trans
- protocol = RESULT
-
- do while string ~= 'G' /* continue loop untill [G]oodbye */
-
- say ''
- say ' --------- Main Menu ---------'
- say ''
- say ' [L]ist [U]pload'
- say ' [P]rotocol [D]ownload'
- say ' [G]oodbye [R]ead text file'
- say ' [H]elp'
- say ''
-
- /* make a nice prompt */
- options prompt 'Main > '
-
- /* pull command & arguments */
- parse upper pull string ' ' arg
-
- options prompt 'Filename: '
-
- if left(string,1) = 'L' then address command 'LIST' directory 'SORT'
- else if left(string,1) = 'P' then do
- if length(arg) = 0 then do /* show protocol menu */
- say ''
- say '[W]- WXModem'
- say '[X]- XModem-CRC'
- say '[K]- XModem-1K'
- say '[Y]- YModem-batch'
- say '[G]- YModem-G'
- say '[Z]- ZModem'
- say '[A]- ZModem (Upload anytime)'
- say ''
- options prompt protocol '> '
- pull arg
- end
- set arg
- Status Transfer
- protocol = RESULT
- end
- else if left(string,1) = 'D' then do
- if length(arg) = 0 then pull arg /* no filename given */
- if length(arg) ~= 0 then do /* check for filename */
- say 'Starting' protocol 'transfer'
- Send '\au-' || arg /* give Amiga-U with name */
- end
- end
- else if left(string,1) = 'U' then do
- if length(arg) = 0 then pull arg /* no filename given */
- if length(arg) ~= 0 then do /* check for filename */
- say 'Starting' protocol 'transfer'
- Send '\ad-' || arg /* give Amiga-D with name */
- end
- end
- else if left(string,1) = 'H' then do
- say ' Command summary:'
- say ' L List files in directory'
- say ' P Protocol menu. Or give option at main prompt (P Z)'
- say ' U Upload file. Optional ( U filename )'
- say ' D Download file. Optional ( D filename )'
- say ' R Read text file. Optional ( R filename )'
- say ' G Hangup'
- end
- else if left(string,1) = 'R' then do
- if length(arg) = 0 then pull arg /* no filename given */
- if length(arg) ~= 0 then
- address command 'CD' directory || '0A'x 'Type' arg
- end
- end
-
- say 'Goodbye' name || ', thank you for calling.'
- Remote off
- Send '\ah'
-
-