home *** CD-ROM | disk | FTP | other *** search
/ Simtel MSDOS 1992 December / simtel1292_SIMTEL_1292_Walnut_Creek.iso / msdos / procomm / pcplus2.arc / PURSUIT.ASP < prev    next >
Text File  |  1988-01-01  |  9KB  |  287 lines

  1. ;*************************************************************************
  2. ;* PURSUIT.ASP  (C) 1987 DATASTORM TECHNOLOGIES, INC.                    *
  3. ;*                                                                       *
  4. ;* This script file is used to dial PC Pursuit numbers.  It Demonstrates *
  5. ;* menu building, branching on user input, etc.  Please note that only   *
  6. ;* one PC Pursuit city (Atlanta) is implemented in this demo.            *
  7. ;*                                                                       *
  8. ;* A color monitor is assumed.                                           *
  9. ;*                                                                       *
  10. ;* String variables are used extensively here.  Their uses are:          *
  11. ;*                                                                       *
  12. ;* S0 - holds user input for SWITCHing                                   *
  13. ;* S1 - holds PCP city name                                              *
  14. ;* S2 - holds PCP city area code                                         *
  15. ;* S3 - holds final destination name                                     *
  16. ;* S4 - holds final destination phone number                             *
  17. ;* S5 - holds user input for SWITCHing                                   *
  18. ;* S6 - you must set to modem dial command and local TELENET number      *
  19. ;* S7 - you must set to apporpriate baud rate (3 or 12)                  *
  20. ;* S8 - you must set to your PCP user id                                 *
  21. ;* S9 - you must set to your PCP password                                *
  22. ;*                                                                       *
  23. ;*************************************************************************
  24.  
  25. ; Customization area - you need to change these for your setup
  26.  
  27.    ASSIGN S9 "12"               ; Enter the baudrate to use here, 3 or 12
  28.    ASSIGN S8 "xxxxxxx"          ; Enter the ID to be used here
  29.    ASSIGN S7 "xxxxxxxx"         ; Enter the PASSWORD to be used here
  30.    ASSIGN S6 "ATDTxxx-xxxx^M"   ; Enter dial cmd and local telenet # here
  31.  
  32.    SET CR CR                    ; make sure no extra LF's in menus
  33.    CUROFF                       ; turn off the cursor
  34.    CLEAR 2                      ; clear the screen
  35.  
  36. ; Build the first menu
  37.  
  38.    BOX 1 23 21 55 31            ; draw the box
  39.    ATSAY  2 26 30 "PC PURSUIT AVAILABLE CITIES"
  40.    ATSAY  3 23 31 "╟───────────────────────────────╢"
  41.    ATSAY  4 30 30 " 1- ATLANTA"
  42.    ATSAY  5 30 30 " 2- BOSTON"
  43.    ATSAY  6 30 30 " 3- DALLAS"
  44.    ATSAY  7 30 30 " 4- DENVER"
  45.    ATSAY  8 30 30 " 5- DETROIT"
  46.    ATSAY  9 30 30 " 6- HOUSTON"
  47.    ATSAY 10 30 30 " 7- LOS ANGELES"
  48.    ATSAY 11 30 30 " 8- NEWARK"
  49.    ATSAY 12 30 30 " 9- NEW YORK"
  50.    ATSAY 13 30 30 "10- PHILADELPHIA"
  51.    ATSAY 14 30 30 "11- SAN FRANCISCO"
  52.    ATSAY 15 30 30 "12- SEATTLE"
  53.    ATSAY 16 30 30 "13- WASHINGTON, DC"
  54.    ATSAY 17 30 30 " 0- EXIT"
  55.    ATSAY 18 23 31 "╟───────────────────────────────╢"
  56.    ATSAY 19 25 30 "ENTER THE # OF THE CITY OF"
  57.    ATSAY 20 25 30 "YOUR CHOICE:"
  58.  
  59. L1:                             ; label for use by default case
  60.  
  61.    ATGET 20 38 113 2 S0         ; get the user's response
  62.  
  63.    SWITCH S0                    ; switch on choice
  64.  
  65.       CASE "0"                  ; EXIT this script
  66.          CLEAR                  ; clear the screen
  67.          MESSAGE "PC Pursuit script ended."
  68.          CURON                  ; turn the cursor on.
  69.          TERMINAL               ; EXIT script and enter terminal mode
  70.       ENDCASE
  71.  
  72.       CASE "1"                  ; chose ATLANTA
  73.          ASSIGN S1 "ATLANTA"    ; save the city name
  74.          ASSIGN S2 "404"        ; save the area code
  75.          GOSUB ATLANTA          ; go get number to dial
  76.       ENDCASE
  77.  
  78.       DEFAULT                   ; all other cases
  79.          LOCATE 22,24
  80.          SOUND 220 20           ; error noise
  81.          LOCATE 22,24
  82.          MESSAGE "Not yet implemented in this demo"
  83.          LOCATE 22,24
  84.          PAUSE 2
  85.          MESSAGE "                                "
  86.          GOTO L1
  87.       ENDCASE
  88.    ENDSWITCH
  89.  
  90. ;
  91. ; Ok, call the local TELENET number first.  This is an example of
  92. ; redialing without using the DIAL or Alt-R commands
  93. ;
  94.  
  95.    CLEAR                        ; ready to call TELENET
  96.    SET PARITY EVEN              ; set parms for TELENET
  97.    SET DATABITS 7
  98.    MESSAGE "DIALING PCP"        ; let em know whats happening
  99.    LOCATE 0,12
  100.    MESSAGE S1                   ; include city in message
  101.  
  102. L2:                             ; label for busy TELENET
  103.  
  104.    TRANSMIT S6                  ; call local Telenet
  105.    WAITFOR "CONNECT" 15         ; give it 15 seconds to answer
  106.  
  107.    IF NOT WAITFOR               ; it didn't connect, assume busy
  108.       CLEAR                     ; example of redialing without Alt-R
  109.       HANGUP
  110.       MESSAGE "PCP TELENET IS BUSY.  REDIALING..."
  111.       GOTO L2
  112.    ENDIF
  113.  
  114. ;
  115. ; Ok, made it to local telenet number, now call the remote PCP city
  116. ; Notice that we redial at this point as well
  117. ;
  118.  
  119.    PAUSE 2
  120.    TRANSMIT "^m^m"              ; Get Telenet's attention
  121.    WAITFOR "="                  ; Wait for 'TERMINAL=' prompt
  122.    TRANSMIT "D1^M"              ; Enter terminal type
  123.    WAITFOR "@"                  ; Wait for Telenet prompt
  124.  
  125. L3:                             ; label for busy remote PCP city
  126.    TRANSMIT "C DIAL"
  127.    TRANSMIT S2                  ; area code
  128.    TRANSMIT "/"
  129.    TRANSMIT S9                  ; BAUD RATE
  130.    TRANSMIT ","
  131.    TRANSMIT S8                  ; ID
  132.    TRANSMIT "^M"                ; cr
  133.  
  134.    WAITFOR "="                  ; Wait for 'PASSWORD=' prompt
  135.  
  136.    TRANSMIT S7                  ; Enter password
  137.    TRANSMIT "^M"                ; cr
  138.  
  139.    RGET S5                      ; Get the CR echoed from our TRANSMIT
  140.    RGET S5                      ; Get the CR that precedes PCP messages
  141.    RGET S5                      ; Get the actual message
  142.    PAUSE 1                      ; Display it briefly
  143.  
  144.    FIND S5 "CONNECT"            ; Look for connection
  145.  
  146.    IF NOT FOUND                 ; No connection
  147.       CLEAR
  148.       MESSAGE "THE REMOTE PCP IS BUSY.  REDIALING..." S1
  149.       LOCATE 1 0
  150.       GOTO L3
  151.    ENDIF
  152.  
  153. ;
  154. ; Ok, made it to the remote PCP city.  Display appropriate message
  155. ; then call the actual destination, again using a redial
  156. ;
  157.  
  158.    CLEAR
  159.    MESSAGE "CONNECTED TO PCP"
  160.    LOCATE 0,17
  161.    MESSAGE S1
  162.    LOCATE 1,0
  163.    MESSAGE "DIALING"
  164.    LOCATE 1,8
  165.    MESSAGE S3
  166.  
  167. L4:                             ; label for busy number
  168.  
  169.    LOCATE 2 0
  170.    TRANSMIT "ATZ^M"             ; Wake up remote modem
  171.    WAITFOR "OK"                 ; Wait for 'OK' prompt
  172.  
  173.    TRANSMIT "ATDT"
  174.    TRANSMIT S4                  ; THE NUMBER
  175.    TRANSMIT "^M"                ; CR
  176.  
  177.    RGET S0                      ; Get CR echoed from our TRANSMIT
  178.    RGET S0 80 40                ; Get CR that precedes PCP messages
  179.    RGET S0                      ; Get the real message
  180.    PAUSE 2
  181.  
  182.    FIND S0 "BUSY"               ; was it busy?
  183.    IF FOUND
  184.       CLEAR
  185.       MESSAGE "BUSY.  REDIALING..." S3
  186.       GOTO L4
  187.    ENDIF
  188.  
  189.    FIND S0 "CONNECT"            ; did it connect?
  190.    IF FOUND
  191.       SET PARITY NONE           ; Switch to N/8/1 for BBS work
  192.       SET DATABITS 8
  193.       CLEAR
  194.       MESSAGE "CONNECTED TO"
  195.       LOCATE 0,13
  196.       MESSAGE S3
  197.       LOCATE 1,0
  198.       MESSAGE "LOGON PRECEEDING"
  199.    ELSE                         ; not busy or connect, assume error
  200.       CLEAR
  201.       MESSAGE "NO CONNECT OR BUSY. REDIALING"
  202.       GOTO L4
  203.    ENDIF
  204.  
  205.    ALARM 2                      ; sound alarm for 2 seconds
  206.    EXIT                         ; we made it!
  207.  
  208.  
  209.  
  210. ;********************************************************************
  211. ;
  212. ; SUBROUTINES START HERE
  213. ;
  214. ;********************************************************************
  215.  
  216. ATLANTA:
  217.  
  218.    CLEAR
  219.    BOX 5 25 18 53 31
  220.    ATSAY  5 29 30 " ATLANTA BBS NUMBERS "
  221.    ATSAY  7 29 30 "1- ALTGATE"
  222.    ATSAY  8 29 30 "2- Flagship Express"
  223.    ATSAY  9 29 30 "3- BYTE Connection"
  224.    ATSAY 10 29 30 "4- Microstuf BBS"
  225.    ATSAY 11 29 30 "5- Software Link BBS"
  226.    ATSAY 12 29 30 "6- PC-Exchange BBS"
  227.    ATSAY 13 29 30 "M- Manual Dial"
  228.    ATSAY 15 25 31 "╟───────────────────────────╢"
  229.    ATSAY 16 27 30 "ENTER THE # OF THE BBS OF"
  230.    ATSAY 17 27 30 "YOUR CHOICE:"
  231.  
  232. ATL1:
  233.  
  234.    ATGET 17 40 113 1 S5
  235.  
  236.    SWITCH S5
  237.  
  238.       CASE "1"
  239.          ASSIGN S3 "ATLGATE"            ; save the BBS name
  240.          ASSIGN S4 "9281876"            ; save the number
  241.       ENDCASE
  242.  
  243.       CASE "2"
  244.          ASSIGN S3 "Flagship Express"
  245.          ASSIGN S4 "9344515"
  246.       ENDCASE
  247.  
  248.       CASE "3"
  249.          ASSIGN S3 "BYTE Connection"
  250.          ASSIGN S4 "9410159"
  251.       ENDCASE
  252.  
  253.       CASE "4"
  254.          ASSIGN S3 "Microstuf_BBS"
  255.          ASSIGN S4 "9988048"
  256.       ENDCASE
  257.  
  258.       CASE "5"
  259.          ASSIGN S3 "Software Link"
  260.          ASSIGN S4 "9986737"
  261.       ENDCASE
  262.  
  263.       CASE "6"
  264.          ASSIGN S3 "PC-Exchange BBS"
  265.          ASSIGN S4 "9776686"
  266.       ENDCASE
  267.  
  268.       CASE "M"
  269.          CLEAR
  270.          LOCATE 5,20
  271.          MESSAGE "NUMBER TO DIAL:"
  272.          LOCATE 5,36
  273.          ASSIGN S3 "MANUAL DIAL"
  274.          GET S4
  275.       ENDCASE
  276.  
  277.       DEFAULT
  278.          MESSAGE "^G"
  279.          LOCATE 17,40
  280.          GOTO ATL1
  281.       ENDCASE
  282.  
  283.    ENDSWITCH
  284. RETURN
  285.  
  286. ;************* End of Subroutines **********************************
  287.