home *** CD-ROM | disk | FTP | other *** search
/ PC Online 1997 November / PCO1197.ISO / FilesBBS / WIN95 / CM95-10.EXE / INTERNET.DLL / TEXT / WILEUDORA < prev    next >
Encoding:
Text File  |  1997-07-24  |  2.7 KB  |  139 lines

  1. AddExtender ("wwwsk32i.dll")
  2. IntControl (35, 500, 0, 0, 0)
  3. bOK = @TRUE
  4. sDial     = "<dialupname>"
  5. nMaxRedial = <numredials>
  6. nRedialDelay = 10
  7. sPgmPath  = "<pgmpath>"
  8. sPgmDir   = "<pgmdir>"
  9. bGetMail   = <getmail>
  10. bSendMail  = <sendmail>
  11. bEmpty     = <empty>
  12. bCompact   = <compact>
  13. sErrDesc  = ""
  14.  
  15.  
  16. ;**********************************************************************
  17. ;Dial our host (unless user is on a direct connect)...
  18. ;**********************************************************************
  19. hConn = 0
  20. nNumRedials = 0
  21. if (sDial <> "")
  22.     :DialIt
  23.     hConn = DUNConnect (sDial)
  24.     nErr = SGetLastErr ()
  25.     sErr = wxGetErrDesc (nErr)
  26.     if (nErr == 633 && WinVersion(@MAJOR)==4 && WinVersion(@MINOR)==0)
  27.         ; Error 633 under NT 4.0 >really< just means we're already connected...
  28.         nErr = @SAlready
  29.         hConn = 0
  30.     else
  31.         if (nErr!=@SAlready && !hConn)
  32.             switch nErr
  33.                 case @SErrBusy
  34.                 case @SErrNoAnswer
  35.                 case 680 ; no dialtone
  36.                     if (nNumRedials <= nMaxRedial)
  37.                         nNumRedials = nNumRedials + 1
  38.                         Delay (nRedialDelay)
  39.                         goto DialIt
  40.                     endif
  41.                     break
  42.     
  43.                 case @SErrNotFound
  44.                 case @SErrVoice
  45.                 case nErr ; <--default
  46.                     sErrDesc = "Couldn't connect to %sDial%: %sErr%"
  47.                     bOK = @FALSE
  48.                     goto LogIt
  49.             endswitch
  50.         else
  51.             if (nErr == @SAlready)
  52.                 ; We're already connected. Don't hang up when this event is thru...
  53.                 hConn = 0 
  54.             endif
  55.         endif
  56.     endif
  57. endif
  58.  
  59.  
  60. ;Activate or Run Eudora...
  61. If WinExist("Eudora")
  62.     WinActivate("Eudora")
  63. else
  64.     DirChange (sPgmDir)
  65.     Run(sPgmPath, "")
  66. endif
  67.  
  68.  
  69. ; Do stuff online...
  70. :GetMail
  71. if bGetMail
  72.     SendKeysTo("Eudora", "!FM")
  73.     while !WinExist("No New Mail") && !WinExist("New Mail!")
  74.         Delay(5)
  75.         MouseMove (100+random(10), 100, "", "")
  76.     endwhile
  77.     Delay(1)
  78.     SendKeysTo("Eudora", "~")
  79. endif
  80.  
  81.  
  82. :SendMail
  83. if bSendMail
  84.     SendKeysTo("Eudora", "!FQ")
  85.     while WinExist("Progress")
  86.         Delay(5)
  87.         MouseMove (100+random(10), 100, "", "")
  88.     endwhile
  89.     Delay(1)
  90. endif
  91.  
  92.  
  93. ; Do stuff offline...
  94. :Compact
  95. if bCompact
  96.     SendKeysTo("Eudora", "!ST")
  97.     while WinExist("Progress")
  98.         Delay(5)
  99.         MouseMove (100+random(10), 100, "", "")
  100.     endwhile
  101.     Delay(1)
  102. endif
  103.  
  104.  
  105. :Empty
  106. if bEmpty
  107.     SendKeysTo("Eudora", "!SE")
  108.     while WinExist("Progress")
  109.         Delay(5)
  110.         MouseMove (100+random(10), 100, "", "")
  111.     endwhile
  112.     Delay(1)
  113. endif
  114.  
  115.  
  116. ; If user hit Ctrl+Break, WIL will bring us here...
  117. :Cancel
  118.  
  119. ; Hang up...
  120. :HangUp
  121. if (hConn)
  122.     nRet = DUNDisconnect (hConn)
  123. endif
  124.  
  125.  
  126. ; Log what we did...
  127. :LogIt
  128. if bOK == @TRUE
  129.     sLog = "Ran Eudora"
  130. else
  131.     sLog = strcat ("Error automating Eudora:", @CRLF, sErrDesc)
  132. endif
  133.  
  134. CMLogMessage (sLog)
  135. Display (8, "ClockMan95", sLog)
  136. exit
  137.  
  138. ~
  139.