;*************************** AMUS Program Label ******************************
; Filename: AMUS.AGO                                        Date: 11/01/93
; Category: COMM         Hash Code: 665-603-015-712      Version:
; Initials: BOB/AM       Name: KAREN BOJDA
; Company: SOFT MACHINES                           Telephone #: 2173517199
; Related Files: AMUS.BYE
; Min. Op. Sys.:                               Expertise Level: BEG
; Special: Requires AUTOLOG 2.3 or later and SETUP.AGO
; Description: AUTOLOG GO (script) file for calling the AMUS network.
; Requires customization of name, password, & dialing prefix. Hash is correct
; when AMUS prog.label is removed. Related AMUS.BYE used for logging off.
; Revised 11/1/93 with AMUS's new Longmont phone numbers.
;*****************************************************************************
:R
;****************************************************************
;* AMUS.AGO -- an AUTOLOG GO file for calling the AMUS network  *
;* Copyright 1990, 1993 Soft Machines                           *
;* revised 11/1/93 for AMUS's new Longmont phone numbers        *
;* DISCLAIMER: This GO file was tested in November 1993. If AMUS*
;*             has changed their log-in procedure or certain    *
;*             prompts, this GO file may not work anymore!      *
;*             Change the :R at the top of this file to :T to   *
;*             test the file & identify commands that aren't    *
;*             working due to changes on the AMUS network.      *
;*                                                              *
;* This file requires some customization: see the comments in   *
;*   boxes like this for areas you'll need to customize before  *
;*   trying to use this GO file.                                *
;* Be sure to download AMUS.BYE as well: it's the "log-off" file*
;*   that will be used for signing off AMUS when you FINISH your*
;*   session that was begun by using this GO file.              *
;****************************************************************

;****************************************************************
;* Customize your AMUS name & password here, by changing NAME & *
;* PASSWORD to your name and password. Your name and password   *
;* should remain in the < > angle brackets.                     *
;****************************************************************
SETMACRO 0:<NAME>
SETMACRO 1:<PASSWORD>

;****************************************************************
;* Customize the dialing prefix for AMUS. If AMUS is a local    *
;* call, leave the dialing prefix between the < > characters    *
;* below blank. If you must dial 1, change the prefix between   *
;* the < > characters to 1. For most everyone else outside the  *
;* (303) area code, you can leave it as is.                     *
;* You may also include special prefixes, such as 9, that you   *
;* need to dial before dialing the phone number.                *
;****************************************************************
SETMACRO 2:<1303>

TERSE T
FOLD T
STALL T
XY=0
lookup LIB:amus.bye
if err0 = 0 GOTO START
lookup amus.bye
if err0 = 0 goto START
:<**** Can't find AMUS.BYE - you must logoff manually when done ****
>
START:
:<Calling AMUS...
>
;****************************************************************
;* You will need a file called SETUP.AGO. SETUP.AGO, if it      *
;* doesn't already exist, must contain a LINK and a MODEM       *
;* command.                                                     *
;****************************************************************
go setup        ; Your setup file should contain your LINK and MODEM commands
if err0#0 setmacro 9:<Can't find SETUP.AGO, which is needed to use this GO file>
if err0#0 goto NO'WORK
generic true
:<Modem acquired
>
;****************************************************************
;* Remove the ";" in front of the "baud 2400" commmand below for*
;* modems that don't offer independent serial port and phone    *
;* call baud rates. Change the "2400" to whatever is appropriate*
;* for your modem.                                              *
;****************************************************************
;baud 2400
SET REG(3)=4    ; try dialing 3 times
;****************************************************************
;* Dial commands for most users                                 *
;****************************************************************
REDIAL: SET REG(3)=REG(3)-1     ; decrement dial attempt counter
       IF REG(3)=0 SETMACRO 9:<No answer or busy line>
       IF REG(3)=0 goto NO'WORK        ; we've tried 3 times w/o success
       :<dialing $2 678-8702...
>
       dial $2 6788702
       if err0 = 0 goto DIALED
       :<dialing $2 678-8770...
>
       dial $2 6788770
       if err0 = 0 goto DIALED
       :<dialing $2 678-8847...
>
       dial $2 6788847
       if err0 # 0 goto REDIAL
;****************************************************************
;* Dial command for DataRace modem users.                       *
;* REPLACE the above "REDIAL:" section with the "REDIAL:" sec-  *
;* tion that follows to dial AMUS's DataRace modem.             *
;****************************************************************
;REDIAL:        SET REG(3)=REG(3)-1     ; decrement dial attempt counter
;       IF REG(3)=0 SETMACRO 9:<No answer or busy line>
;       if REG(3)=0 goto NO'WORK        ; we've tried 3 times w/o success
;       :<dialing $2 678-8941...
;>
;       dial $2 6788941
;       if err0 # 0 goto REDIAL

DIALED: SLEEP 0.5
;       get debug.log   ; for use if you're having problems
BMATCH: SET REG(3)=6    ; try 5 times for "Welcome" message
       IF ""
SENDCR: SET REG(3)=REG(3)-1     ; decrement attempt counter
       IF REG(3)=0 SETMACRO 9:<Can't get "Welcome" message from AMUS>
       IF REG(3)=0 goto SIGNON         ; tried 5 times w/o success
       SAY "^M"
       SLEEP 1
       until "WELCOME" 5
       IF ERR0 = 0 GOTO GOT'PROMPTS
       UNTIL "PLEASE ANSWER" 5
       IF ERR0 = 0 GOTO GOT'PROMPTS
       SAY "^C"
       GOTO SENDCR
GOT'PROMPTS:
       UNTIL "HAVE YOU USED THIS SYSTEM BEFORE" 5
       SAY "Y^M"
       UNTIL "DO YOU WANT A LIST OF AVAILABLE DRIVERS" 5
       SAY "N^M"
       UNTIL "ENTER DRIVER NAME" 5
       SAY "GENERC^M"
       :S
       XY = 0
       UNTIL "DONE" 10
       :R
       UNTIL "INITIALS" 20
       IF ERR0 = 0 GOTO SIGNON ; if we've got the TSASS sign-on screen
       SAY "^C"
       GOTO SENDCR
SIGNON:
       SET REG(4)=4    ; try sign-on 3 times
LOOP:
       SET REG(4)=REG(4)-1
       IF REG(4)#0 GOTO TRY'SIGNON
       IF REG(3)=0 GOTO NO'WORK
       SETMACRO 9:<AMUS doesn't accept name & password>
       GOTO NO'WORK
TRY'SIGNON:
       IF ""
       say "^Y"
;****************************************************************
;* Make sure you've customized this GO file for your name and   *
;* password at the beginning of this file.                      *
;****************************************************************
       say "$0^M"      ; Name
       sleep 0.3
       say "^Y"
       say "$1^M"      ; Password
       sleep 0.3
       say "^Y"
       sleep 0.5
       say "AM^M"      ; Galactic ID
GOTIN:
       SLEEP 3
       if "USER NOT ON FILE" goto LOOP
       UNTIL "THANK YOU" 10
       IF ERR0#0 GOTO LOOP
       BYE AMUS.BYE    ; the "log-off" file to use when we finish
       GOTO DONE
NO'WORK:
       XY = 22 ; Cleaning up - turn blink off
       XY = 28 ; Cleaning up - turn cursor on
       HANGUP
       :<
$9
Please try again later.
>
FINISH
:X
DONE:   PEEK 2
       TALK