home *** CD-ROM | disk | FTP | other *** search
/ .net 1999 December / netCD65.iso / pc / Software / VirtualA / 32bit / vasetup.exe / %MYDIR% / BILLING.EBS < prev    next >
Encoding:
Text File  |  1999-10-06  |  4.8 KB  |  181 lines

  1. 'T:BILLING.EBS for CompuServe
  2. ' VA 4.52 release
  3.  
  4. Global Const IM_DELETE    = 2048
  5.  
  6. Declare Function UniqueFileName$
  7. Declare Function QueueFile(service As String, sfilename As String, queueflags As Long) As Boolean
  8. Declare Sub ReportSuccess(id As String)
  9. Declare Function StartCapture(pseudo As String)
  10. Declare Function NoSpaces(s As String) As String
  11. Declare Function GoForum(ByVal forum As String) As Boolean
  12. Declare Sub ResetForum
  13. Declare Sub TrackFailure(s As String)
  14.  
  15. Public Success As Boolean
  16.  
  17. 'T:AccountBalance (subroutine) (CompuServe)
  18. Sub AccountBalance(id As String)
  19.     Dim filename As String
  20.     Dim t As Tracker, t1 As Tracker, t2 As Tracker
  21.  
  22.     If Not GoForum("cis:bil-649") Then
  23.         LogResult "Unable to collect billing charges; please try again later."
  24.         Exit Sub
  25.     End If
  26.  
  27.     Set t = CreateTracker("PromptEnd", "Last Page !")
  28.  
  29.     Comms.Send "1\r"
  30.     WaitFor "BIL-647"
  31.     WaitFor "\n"
  32.  
  33.     ' Getting Account Balance.
  34.     filename = StartCapture("Charges/Account_Balance CompuServe")
  35.     CaptureText "What you owe"+Basic.Eoln$
  36.     WaitForPrompt "Prompt"
  37.     CaptureRewind 1
  38.     CaptureText Basic.Eoln$+"!end"+Basic.Eoln$
  39.  
  40.     ' Returning to Menu
  41.     Comms.Send "\r"
  42.     WaitForPrompt "Prompt"
  43.  
  44.     ' Requesting Allowances
  45.     Comms.Send "2\r"
  46.     Set t1 = CreateTracker("BillCharges", "CHARGES")
  47.     Set t2 = CreateTracker("BillError", "You do not belong to a pricing plan")
  48.     WaitForPrompt "Bill"
  49.     If PromptMatches("BillCharges") Then
  50.         ' Getting allowances
  51.         CaptureText Basic.Eoln$+"!start Charges/Allowances CompuServe"+Basic.Eoln$
  52.         CaptureText "What you've got left"+Basic.Eoln$
  53.         WaitForPrompt "Prompt"
  54.         CaptureRewind 12
  55.         CaptureText Basic.Eoln$+"!end"+Basic.Eoln$
  56.     End If
  57.     t1.delete
  58.     t2.delete
  59.     t.delete
  60.  
  61.     ' Returning to menu
  62.     Capture CAPTURE_OFF
  63.     Comms.Send "\r"
  64.     WaitForPrompt "Prompt"
  65.  
  66.     ' Add to import queue
  67.     If QueueFile(Session.Service, filename, IM_DELETE) Then
  68.         ReportSuccess id & " : Billing information request "
  69.     End If
  70. End Sub
  71.  
  72. 'T:AccountHistory (subroutine) (CompuServe)
  73. Sub AccountHistory(id As String)
  74.     Dim filename As String
  75.     Dim t As Tracker
  76.  
  77.     If Not GoForum("cis:bil-649") Then
  78.         LogResult "Unable to collect billing charges; please try again later."
  79.         Exit Sub
  80.     End If
  81.  
  82.     TrackFailure "\nAccount History is currently unavailable"
  83.     Set t = CreateTracker("PromptContinue", "\nPress <CR> to Continue !")
  84.  
  85.     Comms.Send "3\r"
  86.     WaitFor "3\r"
  87.     WaitFor "\n"
  88.     filename = StartCapture("Charges/Account_History CompuServe")
  89.     CaptureText "What's it Cost?"+Basic.Eoln$
  90.     WaitForPrompt "Prompt"
  91.     If Success=False Then
  92.         CaptureRewind 24
  93.         CaptureText "Please try again later."+Basic.Eoln$
  94.     Else
  95.         CaptureRewind 12
  96.     End If
  97.     CaptureText Basic.Eoln$+"!end"+Basic.Eoln$
  98.  
  99.     t.delete
  100.     Capture CAPTURE_OFF
  101.     TrackFailure ""
  102.     Comms.Send "\r"
  103.     WaitForPrompt "Prompt"
  104.  
  105.     ' Add to import queue
  106.     If QueueFile(Session.Service, filename, IM_DELETE) Then
  107.         ReportSuccess id & " : Billing information request "
  108.     End If
  109. End Sub
  110.  
  111. Dim mnu As String
  112.  
  113. Sub SetMenuOpt(t As Tracker)
  114.     If mnu="" Then
  115.         mnu = Mid$(t.match, 2, 2)
  116.         If Mid$(mnu, 1, 1)=" " Then mnu = Mid$(mnu, 2, 1)
  117.     End If
  118.     t.reset
  119. End Sub
  120.  
  121. 'T:DetailedActivity (subroutine) (CompuServe)
  122. Sub DetailedActivity(id As String, opt As String)
  123.     Dim filename As String
  124.     Dim t1 As Tracker, t2 As Tracker, t3 As Tracker
  125.  
  126.     If Not GoForum("cis:bil-649") Then
  127.         LogResult "Unable to collect billing charges; please try again later."
  128.         Exit Sub
  129.     End If
  130.  
  131.     mnu = ""
  132.     Set t1 = CreateTracker("PromptEnd", "Last Page !", "", True)
  133.     Set t2 = CreateTracker("PromptChoice", "Enter choice !", "", True)
  134.     Set t3 = CreateTracker("MenuChoice", "\n*"+opt, "SetMenuOpt", True, True)
  135.  
  136.     Comms.Send "4\r"
  137.     WaitFor "4\r"
  138.     WaitFor "\n"
  139.  
  140.     ' Getting detailed activity
  141.     filename = StartCapture("Charges/Detailed_Activity CompuServe")
  142.     WaitForPrompt "Prompt"
  143.     If PromptMatches("PromptChoice") And opt<>"No detail" Then
  144.         CaptureRewind 15
  145.         CaptureText Basic.Eoln$+"!end"+Basic.Eoln$
  146.         If mnu = "" Then
  147.             If InStr(opt, "last week")>0 Then
  148.                 mnu = "2"
  149.             Else
  150.                 mnu = Str$(Val(Mid$(opt, 14))+1)
  151.             End If
  152.         End If
  153.         Comms.Send mnu + "\r"
  154.         WaitFor "CHARGES"
  155.         CaptureText Basic.Eoln$+"!start Charges/Detailed_Activity CompuServe"+Basic.Eoln$
  156.         WaitForPrompt "Prompt"
  157.         CaptureRewind 12
  158.         CaptureText Basic.Eoln$+"!end"+Basic.Eoln$
  159.         Capture CAPTURE_OFF
  160.         Comms.Send "\r"
  161.         WaitForPrompt "Prompt"
  162.     Else
  163.         CaptureRewind 12
  164.         CaptureText Basic.Eoln$+"!end"+Basic.Eoln$
  165.         Capture CAPTURE_OFF
  166.     End If
  167.  
  168.     t1.delete
  169.     t2.delete
  170.     t3.delete
  171.     Comms.Send "\r"
  172.     WaitForPrompt "Prompt"
  173.  
  174.     ' Add to import queue
  175.     If QueueFile(Session.Service, filename, IM_DELETE) Then
  176.         ReportSuccess id & " : Billing information request "
  177.     End If
  178. End Sub
  179.  
  180.  
  181.