home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 2 BBS / 02-BBS.zip / emis14p.zip / zocmt.scr < prev   
Text File  |  1995-01-30  |  3KB  |  141 lines

  1. # ZOC Script für MausTausch
  2. # Setze die Parameter. Das Verzeichnis wird als Parameter übergeben.
  3. seta emisdir "%lastline%"
  4. writeln "%emisdir%"
  5. openfile "%emisdir%\emismt.cfg" "r"
  6. getfile ;# Überspringe die Programm-Id
  7. getfile
  8. seta bbs "%lastline%"
  9. getfile
  10. seta phone "%lastline%"
  11. getfile
  12. seta name "%lastline%"
  13. getfile
  14. seta pass "%lastline%"
  15. closefile
  16.  
  17. #  To test your own script, change the next line to 'debug 1'
  18. debug 0
  19. setn noexit 0
  20.  
  21. #  Set a few values
  22. setn  waittime 30            ;# time between dials
  23. setn  maxtry   20            ;# max number of trys
  24. seta init "" ; # Evtl zusätzlicher Modem-Init-String
  25.  
  26. #INIT-String vorhanden?
  27. compa    "%init%" WITH ""
  28. ifnequ    send "%init%"
  29. ifnequ    wait "OK"
  30. ifequ     send "^M"
  31. delay
  32.  
  33. #   Reset counter, clear screen
  34. setn counter 1
  35. cls
  36.  
  37.  
  38. #   MAIN LOOP
  39. #
  40. :loop0
  41.     #  Dial and see what happens
  42.     #  (if the number contains a ^I (TAB) the following text is used
  43.     #  in the CALLING.LOG instead of logging just the phone number)
  44.     dial "%phone%^I%bbs%"
  45.  
  46.     #  Set timeout to 90sec. and wait for a line of text to come
  47.     timeout 90
  48. :loop1
  49.     waitline
  50.  
  51.     #  if something arrived save incoming line to variable 
  52.     #  (lastline might change duringprocessing)
  53.     ifnbrk seta last "%lastline%"
  54.  
  55.     #  else
  56.     #  if WAITLINE timed out, set our variable to TIMEOUT
  57.     ifbrk  seta last "TIMEOUT"
  58.  
  59.     #  Set text compare to non exact matching (that is CONNECT=CONNECT 1200)
  60.     exact    0
  61.  
  62.     #  compare to for CONNECT or CARRIER and if equal, log in
  63.     compa    "%last%" WITH CONNECT
  64.     ifequ    goto login    
  65.  
  66.     compa    "%last%" WITH CARRIER
  67.     ifequ    goto login    
  68.  
  69.     #  Try again for BUSY, NO CARRIER, NO DIALTONE
  70.     compa    "%last%" WITH BUSY
  71.     ifequ    goto SomeMore    
  72.  
  73.     compa    "%last%" WITH "NO CARRIER"
  74.     ifequ    goto SomeMore    
  75.  
  76.     compa    "%last%" WITH "NO DIALTONE"
  77.     ifequ    goto SomeMore    
  78.  
  79.     #  for TIMEOUT hang up
  80.     compa    "%last%" WITH "NO CARRIER"
  81.     ifequ    hangup
  82.  
  83.  
  84.     #   Ignore anything else (Zyxels say 'RINGING' or V42 say 'PROCOL xxx')
  85.     #  and wait for something we know
  86. goto loop1
  87.  
  88.     #  Increment counter and eventually try again
  89.     #
  90. :SomeMore
  91.     #  ... wait and see if we ...
  92.     delay    %waittime%
  93.  
  94.     #  ... want to try again?
  95.     inc     counter
  96.     compn    %counter% with %maxtry%
  97.     iflow    goto loop0
  98.     ifequ    goto loop0
  99.  
  100. #   No success after %maxtry% tries
  101. goto    fail
  102.  
  103.  
  104.  
  105. ##################
  106. #  LOGIN        #
  107. ##################
  108.  
  109. :login
  110. #  Make a bit noise
  111. beep 1
  112. writeln "^M^J^MConnection established!!"
  113. timeout 30
  114.  
  115. #  MausTausch Schnell-Login
  116. wait  "(J/N)"
  117. send  "MausTausch%name%^m%pass%^mz"
  118.  
  119. # 5 min maximal für das infile
  120. timeout 300
  121. wait "Protokoll startet"
  122. upload z "%emisdir%\infile.zip"
  123.  
  124. # 30 min maximal für das packen des outfiles
  125. timeout 1800
  126. wait "Protokoll startet"
  127. download z "%emisdir%"
  128. timeout 10
  129. wait "NO CARRIER"
  130. compn "%noexit%" with 0
  131. ifequ endzoc
  132. exit
  133. #
  134. #
  135. # FEHLER
  136. :fail
  137. writeln "ERROR"
  138. compn "%noexit%" with 0
  139. ifequ endzoc
  140. exit