home *** CD-ROM | disk | FTP | other *** search
/ Mac Expert 1995 Winter / Mac Expert - Winter 95.iso / Les fichiers / Communications / Divers / DialScript 1.7.1 ƒ / Examples / AttackDial.ds next >
Encoding:
Text File  |  1994-03-07  |  639 b   |  27 lines  |  [TEXT/dIsR]

  1. script AttackDial  -- Dial number on Hayes modem until connect
  2.  
  3.    state Init
  4.       setvar Phone_Number "459-5346";
  5.       next "Dial";
  6.    end;
  7.  
  8.    state Dial
  9.       send "\r"; send "AT\r";
  10.       wait "OK";                -- This is bad.  Should have timeout.
  11.  
  12.       -- It would be faster to send "ATDT9876543\r"
  13.       send "ATDT"; send Phone_Number; send "\r";
  14.       select
  15.          "CONNECT" : next "GotIt";
  16.          "BUSY"         : next "Dial";
  17.          "NO CARRIER"   : next "Dial";
  18.          timeout 25     : display "Dial timeout!\r"; next "Dial";
  19.       end; 
  20.    end; -- Dial
  21.  
  22.    state GotIt
  23.       display "connected\r";
  24.    end;
  25.  
  26. end;
  27.