;------------------------------------------------
; "DOOR" startup script for InterChange. |
; by Philip L. Becker Last Revised 06/19/93 |
;------------------------------------------------
; Notes:
;
; This script includes a simple menu system to select the door
; to run. It can easily be improved upon, but it should
; help to show you the basic idea...
;------------------------------------------------------------------------
:MENU
Message "^L Door Menu"
Message " ---------"
Message
Message "1. Late Night Poker"
Message "2. Hangman"
Message "3. Tradewars"
Message "4. Fantasy II"
Message
ACCEPT "Enter selection (or Q to quit): " TO S9
IF S9 = "Q" GOTO EXIT
IF S9 = "q" GOTO EXIT
IF S9 = "" GOTO EXIT
SET S1="LNP"
IF S9 = "1" GOTO RUNDOOR
SET S1="HANG"
IF S9 = "2" GOTO RUNDOOR
SET S1="TRADE"
IF S9 = "3" GOTO RUNDOOR
SET S1="FANTASY"
IF S9 = "4" GOTO RUNDOOR
Message
Pause "Invalid selection, Press any key..."
GOTO MENU
;
;---------------------------------------------------------
; S1 contains the DOS command to run the door's .BAT file
;---------------------------------------------------------
:RUNDOOR
Message
Message "Accessing door, stand by..."
ECHO OFF
;
;-------------------------------------------------------
; List all lines you have hooked to door computers
; in this GRAB command. Interchange will try them in
; the order you list them here.
;
; Example: GRAB 5-7,10,12 NO_LINES
;
; This example assumes lines 5, 6, 7, 10, and 12 are door machines.
;-------------------------------------------------------------------
GRAB 2 NO_LINES
;
;----------------------------------------------------------------
; Following assumes that /P1:"%TIMELEFT%" given on Opt Data that
; called InterChange. If it is missing, user is given unlimited
; time in the door.
;
SET S2="%P1%"
IF S2="" GOTO UNLIM
IF S2="Unlimited" GOTO UNLIM
GOTO CHKANS
:UNLIM
; Set door time = unlimited (big number)
SET S2="32767"
;
;----------------------------------------
; Now send proper graphics strings in S3
;
:CHKANS
SET S3="NG 0"
IF NOT ANSI GOTO NON_ANS
SET S3="GR 1"
:NON_ANS
;
;------------------------------------------------------------------------
; Send parameter string to TDOOR to startup the door program |
; |
; Note: %Y = COM PORT and %Z = bps rate in .TDT files... |
; |
; Params sent here map to % params for TDOOR .TDT files as follows: |
; |
; %0 %1 %2 %3 %4 %5&6 %7 |
; --- -------- ------------ ------------ ---- ---- --------- |
XMIT "TBBS: %S1% '%NAME%' '%LOCATION%' '%PASSWORD%' %S2% %S3% '%FIRST%'^M"
;------------------------------------------------------------------------
;
; Now wait for TDOOR to respond with "OK" or "ERROR"...
;
PATTERN 1 'OK^M'
PATTERN 2 'ERROR^M'
PATTERN 3 'ERROR1^M'
WAIT 5 RESPOND
IF NOT 1 GOTO ERROR
SESSION
END
;------------------------------------------------------------------------
; TDOOR responded "ERROR" indicating problem w/request
;
:ERROR
IF 3 GOTO ERROR1
RELEASE
Pause "Error starting Door. Press Any Key..."
END
;------------------------------------------------------------------------
; TDOOR could not locate the .BAT file for this door...
;
; Release the line and recycle menu after notifying user
;
:ERROR1
RELEASE
Pause "This Door is temporarily down. Press Any Key..."
GOTO MENU
;------------------------------------------------------------------------
; TDOOR did not respond in 5 seconds. Probably dead over there...
;
:RESPOND
RELEASE
Pause "Door not responding. Press Any Key..."
END
;------------------------------------------------------------------------
; The GRAB couldn't get a line. All door lines are busy...
;
:NO_LINES
Pause "Doors not available now, try later. Press Any Key..."
:EXIT
END