! ! This is a script file to make a Hayes Smartmodem dial out ... ! Print "^[[H^[[JTesting your Hayes Smartmodem ...^m" Send "^m" ; HSleep 60 ! First, wake up Hayes modem Listen ; Timer 3 ! See if we got it Send "AT Q0^m" ; Wait "OK" ! Wait for acknowledgement HSleep 60 ; Short pause for good measure If 255 GoTo Not_responding ! Looks dead or missing Sleep 1 ; Print "^mYour modem is OK.^m^m" Ask %Type /Type "T" for Tone dialing, "P" for Pulse: / Ask %Number /^m^mFull phone number to dial: / HSleep 30 ! Short pauses help Send "ATZ^m" ; Sleep 1 ! Try to reset the modem Timer 3 Send "AT H0 Q0 V1 E1^m" ! Set some parameters Wait "OK" "ERROR" HSleep 30 ! Short pauses help If 1 GoTo Learn_type ! Modem complained about setup string, or died Learn_type: HSleep 30 ! Give it a short rest Listen ; Timer 3 ! Make modem identify itself Send "ATI^m" ; Wait "123" "136" "OK" HSleep 60 ; If 2 GoTo Advanced ! Use special codes on new model GoTo Normal ! Normal Hayes type Advanced: Timer 3 ; Send "AT L1 X4^m" ! Special codes for the new modem Wait "OK" "ERROR" ; HSleep 30 Normal: HSleep 30 ! Give it a short rest SendCr "AT D%Type %Number " ! Dial the number Listen ; Timer 50 ! Listen now, wait a while Wait /CONNECT/ /BUSY/ /NO CARRIER/ /NO DIALTONE/ /NO ANSWER/ If 1 GoTo Online If 4 GoTo No_Dialtone GoTo Fail ! Can't get dialtone No_Dialtone: Print "^m^g^gYour Hayes Smartmodem 1200 isn't getting a dialtone. Please verify that: 1) Your modem is plugged into a phone line. " GoTo Leave Online: Sleep 1 ; Cr ; Sleep 1 ; Cr ; Sleep Print | ^g^g^g ONLINE!!! | Terminal_mode Fail: Print /^m^m^g^g^gHaving trouble accessing your system.^m/ GoTo Leave ! Modem is not responding Not_responding: Print "^m^g^gYour Hayes Smartmodem is not responding. Please verify that: 1) Your modem is of the right type 2) You are on the correct communications port 3) The modem has electrical power 4) The modem is connected to the PC. " GoTo Leave Leave: Ask %Ignore "Press RETURN to return to the menu: " Print "^[[H^[[J" ; Command-Mode