home *** CD-ROM | disk | FTP | other *** search
/ Love Bytes / LoveBytes.bin / btinter / win31 / btintnet.z / BTDIALUP.SCR < prev    next >
Encoding:
Text File  |  1996-03-15  |  9.2 KB  |  440 lines

  1. :(o,,(
  2. <**************************************************************************>
  3. <* This script was automatically generated by WDial teach mode ver. 3.20. *>
  4. <* Created: Sat Dec 23 13:09:07 1995                                      *>
  5. <**************************************************************************>
  6. ))
  7.  
  8. :(o,,(
  9. <*****************************************>
  10. <* Trac equivalent of (slang_init_modem) *>
  11. <*****************************************>
  12. ))
  13. :(mm,slang_init_modem,(
  14.     :(wdial_status,(Initializing the modem...))
  15.     :(s,tmp,:(wdial_modem,init))
  16.     :(pc,(
  17.         :(pc,(
  18.             :(ei,:(tn,tmp,1,(:(px))),~,(
  19.                 :(iwm,1000)
  20.             ),(
  21.                 :(tps,tmp,:(as,:(tpr,tmp),1))
  22.                 :(px)
  23.             ))
  24.         ),-1)
  25.         :(iz2)
  26.         :(o2,:(ts,tmp,,|,(:(px))):(bxo,0d))
  27.         :(s,resp,:(iwt2,10000,OK,ERROR))
  28.         :(pc,(
  29.             :(ttci,resp,OK,(
  30.                 :(px)
  31.             ))
  32.             :(ttci,resp,ERROR,(
  33.                 :(wdial_status,(Modem Error))
  34.                 :(g)
  35.             ))
  36.             :(wdial_messagei,
  37.                 (Your modem is not responding. )
  38.                 (Please be sure it is turned on and connected to your )
  39.                 (computer correctly. Would you like to try again?),YESNO,Q,1,(
  40.                 :(tps,tmp,0)
  41.                 :(ibdf)
  42.                 :(iwm,1000)
  43.                 :(ibdo)
  44.                 :(iwm,1000)
  45.             ),(
  46.                 :(wdial_status,(No response from modem))
  47.                 :(g)
  48.             ))
  49.         ))
  50.     ),-1)
  51.     :(iwm,2000)
  52.     :(d,resp)
  53.     :(d,tmp)
  54.   
  55. ))
  56.  
  57.  
  58.  
  59. :(o,,(
  60. <************************************************>
  61. <* Connect to provider, with redial/retry logic *>
  62. <************************************************>
  63. ))
  64. :(mm,connect,(
  65.  :(wdial_polli,physical,open,1,(                
  66.  
  67.   <* Hangup *>
  68.   :(o2,:(wdial_modem,hangup):(tca,13))
  69.   :(s,junk,:(iwt2,2000,OK))
  70.   :(d,junk)
  71.  ))
  72.  
  73.  :(slang_init_modem)
  74. <* Init the modem *>
  75.  
  76.  :(s,pnum,:(wdial_phone,number))
  77.  :(ei,:(r,pnum),,(
  78.   :(s,pnum,:(wdial_prompt,(Please enter the phone number to
  79. dial:)))
  80.  ))
  81.  :(tra,pnum,:(tca,41))
  82.  
  83.   <* Get rid of parentheses *>
  84.  :(tra,pnum,:(tca,40))
  85.  :(tra,pnum,(-))
  86.  <* Get rid of dashes *>
  87.  
  88.  :(s,dmsg,(NONE))
  89.  :(pc,(
  90.   :(iz2)
  91.   :(wdial_status,(Last Error:):(r,dmsg):(tca,10)
  92.    (Dialing...))
  93.   :(s,again,n)
  94.  <* Clear loop again flag *>
  95.  
  96.   <* Dial *>
  97.   :(o2,
  98.    :(wdial_modem,dial)
  99.    :(ei,:(wdial_phone,prefix),,,(
  100.     :(wdial_phone,prefix)
  101.     <* :(pc,(:(wdial_modem,pause)),2) *>
  102.    ))
  103.    :(r,pnum)
  104.    :(ei,:(wdial_phone,ext),,,(
  105.     :(pc,(:(wdial_modem,pause)),2)
  106.     :(wdial_phone,ext)
  107.    ))
  108.    :(tca,13)
  109.   )
  110.   :(s,junk,:(iwt2,1000))            
  111.  
  112. <* Empty Recv Buffer *>
  113.   :(d,junk)
  114.  
  115.   <* Wait for response *>
  116.   :(wdial_status,(Last Error:):(r,dmsg):(tca,10)
  117.    (Dialing...):(tca,10)
  118.    (Timeout in %d seconds)
  119.    ,:(aq,:(wdial_phone,timeout),1000))
  120.  
  121. :(s,response,:(iwt2,:(wdial_phone,timeout),CONNECT,BUSY,ERROR,
  122.    (NO CARRIER),(NO DIALTONE),(NO ANSWER)))
  123.  
  124.   :(pc,( <* Case *>
  125.    :(ttci,response,CONNECT,(
  126.     :(s,again,done)
  127.     :(px)
  128.    ))
  129.    :(ttci,response,BUSY,(
  130.     :(wdial_status,(BUSY))
  131.     :(s,query,:(wdial_message,(The number 
  132. you
  133. dialed is Busy. Would you
  134. like to try again?),YESNO,q,1,y,n))
  135.     :(s,again,:(r,query))
  136.     :(s,dmsg,(BUSY))
  137.     :(px)
  138.    ))
  139.  
  140.    :(ttci,response,ERROR,(
  141.     :(wdial_status,(Modem Error))
  142.     :(wdial_message,(Modem Error, Connection
  143. Failed),OK,e)
  144.     :(px)
  145.    ))
  146.    :(ttci,response,(NO CARRIER),(
  147.     :(wdial_status,(NO CARRIER))
  148.     :(s,query,:(wdial_message,(Unable to
  149. connect to remote modem. Would you
  150. like to try again?),YESNO,q,1,y,n))
  151.     :(s,again,:(r,query))
  152.     :(s,dmsg,(NO CARRIER))
  153.     :(px)
  154.    ))
  155.    :(ttci,response,(NO DIALTONE),(
  156.     :(wdial_status,(NO DIALTONE))
  157.     :(s,query,:(wdial_message,(No 
  158. Dialtone.
  159. Would you like to try
  160.  
  161. again?),YESNO,q,1,y,n))
  162.     :(s,again,:(r,query))
  163.     :(s,dmsg,(NO DIALTONE))
  164.     :(px)
  165.    ))
  166.    :(ttci,response,(NO ANSWER),(
  167.     :(wdial_status,(NO ANSWER))
  168.     :(s,query,:(wdial_message,(No Answer.
  169. Would you like to try
  170. again?),YESNO,q,1,y,n))
  171.     :(s,again,:(r,query))
  172.     :(s,dmsg,(NO ANSWER))
  173.     :(px)
  174.    ))
  175.    <* Unknown response / TIMEOUT *>
  176.    :(o2,:(tca,13))
  177.    :(wdial_status,(TIMEOUT))
  178.    :(s,query,:(wdial_message,(TIMEOUT. Would you
  179. like to try
  180. again?),YESNO,q,1,y,n))
  181.    :(wdial_pause,5000)
  182.    :(iz2)
  183.    :(s,again,:(r,query))
  184.    :(s,dmsg,(TIMEOUT))
  185.   ),1) <* End Case *>
  186.  
  187.   <* Check for loop again *>
  188.   :(ei,:(r,again),y,,(
  189.    :(px)
  190.   ))
  191.  ),-1)
  192.  
  193.  
  194.  :(ei,:(r,again),done,,(
  195.   :(sexit)
  196.  ))
  197.  
  198.  :(d,again,query,response,pnum)
  199.  
  200.  :(wdial_status,(Waiting for Physical Connection...):(tca,10)
  201.   (Timeout in %d seconds),:(aq,:(wdial_phone,timeout),1000))
  202.  :(wdial_polli,physical,open,:(wdial_phone,timeout),(
  203.   :(wdial_status,(Physical connection established))
  204.   :(wdial_pause,1000)
  205.  ),(
  206.   :(wdial_message,(Physical layer not opened. Connection
  207. Failed!),OK,e)
  208.   :(sexit)
  209.  ))
  210. ))
  211.  
  212.  
  213.  
  214.  
  215. :(o,,(
  216. <********************************************>
  217. <* Wait for callback (for DEFENDER systems) *>
  218. <********************************************>
  219. ))
  220. :(mm,callback,(
  221.  :(wdial_status,(Waiting for provider to hangup...):(tca,10)
  222.   (Timeout in %d seconds),:(aq,:(wdial_phone,timeout),1000))
  223.  :(wdial_polli,physical,closed,:(wdial_phone,timeout),,(
  224.   :(wdial_message,(The provider never hung up. Connection
  225. Failed!),OK,e)
  226.   :(sexit)
  227.  ))
  228.  
  229.  :(wdial_status,(Waiting for callback...):(tca,10)
  230.   (Timeout in %d seconds),24000)
  231.  :(s,tmp,:(iwt2,2400000,RING))        <* Wait for
  232. RING *>
  233.  :(ttci,tmp,RING,,(
  234.   :(wdial_message,(The provider never called back.
  235. Connection Failed!),OK,e)
  236.   :(sexit)
  237.  ))
  238.  
  239.  :(wdial_status,(Answering phone))
  240.  :(o2,ATA:(tca,13))
  241.  <* Answer Modem *>
  242.  
  243.  :(wdial_status,(Waiting for Physical Connection...):(tca,10)
  244.   (Timeout in %d seconds),:(aq,:(wdial_phone,timeout),1000))
  245.  :(wdial_polli,physical,open,:(wdial_phone,timeout),(
  246.   :(wdial_status,(Physical connection established))
  247.   :(wdial_pause,1000)
  248.  ),(
  249.   :(wdial_message,(Physical layer not opened. Connection
  250. Failed!),OK,e)
  251.   :(sexit)
  252.  ))
  253. ))
  254.  
  255. :(mm,abort,(
  256.  :(wdial_status,(Not connected))
  257.  :(wdial_message, (The other side hung up. Connection Failed!))
  258.  :(g)
  259.  <* exit script if no carrier *>
  260. ))
  261.  
  262. :(mm,did_they_hang_up?,(
  263.  :(wdial_polli, physical, open, , , (
  264.   :(abort)
  265.  ))
  266. ))
  267.  
  268. :(o,,(
  269. <*********************>
  270. <* Ask user for help *>
  271. <*********************>
  272. ))
  273. :(mm,response_not_recognized, (
  274.  :(wdial_status,(Waiting for user input))
  275.  :(s, user_data,
  276.    :(wdial_prompt,:(r,input_data)
  277.     (
  278. )                            
  279.  
  280. (Response not recognized!
  281. )                            
  282.   (You
  283. must either:
  284. )                            
  285.   (    
  286.  o Run the
  287. `teach' mode script again
  288. )                            
  289.   (
  290. )                            
  291.   (    
  292.  o Enter a
  293. response to continue connecting.
  294. )                            
  295.   (
  296. )                            
  297.   (Type
  298. 'EXIT' to abort.)
  299.  ))
  300.  :(ttci, :(r, user_data), EXIT,
  301.    ( :(sexit) ),
  302.    ( :(o2, :(r, user_data) :(tca,13)) ))
  303. ))
  304.  
  305. :(mm,hangup,(
  306.  :(ibdf)
  307.  :(wdial_polli,physical,close,2000,,(
  308.   :(o2,+++)
  309.   :(wdial_pause,2000)
  310.   :(o2,ATH0:(tca,13))
  311.   :(wdial_pause,2000)
  312.  ))
  313. ))
  314.  
  315. :(o,,(
  316. <*******************************************************>
  317. <* Exit gracefully, ERROR                              *>
  318. <*******************************************************>
  319. ))
  320. :(mm,sexit,(
  321.  :(wdial_status,(Not connected))
  322.  :(g)
  323. ))
  324.  
  325. :(o,,(
  326. <*******************************************************>
  327. <* Negotiate layers etc.                               *>
  328. <*******************************************************>
  329. ))
  330. :(mm,topacket,(
  331.  <* Change to packet mode *>
  332.  :(wdial_changemode,packet)
  333.  
  334.  :(ei,:(wdial_frametype),SLIP,,(
  335.   <* PPP Mode *>
  336.  
  337.   <* Open LCP Layer *>
  338.   :(wdial_status,(Waiting for Link Control...):(tca,10)
  339.    (Timeout in %d
  340. seconds),:(aq,:(wdial_phone,timeout),1000))
  341.   :(s,stoptime,:(aa,:(xcm),:(wdial_phone,timeout)))
  342.   :(pc, (
  343.    :(did_they_hang_up?)
  344.    :(wdial_polli,lcp,open,1000,(
  345.     :(px)
  346.    ))
  347.    :(agi,:(xcm),:(r,stoptime),(
  348.     :(wdial_changemode,raw)
  349.     :(hangup)
  350.     :(wdial_message,(Link control not
  351. established. Connection Failed!),OK,e)
  352.     :(sexit)
  353.    ))
  354.   ),-1)
  355.  
  356.   <* Open IPCP Layer *>
  357.   :(wdial_status,(Waiting for Network Control...):(tca,10)
  358.    (Timeout in %d
  359. seconds),:(aq,:(wdial_phone,timeout),1000))
  360.   :(s,stoptime,:(aa,:(xcm),:(wdial_phone,timeout)))
  361.   :(pc, (
  362.    :(did_they_hang_up?)
  363.    :(wdial_polli,ipcp,open,1000,(
  364.     :(px)
  365.    ))
  366.    :(agi,:(xcm),:(r,stoptime),(
  367.     :(wdial_changemode,raw)
  368.     :(hangup)
  369.     :(wdial_message,(Network control not
  370. established. Connection Failed!),OK,e)
  371.     :(sexit)
  372.    ))
  373.   ),-1)
  374.  ))
  375.  
  376.  :(wdial_status,(Connected))
  377. ))
  378.  
  379. :(o,,(
  380. <* Return user's password or ask for it *>
  381. ))
  382. :(mm,pword,(
  383.  :(ei,:(wdial_passcode),,(
  384.   :(wdial_passcode,:(wdial_prompt, (Please enter your password:), *))
  385.  ))
  386.  :(wdial_passcode)
  387. ))
  388.  
  389. :(o,,(
  390. <* Return user's userid or ask for it *>
  391. ))
  392. :(mm,uname,(
  393.  :(ei,:(wdial_username),,(
  394.   :(wdial_username,:(wdial_prompt, (Please enter your username:)))
  395.  ))
  396.  :(wdial_username)
  397. ))
  398.  
  399. :(o,,(
  400. <***    END Genlearn Common Macros    ***>
  401. <*----------------------------------------*>
  402. ))
  403.  
  404.  
  405. :(o,,(
  406. <*** BEGIN Learned Script ***>
  407. <*--------------------------*>
  408. ))
  409.  
  410.  
  411. :(o,,(
  412. <****************>
  413. <* Connect/Dial *>
  414. <****************>
  415. ))
  416. :(connect)
  417.  
  418.  
  419.  
  420.  
  421. :(o,,(
  422. <***  END Learned Script  ***>
  423. <*--------------------------*>
  424. ))
  425.  
  426. :(o,,(
  427. <***************************>
  428. <* Change Into Packet Mode *>
  429. <***************************>
  430. ))
  431. :(topacket)
  432.  
  433. :(o,,(
  434. <************************>
  435. <* Terminate The Script *>
  436. <************************>
  437. ))
  438. :(wdial_status,(Connected))
  439. :(g)
  440.