home *** CD-ROM | disk | FTP | other *** search
- 'T:BILLING.EBS for CompuServe
- ' VA 4.52 release
-
- Global Const IM_DELETE = 2048
-
- Declare Function UniqueFileName$
- Declare Function QueueFile(service As String, sfilename As String, queueflags As Long) As Boolean
- Declare Sub ReportSuccess(id As String)
- Declare Function StartCapture(pseudo As String)
- Declare Function NoSpaces(s As String) As String
- Declare Function GoForum(ByVal forum As String) As Boolean
- Declare Sub ResetForum
- Declare Sub TrackFailure(s As String)
-
- Public Success As Boolean
-
- 'T:AccountBalance (subroutine) (CompuServe)
- Sub AccountBalance(id As String)
- Dim filename As String
- Dim t As Tracker, t1 As Tracker, t2 As Tracker
-
- If Not GoForum("cis:bil-649") Then
- LogResult "Unable to collect billing charges; please try again later."
- Exit Sub
- End If
-
- Set t = CreateTracker("PromptEnd", "Last Page !")
-
- Comms.Send "1\r"
- WaitFor "BIL-647"
- WaitFor "\n"
-
- ' Getting Account Balance.
- filename = StartCapture("Charges/Account_Balance CompuServe")
- CaptureText "What you owe"+Basic.Eoln$
- WaitForPrompt "Prompt"
- CaptureRewind 1
- CaptureText Basic.Eoln$+"!end"+Basic.Eoln$
-
- ' Returning to Menu
- Comms.Send "\r"
- WaitForPrompt "Prompt"
-
- ' Requesting Allowances
- Comms.Send "2\r"
- Set t1 = CreateTracker("BillCharges", "CHARGES")
- Set t2 = CreateTracker("BillError", "You do not belong to a pricing plan")
- WaitForPrompt "Bill"
- If PromptMatches("BillCharges") Then
- ' Getting allowances
- CaptureText Basic.Eoln$+"!start Charges/Allowances CompuServe"+Basic.Eoln$
- CaptureText "What you've got left"+Basic.Eoln$
- WaitForPrompt "Prompt"
- CaptureRewind 12
- CaptureText Basic.Eoln$+"!end"+Basic.Eoln$
- End If
- t1.delete
- t2.delete
- t.delete
-
- ' Returning to menu
- Capture CAPTURE_OFF
- Comms.Send "\r"
- WaitForPrompt "Prompt"
-
- ' Add to import queue
- If QueueFile(Session.Service, filename, IM_DELETE) Then
- ReportSuccess id & " : Billing information request "
- End If
- End Sub
-
- 'T:AccountHistory (subroutine) (CompuServe)
- Sub AccountHistory(id As String)
- Dim filename As String
- Dim t As Tracker
-
- If Not GoForum("cis:bil-649") Then
- LogResult "Unable to collect billing charges; please try again later."
- Exit Sub
- End If
-
- TrackFailure "\nAccount History is currently unavailable"
- Set t = CreateTracker("PromptContinue", "\nPress <CR> to Continue !")
-
- Comms.Send "3\r"
- WaitFor "3\r"
- WaitFor "\n"
- filename = StartCapture("Charges/Account_History CompuServe")
- CaptureText "What's it Cost?"+Basic.Eoln$
- WaitForPrompt "Prompt"
- If Success=False Then
- CaptureRewind 24
- CaptureText "Please try again later."+Basic.Eoln$
- Else
- CaptureRewind 12
- End If
- CaptureText Basic.Eoln$+"!end"+Basic.Eoln$
-
- t.delete
- Capture CAPTURE_OFF
- TrackFailure ""
- Comms.Send "\r"
- WaitForPrompt "Prompt"
-
- ' Add to import queue
- If QueueFile(Session.Service, filename, IM_DELETE) Then
- ReportSuccess id & " : Billing information request "
- End If
- End Sub
-
- Dim mnu As String
-
- Sub SetMenuOpt(t As Tracker)
- If mnu="" Then
- mnu = Mid$(t.match, 2, 2)
- If Mid$(mnu, 1, 1)=" " Then mnu = Mid$(mnu, 2, 1)
- End If
- t.reset
- End Sub
-
- 'T:DetailedActivity (subroutine) (CompuServe)
- Sub DetailedActivity(id As String, opt As String)
- Dim filename As String
- Dim t1 As Tracker, t2 As Tracker, t3 As Tracker
-
- If Not GoForum("cis:bil-649") Then
- LogResult "Unable to collect billing charges; please try again later."
- Exit Sub
- End If
-
- mnu = ""
- Set t1 = CreateTracker("PromptEnd", "Last Page !", "", True)
- Set t2 = CreateTracker("PromptChoice", "Enter choice !", "", True)
- Set t3 = CreateTracker("MenuChoice", "\n*"+opt, "SetMenuOpt", True, True)
-
- Comms.Send "4\r"
- WaitFor "4\r"
- WaitFor "\n"
-
- ' Getting detailed activity
- filename = StartCapture("Charges/Detailed_Activity CompuServe")
- WaitForPrompt "Prompt"
- If PromptMatches("PromptChoice") And opt<>"No detail" Then
- CaptureRewind 15
- CaptureText Basic.Eoln$+"!end"+Basic.Eoln$
- If mnu = "" Then
- If InStr(opt, "last week")>0 Then
- mnu = "2"
- Else
- mnu = Str$(Val(Mid$(opt, 14))+1)
- End If
- End If
- Comms.Send mnu + "\r"
- WaitFor "CHARGES"
- CaptureText Basic.Eoln$+"!start Charges/Detailed_Activity CompuServe"+Basic.Eoln$
- WaitForPrompt "Prompt"
- CaptureRewind 12
- CaptureText Basic.Eoln$+"!end"+Basic.Eoln$
- Capture CAPTURE_OFF
- Comms.Send "\r"
- WaitForPrompt "Prompt"
- Else
- CaptureRewind 12
- CaptureText Basic.Eoln$+"!end"+Basic.Eoln$
- Capture CAPTURE_OFF
- End If
-
- t1.delete
- t2.delete
- t3.delete
- Comms.Send "\r"
- WaitForPrompt "Prompt"
-
- ' Add to import queue
- If QueueFile(Session.Service, filename, IM_DELETE) Then
- ReportSuccess id & " : Billing information request "
- End If
- End Sub
-
-
-