home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload / ShartewareOverload.cdr / comm / qns311.zip / Q-LOGON.SCR < prev    next >
Text File  |  1991-02-19  |  8KB  |  164 lines

  1. ;┌──────────────────────────────────────────────────────────────────────────┐
  2. ;│ Q-LOGON.SCR        Copyright 1988-1991 by Rik Brown                      │
  3. ;│                                                                          │
  4. ;│                    Log on script                                         │
  5. ;└──────────────────────────────────────────────────────────────────────────┘
  6.  
  7.   ASSIGN 6 0                            ; Set 0 = 1st time or carrier drop
  8.  
  9. DIALSEQUENCE:
  10.  
  11.   HANGUP                                ; Drop any prior connection
  12.   IF "$0" >=  "$maxdial"         LOGOFF ; Check max # of dial attempts
  13.   IF "$1" >=  "$maxconn"         LOGOFF ; Check max # of handshake attempts
  14.   IF "$4" >= "$maxulmail"        LOGOFF ; Quit if max UL attempts reached
  15.   IF "$3" >= "$maxdlmail"        LOGOFF ; Quit if max DL attempts reached
  16.   INCR 0                                ; Dials Counter
  17.   IF "$6" = "0"          INITIAL_SCREEN ; Setup screen if carrier drop
  18.   IF "$0" >= "2"          UPDATE_SCREEN ; Update Screen if Dial is 2 or greater
  19.  
  20. INITIAL_SCREEN:
  21.  
  22.   INCR 6                                ; Flag to indicate first attempt
  23.                                         ; (1st attempt after carrier loss, too)
  24.   ATWRITE 1  1 $scrcolor  "┌──────────────────────────────────────────────────────────────────────────────┐"
  25.   ATWRITE 1  2 $scrcolor  "│                                                                              │"
  26.   ATWRITE 29 2 $titlecolor "QNS v3.11 (02/19/90)"
  27.   ATWRITE 1  3 $scrcolor  "│                                                                              │"
  28.   ATWRITE 23 3 $titlecolor "Copyright 1988-1991 by Rik Brown"
  29.   ATWRITE 1  4 $scrcolor  "├──────────────────────────────────────────────────────────────────────────────┤"
  30.   ATWRITE 1  5 $scrcolor  "│                        Calling to:                                           │"
  31.   ATWRITE 38 5 $titlecolor "$bbsname"
  32.   ATWRITE 1  6 $scrcolor  "│                       Will upload:                                           │"
  33.   ATWRITE 38 6 $titlecolor "$2 $mailUL"
  34.   ATWRITE 1  7 $scrcolor  "│                                                                              │"
  35.   ATWRITE 1  8 $scrcolor  "│                           Phone 1:                                           │"
  36.   ATWRITE 38 8 $titlecolor "$phone1"
  37.   ATWRITE 1  9 $scrcolor  "│                           Phone 2:                                           │"
  38.   ATWRITE 38 9 $titlecolor "$phone2"
  39.   ATWRITE 1 10 $scrcolor  "│                                                                              │"
  40.   ATWRITE 1 11 $scrcolor  "│   STARTED:          on                        Handshake attempts:            │"
  41.   ATWRITE 1 12 $scrcolor  "│   CURRENT:          on                          Dialing attempts:            │"
  42.   ATWRITE 1 13 $scrcolor  "├──────────────────────────────────────────────────────────────────────────────┤"
  43.   ATWRITE 1 14 $scrcolor  "│         The latest version of QNS is available at TRAVEL ONLINE BBS          │"
  44.   ATWRITE 1 15 $scrcolor  "│       30,000 Files & 140+ Conferences with Upload Credits for Messages       │"
  45.   ATWRITE 1 16 $scrcolor  "│         (314) 973-4073 Hayes v.32 ■ St. Louis, MO (PC-Pursuit)               │"
  46.   ATWRITE 1 17 $scrcolor  "│         (314) 625-4045 Hayes v.32 ■ St. Charles, MO (Contel)                 │"
  47.   ATWRITE 1 18 $scrcolor  "└──────────────────────────────────────────────────────────────────────────────┘"
  48.  
  49. GOTOXY 1 1
  50.   GETSCR
  51.  
  52.   UPDATE_SCREEN:
  53.  
  54.   GOTOXY 1 1
  55.   PUTSCR
  56.   ATWRITE 14 11 $startcolor   "$stime"
  57.   ATWRITE 26 11 $startcolor   "$sdate"
  58.   ATWRITE 69 11 $startcolor   "$1 of $maxconn"
  59.   ATWRITE 14 12 $currentclr   "$time"
  60.   ATWRITE 26 12 $currentclr   "$date"
  61.   ATWRITE 69 12 $currentclr   "$0 of $maxdial"
  62.   IF "$5" = "1" PHONE1
  63.   IF "$5" = "2" PHONE2
  64.  
  65.   PHONE1:
  66.  
  67.     ATWRITE 27 9 $scrcolor " "
  68.     ATWRITE 27 8 $scrcolor ">"
  69.     GOTO DIAL_ROTATE
  70.  
  71.   PHONE2:
  72.  
  73.     ATWRITE 27 8 $scrcolor " "
  74.     ATWRITE 27 9 $scrcolor ">"
  75.     GOTO DIAL_ROTATE
  76.  
  77. DIAL_ROTATE:
  78.  
  79.   GOTOXY  1 19
  80. ; Following NOTE lines end with alt-255 which is required (do not change)
  81.   NOTE                                                           
  82.   NOTE                                                           
  83.   NOTE                                                           
  84.   NOTE                                                           
  85.   NOTE                                                           
  86.   GOTOXY  1 19
  87.  
  88.   FLUSH ALL                             ; Flush COM port and keyboard buffer
  89.  
  90.   IF "$5" = "1" DIAL1                   ; if counter = 1 go to dial 1
  91.   IF "$5" = "2" DIAL2                   ; if counter = 1 go to dial 2
  92.   IF "$5" = "3" DIAL1                   ; if counter = 3 go to dial 1
  93.  
  94.   DIAL1:
  95.     ASSIGN 5 1                          ; reset counter to 1 if = 3
  96.     SEND "^~^~^~^~ATDp $PHONE1^M"       ; call phone1
  97.     INCR 5                              ; Increase counter: dial rotation
  98.     GOTO DIAL_CONNECT
  99.  
  100.   DIAL2:
  101.     SEND "^~^~^~^~ATDp $PHONE2^M"       ; call phone2
  102.     INCR 5                              ; Increase counter: dial rotation
  103.     GOTO DIAL_CONNECT
  104.  
  105. DIAL_CONNECT:
  106.  
  107.   WHEN                                  ; Clear all WHENs
  108.   WHEN "RING"              DIALSEQUENCE ; Redial if incoming call rings
  109.   WHEN "BUSY"              DIALSEQUENCE ; Redial if BUSY message
  110.   WHEN "NO DIALTONE"       DIALSEQUENCE ; Redial if NO DIALTONE message
  111.   WHEN "NO CONNECT"        DIALSEQUENCE ; Redial if NO CONNECT message
  112.   WHEN "NO CARRIER"        DIALSEQUENCE ; Redial if NO CARRIER message
  113.  
  114.   TIMEOUT 60                CARRIERDROP ; Redial if no carrier within 60 secs
  115.   WAITFOR "CARRIER $minbaud"            ; (Keep 60 secs or can fail)
  116.  
  117.   INCR 1                                ; Increase handshake counter by 1
  118.  
  119.   NOTE                                                                       
  120.   NOTE ----------------------------------------------------------------------
  121.   NOTE ATTEMPT STATS: DIALS ($0) HANDSHAKES ($1) TIME ($TIME $DATE)
  122.   NOTE ----------------------------------------------------------------------
  123.   NOTE                                                                       
  124.  
  125. ; ALT-255 at end of 1st and last NOTE line above (do not alter)
  126.  
  127. ; If the script has executed this far a CARRIER has been detected. The
  128. ; following sequence ensures the minimum connect baud rate occurs.
  129.  
  130.   WHEN                                  ; Clear all WHENs
  131.   WHEN "NO CARRIER"         CARRIERDROP ; Redial if carrier drops
  132.   WHEN "(Enter)=no change?" "^~^~$language^M"    ; Use PCB Script Prompts
  133.  
  134.   TIMEOUT 10                        MNP ; Handling for BBS MNP modems
  135.   WAITFOR "(Enter)=no?"
  136. MNP:
  137.   SEND "^~^~N Q^M"                     ; Non-graphic & quick log on
  138.  
  139. ; Once the script has executed this far then the following lines will take
  140. ; us up to the Command prompt.
  141.  
  142.   WHEN
  143.   WHEN "first name?"              "^~^~$names^M" ; Send first & last name
  144.   WHEN "try again ..."            "^~^~$names^M" ; Resend names if garbled
  145.   WHEN "(Dots will echo)?"        "^~^~$pword^M" ; Send password
  146.   WHEN "password entered!"        "^~^~$pword^M" ; Resend password if garbled
  147.   WHEN "orrect?"                  "^~Y^M"        ; Correct city prompt
  148.   WHEN "(H)elp, More?"            "^~N^M"        ; Avoid successive screens
  149.   WHEN "(Enter)"                  "^~N^M"        ; Avoid successive screens
  150.   WHEN "Access Denied"                    LOGOFF ; LOGOFF if access denied
  151.   WHEN "Time Limit Exceeded"              LOGOFF ; LOGOFF if time exceeded
  152.   WHEN "NO CARRIER"                  CARRIERDROP ; Redial if carrier drops
  153.  
  154.   TIMEOUT 60                        DIALSEQUENCE ; Wait max 60 secs for
  155.   WAITFOR "ommand?"                              ; Command prompt
  156.  
  157.   WHEN                                           ; Clear all WHENS
  158.   RETURN                                         ; Return to calling script
  159.  
  160. CARRIERDROP:
  161.   SCRIPT $CMDSCRIPT
  162. LOGOFF:
  163.   SCRIPT Q-LOGOFF.SCR
  164.