home *** CD-ROM | disk | FTP | other *** search
- 'T:SYSOP.EBS for CompuServe
- ' VA 4.01 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 GoForum(ByVal forum As String) As Boolean
- Declare Sub ReadNumber(id As String, forum As String, msg As String)
- Declare Function StartCapture(pseudo As String)
- Declare Function SectionNumber(ByVal section As String)
- Declare Function MyDate$
- Declare Sub FetchMessageThread(id As String, forum As String, number As String, thr As Boolean)
- Declare Sub SendCR(t As Tracker)
-
- Dim syslog As String ' Location of SysOp logs
- Dim breakforum As String
-
- Sub StartSysopLog(forum As String, msg As String)
- forum = ParseString(forum, "/")
- If ReadIni$("Main", "Sysop Log file", Session.IniFilename)="YES" Then
- Capture CAPTURE_ON, "sysop.log"
- Else
- syslog = UniqueFilename$()
- Capture CAPTURE_ON, syslog
- CaptureText Basic.Eoln$+"!start "+forum+"/Sysop_Logs CompuServe"+Basic.Eoln$
- End If
- CaptureText msg+Basic.Eoln$
- End Sub
-
- Sub EndSysopLog
- Dim b As Boolean
-
- If ReadIni$("Main", "Sysop Log file", Session.IniFilename)<>"YES" Then
- CaptureText Basic.Eoln$+"!end"+Basic.Eoln$
- Capture CAPTURE_OFF
-
- b = QueueFile(Session.Service, syslog, IM_DELETE)
- End If
- End Sub
-
- 'T:SysopModify (subroutine) (CompuServe)
- Sub SysopModify(id As String, forum As String, num As String, section As String)
- If Not GoForum(forum) Then
- LogResult "Unable to modify section "+forum+" #"+num+" to "+section
- Exit Sub
- End If
-
- StartSysopLog forum, "Modify section: "+forum+" thread #"+num+" to "+section
-
- Comms.Send "mess;mod sec "+num+";y;"+section+"\r"
- WaitForPrompt "Prompt"
- EndSysopLog
-
- If PromptMatches("PromptMessage") Then
- FetchMessageThread "", forum, num, True
- Else
- Comms.Send "mess\r"
- WaitForPrompt "Prompt"
- End If
-
- ReportSuccess id & " : Message #" & num & " moved to " & section & " "
- End Sub
-
- 'T:SysopHold (subroutine) (CompuServe)
- Sub SysopHold(id As String, forum As String, num As String, onoff As String, what As String)
- If Not GoForum(forum) Then
- LogResult "Unable to hold/unhold "+forum+" #"+num+" to "+what+" "+onoff
- Exit Sub
- End If
-
- If what="Message" Then
- what = ""
- End If
- Comms.Send "mess;hold "+what+" "+onoff+" "+num+";y\r"
- WaitFor "y\r"
- StartSysopLog forum, "Hold/unhold: "+forum+" "+what+" #"+num+" to "+onoff
- WaitForPrompt "Prompt"
- CaptureRewind 10
- EndSysopLog
- FetchMessageThread "", forum, num, True
-
- ReportSuccess id & " : Hold/unhold: " & forum & " " & what & " #" & num & " to " & onoff & " "
- End Sub
-
- 'T:SysopFMB (subroutine) (CompuServe)
- Sub SysopFMB(id As String, forum As String, num As String, userid As String, _
- priv As String, asnew As String, subject As String, section As String)
-
- If Not GoForum(forum) Then
- LogResult "Unable to forward message #"+num+" to "+userid
- Exit Sub
- End If
-
- StartSysopLog forum, "Forward message: "+forum+" #"+num+" to "+userid
-
- If priv="" Then priv="n"
- If asnew="" Then asnew="n"
- subject = Mid$(subject, 1, 24)
- If asnew="y" Then
- Comms.Send "mess;for boa new "+num+";y;"+userid+";"+priv+";"+subject+";"+section+";\r"
- Else
- Comms.Send "mess;for boa "+num+";y;"+userid+";"+priv+"\r"
- End If
- WaitForPrompt "Prompt"
- If PromptMatches("PromptMessage") Then
- ReadNumber "", forum, num
- Else
- Comms.Send "mess\r"
- WaitForPrompt "Prompt"
- End If
-
- EndSysopLog
-
- ReportSuccess id & " : Forward message " & forum & " #" & num & " to " & userid & " "
- End Sub
-
- 'T:SysopFMA (subroutine) (CompuServe)
- Sub SysopFMA(id As String, forum As String, num As String, userid As String)
-
- If Not GoForum(forum) Then
- LogResult "Unable to forward message #"+num+" to by mail "+userid
- Exit Sub
- End If
-
- StartSysopLog forum, "Forward by Mail: "+forum+" #"+num+" mail to "+userid
-
- Comms.Send "mess;for mail "+num+";y;"+userid+"\r"
- WaitForPrompt "Prompt"
- If Not PromptMatches("PromptMessage") Then
- Comms.Send "mess\r"
- WaitForPrompt "Prompt"
- End If
-
- EndSysopLog
-
- ReportSuccess id & " : Forward by Mail " & forum & " #" & num & " to " & userid & " "
- End Sub
-
- 'T:SysopDelete (subroutine) (CompuServe)
- Sub SysopDelete(id As String, forum As String, num As String)
- If Not GoForum(forum) Then
- LogResult "Unable to delete message #"+number+" from "+forum
- Exit Sub
- End If
-
- StartSysopLog forum, "Delete Message: "+forum+" #"+num
-
- ' Delete if it's there
- Comms.Send "mess;rem "+num+";y\r"
- WaitForPrompt "Prompt"
- If Not PromptMatches("PromptMessage") Then
- Comms.Send "mess\r"
- WaitForPrompt "Prompt"
- End If
-
- EndSysopLog
-
- ReportSuccess id & " : Message #" & num & " from " & forum & " deleted "
- End Sub
-
- 'T:GoSysOp (subroutine) (CompuServe)
- ' Go to forum sysop area and input password
- Function GoSysOp(ByVal forum As String)
- Dim tPassword As Tracker, password As String, r As Integer
- Begin Dialog SysOpDlg,,168,56,"Sysop Password",,,1
- Text 9,8,108,8,"Please type in your SysOp password",.Text1,,,ebRegular
- TextBox 9,20,99,12,.Password
- CheckBox 9,40,108,8,"Save password for future use",.Save
-
- OKButton 120,8,40,14
- CancelButton 120,24,40,14
- End Dialog
- Dim SysOp As SysOpDlg, SavePassword As Boolean
-
- ' Go to the forum
- forum = ParseString(forum, "/")
- If Not GoForum(forum) Then
- LogResult "Unable to access "+forum
- GoSysOp = FALSE
- Exit Function
- End If
-
- ' Load the Sysop password from the cis\sysop.ini [Passwords] section
- password = ReadIni$("Passwords", forum, Session.ServicePath+"sysop.ini")
-
- ' If password is blank then stick up a dialog and ask them - with
- If password="" Then
- r = Dialog(SysOp,3,10000) ' 10 second wait
- If r=-1 And SysOp.Password <> "" Then
- ' OK
- password = SysOp.Password
- SavePassword = SysOp.Save
- Else
- GoSysOp = FALSE
- Exit Function
- End If
- End If
-
- ' Send the sysop password unless we're already at the SO ! prompt
- If Not PromptMatches("PromptSO") Then
- Set tPassword = CreateTracker("PromptPassword", "\nPassword:")
- Comms.Send "so\r"
- WaitForPrompt "Prompt"
- If PromptMatches("PromptPassword") Then
- tPassword.delete
- If password<>"" Then
- Comms.Send password + "\r"
- End If
- WaitForPrompt "Prompt"
-
- ' a check to allow them to store the password for future use.
- If SavePassword Then
- WriteIni "Passwords", forum, password, Session.ServicePath+"sysop.ini"
- End If
-
- GoSysOp = PromptMatches("PromptSO")
- Exit Function
- End If
- End If
-
- GoSysOp = TRUE
- End Function
-
- 'T:AddMember (subroutine) (CompuServe)
- ' Go to forum sysop area and add member
- Sub AddMember(id As String, forum As String, uid As String, user as String, _
- aux As String, flgs As String, addsct As String, _
- remsct As String, addlib As String, remlib As String, _
- addco As String, remco As String)
- Dim tNotMember As Tracker, tBadId As Tracker, tOkay As Tracker
- Dim tSys1 As Tracker, tSys2 As Tracker, tSys3 As Tracker, tSys4 As Tracker
-
- If Not GoSysOp(forum) Then
- LogResult "Unable to access " + forum + "to add user " + uid + " " + user
- Exit Sub
- End If
-
- ' Send the command
- Comms.Send "so;mai;mem;add\r"
-
- WaitFor "User ID:"
- Set tNotMember = CreateTracker("AddMember", "\n% That User ID is Already a Member")
- Set tBadId = CreateTracker("AddBadId", "\n% Bad User ID Entered")
- Set tOkay = CreateTracker("AddOkay", "Name :")
- Comms.Send uid + "\r"
-
- WaitForPrompt "Add"
- tNotMember.delete
- tBadId.delete
- tOkay.delete
- If PromptMatches("AddMember") Then
- WaitFor "User ID:"
- Comms.Send "\r"
- WaitFor " !"
-
- ' Already a member so just go and edit them instead
- EditMember id, forum, uid, user, aux, flgs, addsct, _
- remsct, addlib, remlib, addco, remco
- Exit Sub
- End If
-
- StartSysopLog forum, "Add Member: "+uid
-
- If PromptMatches("AddBadId") Then
- WaitFor "User ID:"
- Comms.Send "\r"
- WaitFor " !"
-
- LogResult "Bad User ID Entered - " & uid
- Exit Sub
- End If
-
- Set tSys1 = CreateTracker("SysopSect1", "Sysop In Sections:", "SendCR")
- Set tSys2 = CreateTracker("SysopSect2", "Sysop In Libraries:", "SendCR")
- Set tSys3 = CreateTracker("SysopSect3", "Please Enter (Y or N) :", "SendCR")
-
- Comms.Send user +"\r"
- WaitFor "Data:"
- Comms.Send aux + "\r"
- WaitFor "Flags (H for list):"
- Set tSys4 = CreateTracker("SysopSect4", "Flags (H for list):", "SendCR")
- Comms.Send flgs +"\r"
- WaitFor "Add Special Section Access:"
- Comms.Send addsct +"\r"
- WaitFor "Remove Special Section Access:"
- Comms.Send remsct +"\r"
- WaitFor "Add Special Library Access:"
- Comms.Send addlib +"\r"
- WaitFor "Remove Special Library Access:"
- Comms.Send remlib +"\r"
- WaitFor "Add Special Conference Room Access:"
- Comms.Send addco + "\r"
- WaitFor "Remove Special Conference Room Access:"
- Comms.Send remco + "\r"
-
- tSys1.delete
- tSys2.delete
- tSys3.delete
- tSys4.delete
-
- 'The sysop log stuff really only needs what's listed here and not
- ' all the above, but not sure how much rewind we want to do
- ' might fake it and capture it all for the first pass
-
- WaitFor "<A>bort):"
- Comms.Send "y\r"
- WaitFor "User ID:"
- Comms.Send "\r"
- WaitFor " !"
- Comms.Send "mes\r"
- WaitForPrompt "Prompt"
-
- EndSysopLog
-
- ReportSuccess id & " : " & user & " [" & uid & "] added to " & forum & " "
- End Sub
-
- 'T:EditMember (subroutine) (CompuServe)
- ' Go to forum sysop area and edit member
- Sub EditMember(id As String, forum As String, uid As String, user as String, _
- aux As String, flgs As String, addsct As String, _
- remsct As String, addlib As String, remlib As String, _
- addco As String, remco As String)
- Dim tNotMember As Tracker, tBadId As Tracker, tOkay As Tracker
- Dim tSys1 As Tracker, tSys2 As Tracker, tSys3 As Tracker, tSys4 As Tracker
-
- If Not GoSysOp(forum) Then
- LogResult "Unable to access " + forum + "to edit user " + uid + " " + user
- Exit Sub
- End If
-
- ' Send the command
- Comms.Send "so;mai;mem;edi\r"
-
- WaitFor "Edit User ID (or Name):"
- Set tNotMember = CreateTracker("EditNotMember", "\n% That User is Not a Member")
- Set tBadId = CreateTracker("EditBadId", "\n% Bad User ID Entered")
- Set tOkay = CreateTracker("EditOkay", "Okay? (<Y>es, <N>o, <A>bort):")
- Comms.Send uid + "\r"
-
- WaitForPrompt "Edit"
- tNotMember.delete
- tBadId.delete
- tOkay.delete
- If PromptMatches("EditNotMember") Then
- LogResult "User "+uid+" is not a member of "+forum+" - cannot edit member."
- Comms.Send "\r"
- WaitFor " !"
- Comms.Send "mes\r"
- WaitForPrompt "Prompt"
-
- ' Not a member so just go and add them instead
- AddMember id, forum, uid, user, aux, flgs, addsct, _
- remsct, addlib, remlib, addco, remco
- Exit Sub
- End If
-
- StartSysopLog forum, "Edit Member: "+uid
-
- If PromptMatches("EditBadId") Then
- WaitFor "User ID:"
- Comms.Send "\r"
- WaitFor " !"
-
- LogResult "Bad User ID Entered - " & uid
- Exit Sub
- End If
- Comms.Send "n\r"
-
- Set tSys1 = CreateTracker("SysopSect1", "Sysop In Sections:", "SendCR")
- Set tSys2 = CreateTracker("SysopSect2", "Sysop In Libraries:", "SendCR")
- Set tSys3 = CreateTracker("SysopSect3", "Please Enter (Y or N) :", "SendCR")
-
- WaitFor "Name :"
- Comms.Send user +"\r"
- WaitFor "Data:"
- Comms.Send aux + "\r"
- WaitFor "Flags (H for list):"
- Set tSys4 = CreateTracker("SysopSect4", "Flags (H for list):", "SendCR")
- Comms.Send flgs +"\r"
- WaitFor "Add Special Section Access:"
- Comms.Send addsct +"\r"
- WaitFor "Remove Special Section Access:"
- Comms.Send remsct +"\r"
- WaitFor "Add Special Library Access:"
- Comms.Send addlib +"\r"
- WaitFor "Remove Special Library Access:"
- Comms.Send remlib +"\r"
- WaitFor "Add Special Conference Room Access:"
- Comms.Send addco + "\r"
- WaitFor "Remove Special Conference Room Access:"
- Comms.Send remco + "\r"
-
- tSys1.delete
- tSys2.delete
- tSys3.delete
- tSys4.delete
-
- 'The sysop log stuff really only needs what's listed here and not
- ' all the above, but not sure how much rewind we want to do
- ' might fake it and capture it all for the first pass
-
- WaitFor "<A>bort):"
- Comms.Send "y\r"
- WaitFor "Name):"
- Comms.Send "\r"
- WaitFor " !"
- Comms.Send "mes\r"
- WaitForPrompt "Prompt"
-
- EndSysopLog
-
- ReportSuccess id & " : Member privileges for " & user & " [" & uid & "] on " & forum & " changed"
- End Sub
-
- 'T:MailMerge (function) (CompuServe)
- 'Takes input from one file and substitutes %DATE% for the current date
- Function MailMerge(filename As String) As String
- Dim MsgFileNum%
- Dim SourceFileNum%
- Dim ALine$, buf$
-
- On Error Goto MailMerge_error
-
- MsgFileName$ = UniqueFileName$()
- MsgFileNum% = FreeFile()
- Open MsgFileName$ For Append Access Read Write Shared As #MsgFileNum%
- SourceFileNum% = FreeFile()
- Open filename for Input Access Read Shared as #SourceFileNum%
-
- 'Spool text from Source to Msg
- While Not Eof(SourceFileNum%)
- Line Input #SourceFileNum%, ALine$
- If InStr(ALine$, "%DATE%") Then
- buf$ = ALine$
- ALine$ = Left$(buf$, InStr(buf$, "%DATE%")-1)
- ALine$ = ALine$ + MyDate$
- ALine$ = ALine$ + Right$(buf$, Len(buf$)-InStr(buf$, "%DATE%")-5)
- End If
- Print #MsgFileNum%, ALine$
- Wend
-
- Close #SourceFileNum%
- Close #MsgFileNum%
- MailMerge = MsgFileName$
- Exit Function
-
- MailMerge_error:
- LogResult "Error:" + Str$(Err) + " in line " + Str$(Erl) + ":" + Error$
- On Error resume next
- Close #SourceFileNum%
- Close #MsgFileNum%
- MailMerge = ""
- Exit Function
- End Function
-
- 'T:UploadAnnouncements (subroutine) (CompuServe)
- ' Go to forum sysop area and upload annoucements
- Sub UploadAnnouncements(id As String, forum As String, ann As String, _
- filename as String, resetfl As String)
- Dim tmpfile As String, t As Tracker
-
- If Not GoSysOp(forum) Then
- LogResult "Unable to access " + forum + " to upload announcements."
- Exit Sub
- End If
-
- ' NOTE: When you are uploading a COnference announcement you will
- ' receive any chat from the rooms. This can break things!
-
- ' Send the command
- Comms.Send "so;mai;ann;upl;"+Trim(Left(ann,2))+";2\r"
- WaitFor "(Y or N)?"
- Comms.Send "y\r"
- WaitFor "puter:"
-
- ' %DATE% -> today's date
- tmpfile = MailMerge(filename)
-
- ' Send filename
- Comms.SendLiteral tmpfile
- Comms.Send "\r"
-
- ' Reset announcement flags
- Set t = CreateTracker("PromptYN", "(Y or N)?")
- WaitForPrompt "Prompt"
- If PromptMatches("PromptYN") Then
- Comms.Send resetfl+"\r"
- WaitForPrompt "Prompt"
- End If
-
- Comms.Send "mes\r"
- WaitForPrompt "Prompt"
-
- DeleteFile tmpfile
-
- ReportSuccess id & " : Announcement " & ann & " for forum " & forum & " uploaded "
- End Sub
-
- 'T:SysopModSecSub (subroutine) (CompuServe)
- 'Changes subject and section of a message all in one go
- Sub SysopModSecSub(id As String, forum As String, num As String, section As String, subject As String)
-
- If Not GoForum(forum) Then
- LogResult "Unable to modify section "+forum+" #"+num+" to "+section
- Exit Sub
- End If
-
- StartSysopLog forum, "Modify section: "+forum+" thread #"+num+" to section "+section +"new subject: "+subject
-
- Comms.Send "mess;mod sec sub " +num+ ";y;" + section + ";" + subject +"\r"
- WaitForPrompt "Prompt"
- EndSysopLog
-
- If PromptMatches("PromptMessage") Then
- FetchMessageThread "", forum, num, True
- Else
- Comms.Send "mess\r"
- WaitForPrompt "Prompt"
- End If
-
- ReportSuccess id & " : Message #" & num & " New Section #" & section & " New subject " & subject
- End Sub
-
- 'T:GetUsers (subroutine) (CompuServe)
- ' Get list of who's online
- Sub GetUsers(id As String, forum As String)
- Dim filename As String
-
- If Not GoForum(forum) Then
- LogResult "Unable to access " + forum + " to get user list"
- Exit Sub
- End If
-
- filename = StartCapture(forum + "/Sysop_Logs User_Log")
- CaptureText "Who was Online"+Basic.Eoln$
- Terminal.Status "Collecting User List ... Please Wait"
- Comms.Send "users\r"
- WaitForPrompt "Prompt"
- CaptureRewind 7
- CaptureText Basic.Eoln$+"!end"+Basic.Eoln$
- Capture CAPTURE_OFF
-
- ' Add to import queue
- If QueueFile(Session.Service, filename, IM_DELETE) Then
- ReportSuccess id & " : Users online for forum " & forum & " collected"
- Else
- ReportSuccess id & " : Users online for forum " & forum & " failed"
- End If
- End Sub
-
- 'T:AsciiListMembers (subroutine) (CompuServe)
- ' Get membership list
- Sub AsciiListMembers(id As String, forum As String, list As String, info As String)
- Dim filename As String
-
- menuitem = ParseString(list, " ")
- If Not GoSysOp(forum) Then
- LogResult "Unable to access " + forum + " to get member list"
- Exit Sub
- End If
-
- filename = StartCapture(forum + "/Membership Member_List")
- CaptureText list + " " + info + Basic.Eoln$
- Terminal.Status "Collecting Member List ... Please Wait"
- Terminal.Enabled = False
- If StrComp(list, "ALL", 1)=0 Then
- Comms.Send "mai;mem;lis;uid;all\r"
- ElseIf info="" Then
- Comms.Send "mai;mem;lis;" + menuitem + "\r"
- Else
- Comms.Send "mai;mem;lis;" + menuitem + ";" + info + "\r"
- End If
-
- WaitFor "Membership !"
- CaptureRewind 12
- CaptureText Basic.Eoln$+"!end"+Basic.Eoln$
- Terminal.Enabled = True
-
- Capture CAPTURE_OFF
-
- ' back to so area for other scripts to work
- Comms.Send "so\r"
-
- ' Add to import queue
- If QueueFile(Session.Service, filename, IM_DELETE) Then
- ReportSuccess id & " : Membership info for forum " & forum & " collected"
- Else
- ReportSuccess id & " : Membership info for forum " & forum & " failed"
- End If
- End Sub
-
- 'T:AsciiGetMemberCount (subroutine) (CompuServe)
- ' Get Membership Count
- Sub AsciiGetMemberCount(id As String, forum As String)
- Dim filename As String
-
- If Not GoSysop(forum) Then
- LogResult "Unable to access " + forum + " to get member count"
- Exit Sub
- End If
-
- Terminal.Status "Getting Member Count ... Please Wait"
-
- Comms.Send "mai;mem;cnt\r"
- WaitFor "\n"
- filename = StartCapture(forum + "/Membership Member_Count")
- WaitFor "Maintenance"
- CaptureRewind 22
- CaptureText Basic.Eoln$+"!end"+Basic.Eoln$
- Capture CAPTURE_OFF
-
- ' back to so area for other scripts to work
- Comms.Send "so\r"
-
- ' Add to import queue
- If QueueFile(Session.Service, filename, IM_DELETE) Then
- ReportSuccess id & " : Member count for forum " & forum & " collected"
- Else
- ReportSuccess id & " : Member count for forum " & forum & " failed"
- End If
- End Sub
-
- 'T:AsciiWhoIs (subroutine) (CompuServe)
- Sub AsciiWhoIs(id As String, forum As String, uid As String)
- Dim filename As String
-
- If Not GoForum(forum) Then
- LogResult "Unable to access " + forum + " to get who is"
- Exit Sub
- End If
-
- filename = StartCapture(forum + "/Sysop_Logs Who_Is")
- CaptureText "Who is UID "+ uid +Basic.Eoln$
- Terminal.Status "Getting member records ... Please Wait"
- Comms.Send "who " + uid + "\r"
- WaitForPrompt "Prompt"
- CaptureRewind 7
- CaptureText Basic.Eoln$+"!end"+Basic.Eoln$
- Capture CAPTURE_OFF
-
- ' Add to import queue
- If QueueFile(Session.Service, filename, IM_DELETE) Then
- ReportSuccess id & " : Who is for " & uid & " collected"
- Else
- ReportSuccess id & " : Who is for " & uid & " failed"
- End If
- End Sub
-
- 'T:InfoPageBreak (subroutine) (CompuServe)
- Sub InfoPageBreak(t As Tracker)
- CaptureRewind Len(t.match)
- CaptureText Basic.Eoln$+"!end"+Basic.Eoln$
- CaptureText "!start "+breakforum+"/Statistics CompuServe"+Basic.Eoln$
-
- If t.match=Chr$(10)+"Generating library statistics...please wait" Then
- CaptureText Chr$(10)+"Library statistics"
- Else
- CaptureText t.match
- End If
- t.reset
- End Sub
-
- 'T:AdvancedForumStats (subroutine) (CompuServe)
- Sub AdvancedForumStats(id As String, forum As String)
- Dim filename As String
- Dim tMore As Tracker, tEnter As Tracker, tBreak1 As Tracker
- Dim tBreak2 As Tracker, tBreak3 As Tracker, tBreak4 As Tracker
- Dim tBreak5 As Tracker, tBreak6 As Tracker, tError As Tracker
-
- If Not GoSysop(forum) Then
- LogResult "Unable to access " + forum + " to get advanced forum statistics"
- Exit Sub
- End If
-
- breakforum = forum
- Terminal.Status "Getting Advanced Forum Statistics ... Please Wait"
- Set tMore = CreateTracker("PromptHideMore", "\nPress <CR> for more :", "SendCR")
- Set tEnter = CreateTracker("PromptEnter2", "\nPress <CR> :")
- Set tError = CreateTracker("PromptEnter3", "\n% Ambiguous command")
- Set tBreak1 = CreateTracker("PageBreak1", "\nMESSAGE STATISTICS", "InfoPageBreak")
- Set tBreak2 = CreateTracker("PageBreak2", "\nMessage Size Statistics:", "InfoPageBreak")
- Set tBreak3 = CreateTracker("PageBreak3", "\nSlot Statistics", "InfoPageBreak")
- Set tBreak4 = CreateTracker("PageBreak4", "\nGenerating library statistics...please wait", "InfoPageBreak")
- Set tBreak5 = CreateTracker("PageBreak5", "Library Download History", "InfoPageBreak")
- Set tBreak6 = CreateTracker("PageBreak6", "\nMEMBERSHIP STATISTICS", "InfoPageBreak")
-
- ' Message statistics
- Comms.Send "sta;mes;1;2;3\r"
- WaitFor "\n"
- filename = UniqueFilename$()
- Capture CAPTURE_ON, filename
- WaitForPrompt "PromptEnter"
- If PromptMatches("PromptEnter3") Then
- Capture CAPTURE_OFF
- LogResult "Unable to get advanced forum statistics from "+forum
- Else
- CaptureRewind 12
- CaptureText Basic.Eoln$+"!end"+Basic.Eoln$
- Capture CAPTURE_OFF
- Comms.Send "\r"
- WaitFor "!"
- Comms.Send "\r"
- WaitFor "!"
-
- ' Library statistics
- Comms.Send "lib\r"
- WaitFor "\n"
- Capture CAPTURE_ON, filename
- CaptureText "!start "+forum+"/Statistics CompuServe"+Basic.Eoln$
- WaitForPrompt "PromptEnter"
- CaptureRewind 12
- CaptureText Basic.Eoln$+"!end"+Basic.Eoln$
- Capture CAPTURE_OFF
- Comms.Send "\r"
- WaitFor "!"
-
- ' Member statistics
- Comms.Send "mem\r"
- WaitFor "or N)\?"
- Comms.Send "y\r"
- WaitFor "please wait"
- Capture CAPTURE_ON, filename
- CaptureText "!start "+forum+"/Statistics CompuServe"+Basic.Eoln$
- WaitForPrompt "PromptEnter"
- CaptureRewind 12
- CaptureText Basic.Eoln$+"!end"+Basic.Eoln$
- Capture CAPTURE_OFF
- Comms.Send "\r"
- WaitFor "!"
- Comms.Send "so\r"
- WaitForPrompt "Prompt"
-
- ' Get more library stats
- Comms.Send "mai;lib;all\r"
- WaitFor "\n"
- Capture CAPTURE_ON, filename
- CaptureText Basic.Eoln$+"!start "+forum+"/Statistics CompuServe"+Basic.Eoln$
- WaitFor "\nEnter Library number to change (CR when done):"
- CaptureRewind 46
- CaptureText Basic.Eoln$+"!end"+Basic.Eoln$
- Capture CAPTURE_OFF
- Comms.Send "\r"
-
- ' Add to import queue
- If QueueFile(Session.Service, filename, IM_DELETE) Then
- ReportSuccess id & " : Advanced Forum Statistics for forum " & forum & " collected"
- Else
- ReportSuccess id & " : Advanced Forum Statistics for forum " & forum & " failed"
- End If
- End If
- WaitFor "!"
- Comms.Send "so\r"
- WaitForPrompt "Prompt"
-
- ' Cleanup
- tEnter.delete
- tError.delete
- tMore.delete
- tBreak1.delete
- tBreak2.delete
- tBreak3.delete
- tBreak4.delete
- tBreak5.delete
- tBreak6.delete
- End Sub
-
-
-