DEBUG_TOGGLE

'
' Sample GEnie login script
'

PRINT "\r\nAir Warrior login...\r\n" 1 0

' Set the redial count to 5 trys

REDIAL 5

SEND_INIT 10 0

RECEIVE 10 "OK"
	ON 0 :DIAL
	ERROR_GOTO :NOMODEM

:REDIAL

PRINT "\r\nPausing before retry...\r\n" 1 0

WAIT 10

:DIAL

WAIT 2

PRINT "\r\nDialing GEnie...\r\n" 1 0

DIALING 0

PRINT "\r\nWaiting for answer...\r\n" 1 0

RECEIVE 30 "CONNECT" "BUSY" "NO CARRIER"
	ON 0	:LOGIN
	ON 1	:REDIAL
	ON 2	:REDIAL
	ERROR_GOTO :ERROR

:LOGIN

WAIT 2

SEND 30 "HHH" 50

RECEIVE 20 "U#="
	ERROR_GOTO	:ERROR

WAIT 1

SEND_LOGIN 10 0

RECEIVE 60 "<CR> to continue"
	ERROR_GOTO	:ERROR

SEND_COMMAND 10 0

:SUCCESS
PRINT "\r\nLogin complete\r\n" 1 0
DONE


:NOMODEM

PRINT "\r\nModem is not responding!\r\n" 1 0
ERROR_END


:ERROR

PRINT "\r\nLogin failed\r\n" 1 0
ERROR_END