home *** CD-ROM | disk | FTP | other *** search
/ .net 1999 December / netCD65.iso / pc / Software / VirtualA / 16bit / vaper16.exe / %MYDIR% / SYSOP.EBS < prev    next >
Encoding:
Text File  |  1999-10-06  |  23.5 KB  |  771 lines

  1. 'T:SYSOP.EBS for CompuServe
  2. ' VA 4.01 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 GoForum(ByVal forum As String) As Boolean
  10. Declare Sub ReadNumber(id As String, forum As String, msg As String)
  11. Declare Function StartCapture(pseudo As String)
  12. Declare Function SectionNumber(ByVal section As String)
  13. Declare Function MyDate$
  14. Declare Sub FetchMessageThread(id As String, forum As String, number As String, thr As Boolean)
  15. Declare Sub SendCR(t As Tracker)
  16.  
  17. Dim syslog As String            ' Location of SysOp logs
  18. Dim breakforum As String
  19.  
  20. Sub StartSysopLog(forum As String, msg As String)
  21.     forum = ParseString(forum, "/")
  22.     If ReadIni$("Main", "Sysop Log file", Session.IniFilename)="YES" Then
  23.         Capture CAPTURE_ON, "sysop.log"
  24.     Else
  25.         syslog = UniqueFilename$()
  26.         Capture CAPTURE_ON, syslog
  27.         CaptureText Basic.Eoln$+"!start "+forum+"/Sysop_Logs CompuServe"+Basic.Eoln$
  28.     End If
  29.     CaptureText msg+Basic.Eoln$
  30. End Sub
  31.  
  32. Sub EndSysopLog
  33.     Dim b As Boolean
  34.  
  35.     If ReadIni$("Main", "Sysop Log file", Session.IniFilename)<>"YES" Then
  36.         CaptureText Basic.Eoln$+"!end"+Basic.Eoln$
  37.         Capture CAPTURE_OFF
  38.  
  39.         b = QueueFile(Session.Service, syslog, IM_DELETE)
  40.     End If
  41. End Sub
  42.  
  43. 'T:SysopModify (subroutine) (CompuServe)
  44. Sub SysopModify(id As String, forum As String, num As String, section As String)
  45.     If Not GoForum(forum) Then
  46.         LogResult "Unable to modify section "+forum+" #"+num+" to "+section
  47.         Exit Sub
  48.     End If
  49.  
  50.     StartSysopLog forum, "Modify section: "+forum+" thread #"+num+" to "+section
  51.  
  52.     Comms.Send "mess;mod sec "+num+";y;"+section+"\r"
  53.     WaitForPrompt "Prompt"
  54.     EndSysopLog
  55.  
  56.     If PromptMatches("PromptMessage") Then
  57.         FetchMessageThread "", forum, num, True
  58.     Else
  59.         Comms.Send "mess\r"
  60.         WaitForPrompt "Prompt"
  61.     End If
  62.  
  63.     ReportSuccess id & " : Message #" & num & " moved to " & section & " "
  64. End Sub
  65.  
  66. 'T:SysopHold (subroutine) (CompuServe)
  67. Sub SysopHold(id As String, forum As String, num As String, onoff As String, what As String)
  68.     If Not GoForum(forum) Then
  69.         LogResult "Unable to hold/unhold "+forum+" #"+num+" to "+what+" "+onoff
  70.         Exit Sub
  71.     End If
  72.  
  73.     If what="Message" Then
  74.         what = ""
  75.     End If
  76.     Comms.Send "mess;hold "+what+" "+onoff+" "+num+";y\r"
  77.     WaitFor "y\r"
  78.     StartSysopLog forum, "Hold/unhold: "+forum+" "+what+" #"+num+" to "+onoff
  79.     WaitForPrompt "Prompt"
  80.     CaptureRewind 10
  81.     EndSysopLog
  82.     FetchMessageThread "", forum, num, True
  83.  
  84.     ReportSuccess id & " : Hold/unhold: " & forum & " " & what & " #" & num & " to " & onoff & " "
  85. End Sub
  86.  
  87. 'T:SysopFMB (subroutine) (CompuServe)
  88. Sub SysopFMB(id As String, forum As String, num As String, userid As String, _
  89.     priv As String, asnew As String, subject As String, section As String)
  90.  
  91.     If Not GoForum(forum) Then
  92.         LogResult "Unable to forward message #"+num+" to "+userid
  93.         Exit Sub
  94.     End If
  95.  
  96.     StartSysopLog forum, "Forward message: "+forum+" #"+num+" to "+userid
  97.  
  98.     If priv="" Then priv="n"
  99.     If asnew="" Then asnew="n"
  100.     subject = Mid$(subject, 1, 24)
  101.     If asnew="y" Then
  102.         Comms.Send "mess;for boa new "+num+";y;"+userid+";"+priv+";"+subject+";"+section+";\r"
  103.     Else
  104.         Comms.Send "mess;for boa "+num+";y;"+userid+";"+priv+"\r"
  105.     End If
  106.     WaitForPrompt "Prompt"
  107.     If PromptMatches("PromptMessage") Then
  108.         ReadNumber "", forum, num
  109.     Else
  110.         Comms.Send "mess\r"
  111.         WaitForPrompt "Prompt"
  112.     End If
  113.  
  114.     EndSysopLog
  115.  
  116.     ReportSuccess id & " : Forward message " & forum & " #" & num & " to " & userid & " "
  117. End Sub
  118.  
  119. 'T:SysopFMA (subroutine) (CompuServe)
  120. Sub SysopFMA(id As String, forum As String, num As String, userid As String)
  121.  
  122.     If Not GoForum(forum) Then
  123.         LogResult "Unable to forward message #"+num+" to by mail "+userid
  124.         Exit Sub
  125.     End If
  126.  
  127.     StartSysopLog forum, "Forward by Mail: "+forum+" #"+num+" mail to "+userid
  128.  
  129.     Comms.Send "mess;for mail "+num+";y;"+userid+"\r"
  130.     WaitForPrompt "Prompt"
  131.     If Not PromptMatches("PromptMessage") Then
  132.         Comms.Send "mess\r"
  133.         WaitForPrompt "Prompt"
  134.     End If
  135.  
  136.     EndSysopLog
  137.  
  138.     ReportSuccess id & " : Forward by Mail " & forum & " #" & num & " to " & userid & " "
  139. End Sub
  140.  
  141. 'T:SysopDelete (subroutine) (CompuServe)
  142. Sub SysopDelete(id As String, forum As String, num As String)
  143.     If Not GoForum(forum) Then
  144.         LogResult "Unable to delete message #"+number+" from "+forum
  145.         Exit Sub
  146.     End If
  147.  
  148.     StartSysopLog forum, "Delete Message: "+forum+" #"+num
  149.  
  150.     ' Delete if it's there
  151.     Comms.Send "mess;rem "+num+";y\r"
  152.     WaitForPrompt "Prompt"
  153.     If Not PromptMatches("PromptMessage") Then
  154.         Comms.Send "mess\r"
  155.         WaitForPrompt "Prompt"
  156.     End If
  157.  
  158.     EndSysopLog
  159.  
  160.     ReportSuccess id & " : Message #" & num & " from " & forum & " deleted "
  161. End Sub
  162.  
  163. 'T:GoSysOp (subroutine) (CompuServe)
  164. ' Go to forum sysop area and input password
  165. Function GoSysOp(ByVal forum As String)
  166.     Dim tPassword As Tracker, password As String, r As Integer
  167.     Begin Dialog SysOpDlg,,168,56,"Sysop Password",,,1
  168.         Text 9,8,108,8,"Please type in your SysOp password",.Text1,,,ebRegular
  169.         TextBox 9,20,99,12,.Password
  170.         CheckBox 9,40,108,8,"Save password for future use",.Save
  171.  
  172.         OKButton 120,8,40,14
  173.         CancelButton 120,24,40,14
  174.     End Dialog
  175.     Dim SysOp As SysOpDlg, SavePassword As Boolean
  176.  
  177.     ' Go to the forum
  178.     forum = ParseString(forum, "/")
  179.     If Not GoForum(forum) Then
  180.         LogResult "Unable to access "+forum
  181.         GoSysOp = FALSE
  182.         Exit Function
  183.     End If
  184.  
  185.     ' Load the Sysop password from the cis\sysop.ini [Passwords] section
  186.     password = ReadIni$("Passwords", forum, Session.ServicePath+"sysop.ini")
  187.  
  188.     ' If password is blank then stick up a dialog and ask them - with
  189.     If password="" Then
  190.         r = Dialog(SysOp,3,10000)    ' 10 second wait
  191.         If r=-1 And SysOp.Password <> "" Then
  192.             ' OK
  193.             password = SysOp.Password
  194.             SavePassword = SysOp.Save
  195.         Else
  196.             GoSysOp = FALSE
  197.             Exit Function
  198.         End If
  199.     End If
  200.  
  201.     ' Send the sysop password unless we're already at the SO ! prompt
  202.     If Not PromptMatches("PromptSO") Then
  203.         Set tPassword = CreateTracker("PromptPassword", "\nPassword:")
  204.         Comms.Send "so\r"
  205.         WaitForPrompt "Prompt"
  206.         If PromptMatches("PromptPassword") Then
  207.             tPassword.delete
  208.             If password<>"" Then
  209.                 Comms.Send password + "\r"
  210.             End If
  211.             WaitForPrompt "Prompt"
  212.  
  213.             ' a check to allow them to store the password for future use.
  214.             If SavePassword Then
  215.                 WriteIni "Passwords", forum, password, Session.ServicePath+"sysop.ini"
  216.             End If
  217.  
  218.             GoSysOp = PromptMatches("PromptSO")
  219.             Exit Function
  220.         End If
  221.     End If
  222.  
  223.     GoSysOp = TRUE
  224. End Function
  225.  
  226. 'T:AddMember (subroutine) (CompuServe)
  227. ' Go to forum sysop area and add member
  228. Sub AddMember(id As String, forum As String, uid As String, user as String, _
  229.               aux As String, flgs As String, addsct As String, _
  230.               remsct As String, addlib As String, remlib As String, _
  231.               addco As String, remco As String)
  232.     Dim tNotMember As Tracker, tBadId As Tracker, tOkay As Tracker
  233.     Dim tSys1 As Tracker, tSys2 As Tracker, tSys3 As Tracker, tSys4 As Tracker
  234.  
  235.     If Not GoSysOp(forum) Then
  236.         LogResult "Unable to access " + forum + "to add user " + uid + " " + user
  237.         Exit Sub
  238.     End If
  239.  
  240.     ' Send the command
  241.     Comms.Send "so;mai;mem;add\r"
  242.  
  243.     WaitFor "User ID:"
  244.     Set tNotMember = CreateTracker("AddMember", "\n% That User ID is Already a Member")
  245.     Set tBadId = CreateTracker("AddBadId", "\n% Bad User ID Entered")
  246.     Set tOkay = CreateTracker("AddOkay", "Name :")
  247.     Comms.Send uid + "\r"
  248.  
  249.     WaitForPrompt "Add"
  250.     tNotMember.delete
  251.     tBadId.delete
  252.     tOkay.delete
  253.     If PromptMatches("AddMember") Then
  254.         WaitFor "User ID:"
  255.         Comms.Send "\r"
  256.         WaitFor " !"
  257.  
  258.         ' Already a member so just go and edit them instead
  259.         EditMember id, forum, uid, user, aux, flgs, addsct, _
  260.                    remsct, addlib, remlib, addco, remco
  261.         Exit Sub
  262.     End If
  263.  
  264.     StartSysopLog forum, "Add Member: "+uid
  265.  
  266.     If PromptMatches("AddBadId") Then
  267.         WaitFor "User ID:"
  268.         Comms.Send "\r"
  269.         WaitFor " !"
  270.  
  271.         LogResult "Bad User ID Entered - " & uid
  272.         Exit Sub
  273.     End If
  274.  
  275.     Set tSys1 = CreateTracker("SysopSect1", "Sysop In Sections:", "SendCR")
  276.     Set tSys2 = CreateTracker("SysopSect2", "Sysop In Libraries:", "SendCR")
  277.     Set tSys3 = CreateTracker("SysopSect3", "Please Enter (Y or N) :", "SendCR")
  278.  
  279.     Comms.Send user +"\r"
  280.     WaitFor "Data:"
  281.     Comms.Send aux + "\r"
  282.     WaitFor "Flags (H for list):"
  283.     Set tSys4 = CreateTracker("SysopSect4", "Flags (H for list):", "SendCR")
  284.     Comms.Send flgs +"\r"
  285.     WaitFor "Add Special Section Access:"
  286.     Comms.Send addsct +"\r"
  287.     WaitFor "Remove Special Section Access:"
  288.     Comms.Send remsct +"\r"
  289.     WaitFor "Add Special Library Access:"
  290.     Comms.Send addlib +"\r"
  291.     WaitFor "Remove Special Library Access:"
  292.     Comms.Send remlib +"\r"
  293.     WaitFor "Add Special Conference Room Access:"
  294.     Comms.Send addco + "\r"
  295.     WaitFor "Remove Special Conference Room Access:"
  296.     Comms.Send remco + "\r"
  297.  
  298.     tSys1.delete
  299.     tSys2.delete
  300.     tSys3.delete
  301.     tSys4.delete
  302.  
  303.     'The sysop log stuff really only needs what's listed here and not
  304.     ' all the above, but not sure how much rewind we want to do
  305.     ' might fake it and capture it all for the first pass
  306.  
  307.     WaitFor "<A>bort):"
  308.     Comms.Send "y\r"
  309.     WaitFor "User ID:"
  310.     Comms.Send "\r"
  311.     WaitFor " !"
  312.     Comms.Send "mes\r"
  313.     WaitForPrompt "Prompt"
  314.  
  315.     EndSysopLog
  316.  
  317.     ReportSuccess id & " : " & user & " [" & uid & "] added to " & forum & " "
  318. End Sub
  319.  
  320. 'T:EditMember (subroutine) (CompuServe)
  321. ' Go to forum sysop area and edit member
  322. Sub EditMember(id As String, forum As String, uid As String, user as String, _
  323.                aux As String, flgs As String, addsct As String, _
  324.                remsct As String, addlib As String, remlib As String, _
  325.                addco As String, remco As String)
  326.     Dim tNotMember As Tracker, tBadId As Tracker, tOkay As Tracker
  327.     Dim tSys1 As Tracker, tSys2 As Tracker, tSys3 As Tracker, tSys4 As Tracker
  328.  
  329.     If Not GoSysOp(forum) Then
  330.         LogResult "Unable to access " + forum + "to edit user " + uid + " " + user
  331.         Exit Sub
  332.     End If
  333.  
  334.     ' Send the command
  335.     Comms.Send "so;mai;mem;edi\r"
  336.  
  337.     WaitFor "Edit User ID (or Name):"
  338.     Set tNotMember = CreateTracker("EditNotMember", "\n% That User is Not a Member")
  339.     Set tBadId = CreateTracker("EditBadId", "\n% Bad User ID Entered")
  340.     Set tOkay = CreateTracker("EditOkay", "Okay? (<Y>es, <N>o, <A>bort):")
  341.     Comms.Send uid + "\r"
  342.  
  343.     WaitForPrompt "Edit"
  344.     tNotMember.delete
  345.     tBadId.delete
  346.     tOkay.delete
  347.     If PromptMatches("EditNotMember") Then
  348.         LogResult "User "+uid+" is not a member of "+forum+" - cannot edit member."
  349.         Comms.Send "\r"
  350.         WaitFor " !"
  351.         Comms.Send "mes\r"
  352.         WaitForPrompt "Prompt"
  353.  
  354.         ' Not a member so just go and add them instead
  355.         AddMember id, forum, uid, user, aux, flgs, addsct, _
  356.                   remsct, addlib, remlib, addco, remco
  357.         Exit Sub
  358.     End If
  359.  
  360.     StartSysopLog forum, "Edit Member: "+uid
  361.  
  362.     If PromptMatches("EditBadId") Then
  363.         WaitFor "User ID:"
  364.         Comms.Send "\r"
  365.         WaitFor " !"
  366.  
  367.         LogResult "Bad User ID Entered - " & uid
  368.         Exit Sub
  369.     End If
  370.     Comms.Send "n\r"
  371.  
  372.     Set tSys1 = CreateTracker("SysopSect1", "Sysop In Sections:", "SendCR")
  373.     Set tSys2 = CreateTracker("SysopSect2", "Sysop In Libraries:", "SendCR")
  374.     Set tSys3 = CreateTracker("SysopSect3", "Please Enter (Y or N) :", "SendCR")
  375.  
  376.     WaitFor "Name :"
  377.     Comms.Send user +"\r"
  378.     WaitFor "Data:"
  379.     Comms.Send aux + "\r"
  380.     WaitFor "Flags (H for list):"
  381.     Set tSys4 = CreateTracker("SysopSect4", "Flags (H for list):", "SendCR")
  382.     Comms.Send flgs +"\r"
  383.     WaitFor "Add Special Section Access:"
  384.     Comms.Send addsct +"\r"
  385.     WaitFor "Remove Special Section Access:"
  386.     Comms.Send remsct +"\r"
  387.     WaitFor "Add Special Library Access:"
  388.     Comms.Send addlib +"\r"
  389.     WaitFor "Remove Special Library Access:"
  390.     Comms.Send remlib +"\r"
  391.     WaitFor "Add Special Conference Room Access:"
  392.     Comms.Send addco + "\r"
  393.     WaitFor "Remove Special Conference Room Access:"
  394.     Comms.Send remco + "\r"
  395.  
  396.     tSys1.delete
  397.     tSys2.delete
  398.     tSys3.delete
  399.     tSys4.delete
  400.  
  401.     'The sysop log stuff really only needs what's listed here and not
  402.     ' all the above, but not sure how much rewind we want to do
  403.     ' might fake it and capture it all for the first pass
  404.  
  405.     WaitFor "<A>bort):"
  406.     Comms.Send "y\r"
  407.     WaitFor "Name):"
  408.     Comms.Send "\r"
  409.     WaitFor " !"
  410.     Comms.Send "mes\r"
  411.     WaitForPrompt "Prompt"
  412.  
  413.     EndSysopLog
  414.  
  415.     ReportSuccess id & " : Member privileges for " & user & " [" & uid & "] on " & forum & " changed"
  416. End Sub
  417.  
  418. 'T:MailMerge (function) (CompuServe)
  419. 'Takes input from one file and substitutes %DATE% for the current date
  420. Function MailMerge(filename As String) As String
  421.     Dim MsgFileNum%
  422.     Dim SourceFileNum%
  423.     Dim ALine$, buf$
  424.  
  425.     On Error Goto MailMerge_error
  426.  
  427.     MsgFileName$ = UniqueFileName$()
  428.     MsgFileNum% = FreeFile()
  429.     Open MsgFileName$ For Append Access Read Write Shared As #MsgFileNum%
  430.     SourceFileNum% = FreeFile()
  431.     Open filename for Input Access Read Shared as #SourceFileNum%
  432.  
  433.     'Spool text from Source to Msg
  434.     While Not Eof(SourceFileNum%)
  435.         Line Input #SourceFileNum%, ALine$
  436.         If InStr(ALine$, "%DATE%") Then
  437.             buf$ = ALine$
  438.             ALine$ = Left$(buf$, InStr(buf$, "%DATE%")-1)
  439.             ALine$ = ALine$ + MyDate$
  440.             ALine$ = ALine$ + Right$(buf$, Len(buf$)-InStr(buf$, "%DATE%")-5)
  441.         End If
  442.         Print #MsgFileNum%, ALine$
  443.     Wend
  444.  
  445.     Close #SourceFileNum%
  446.     Close #MsgFileNum%
  447.     MailMerge = MsgFileName$
  448.     Exit Function
  449.  
  450. MailMerge_error:
  451.     LogResult "Error:" + Str$(Err) + " in line " + Str$(Erl) + ":" + Error$
  452.     On Error resume next
  453.     Close #SourceFileNum%
  454.     Close #MsgFileNum%
  455.     MailMerge = ""
  456.     Exit Function
  457. End Function
  458.  
  459. 'T:UploadAnnouncements (subroutine) (CompuServe)
  460. ' Go to forum sysop area and upload annoucements
  461. Sub UploadAnnouncements(id As String, forum As String, ann As String, _
  462.                        filename as String, resetfl As String)
  463.     Dim tmpfile As String, t As Tracker
  464.  
  465.     If Not GoSysOp(forum) Then
  466.         LogResult "Unable to access " + forum + " to upload announcements."
  467.         Exit Sub
  468.     End If
  469.  
  470.     ' NOTE: When you are uploading a COnference announcement you will
  471.     '        receive any chat from the rooms.  This can break things!
  472.  
  473.     ' Send the command
  474.     Comms.Send "so;mai;ann;upl;"+Trim(Left(ann,2))+";2\r"
  475.     WaitFor "(Y or N)?"
  476.     Comms.Send "y\r"
  477.     WaitFor "puter:"
  478.  
  479.     ' %DATE% -> today's date
  480.     tmpfile = MailMerge(filename)
  481.  
  482.     ' Send filename
  483.     Comms.SendLiteral tmpfile
  484.     Comms.Send "\r"
  485.  
  486.     ' Reset announcement flags
  487.     Set t = CreateTracker("PromptYN", "(Y or N)?")
  488.     WaitForPrompt "Prompt"
  489.     If PromptMatches("PromptYN") Then
  490.         Comms.Send resetfl+"\r"
  491.         WaitForPrompt "Prompt"
  492.     End If
  493.  
  494.     Comms.Send "mes\r"
  495.     WaitForPrompt "Prompt"
  496.  
  497.     DeleteFile tmpfile
  498.  
  499.     ReportSuccess id & " : Announcement " & ann & " for forum " & forum & " uploaded "
  500. End Sub
  501.  
  502. 'T:SysopModSecSub (subroutine) (CompuServe)
  503. 'Changes subject and section of a message all in one go
  504. Sub SysopModSecSub(id As String, forum As String, num As String, section As String, subject As String)
  505.  
  506.     If Not GoForum(forum) Then
  507.         LogResult "Unable to modify section "+forum+" #"+num+" to "+section
  508.         Exit Sub
  509.     End If
  510.  
  511.     StartSysopLog forum, "Modify section: "+forum+" thread #"+num+" to section "+section +"new subject: "+subject
  512.  
  513.     Comms.Send "mess;mod sec sub " +num+ ";y;" + section + ";" + subject +"\r"
  514.     WaitForPrompt "Prompt"
  515.     EndSysopLog
  516.  
  517.     If PromptMatches("PromptMessage") Then
  518.         FetchMessageThread "", forum, num, True
  519.     Else
  520.         Comms.Send "mess\r"
  521.         WaitForPrompt "Prompt"
  522.     End If
  523.  
  524.     ReportSuccess id & " : Message #" & num & " New Section #" & section & " New subject " & subject
  525. End Sub
  526.  
  527. 'T:GetUsers (subroutine) (CompuServe)
  528. ' Get list of who's online
  529. Sub GetUsers(id As String, forum As String)
  530.     Dim filename As String
  531.  
  532.     If Not GoForum(forum) Then
  533.         LogResult "Unable to access " + forum + " to get user list"
  534.         Exit Sub
  535.     End If
  536.  
  537.     filename = StartCapture(forum + "/Sysop_Logs User_Log")
  538.     CaptureText "Who was Online"+Basic.Eoln$
  539.     Terminal.Status "Collecting User List ... Please Wait"
  540.     Comms.Send "users\r"
  541.     WaitForPrompt "Prompt"
  542.     CaptureRewind 7
  543.     CaptureText Basic.Eoln$+"!end"+Basic.Eoln$
  544.     Capture CAPTURE_OFF
  545.  
  546.     ' Add to import queue
  547.     If QueueFile(Session.Service, filename, IM_DELETE) Then
  548.         ReportSuccess id & " : Users online for forum " & forum & " collected"
  549.     Else
  550.         ReportSuccess id & " : Users online for forum " & forum & " failed"
  551.     End If
  552. End Sub
  553.  
  554. 'T:AsciiListMembers (subroutine) (CompuServe)
  555. ' Get membership list
  556. Sub AsciiListMembers(id As String, forum As String, list As String, info As String)
  557.     Dim filename As String
  558.  
  559.     menuitem = ParseString(list, " ")
  560.     If Not GoSysOp(forum) Then
  561.         LogResult "Unable to access " + forum + " to get member list"
  562.         Exit Sub
  563.     End If
  564.  
  565.     filename = StartCapture(forum + "/Membership Member_List")
  566.     CaptureText list + " " + info + Basic.Eoln$
  567.     Terminal.Status "Collecting Member List ... Please Wait"
  568.     Terminal.Enabled = False
  569.     If StrComp(list, "ALL", 1)=0 Then
  570.         Comms.Send "mai;mem;lis;uid;all\r"
  571.     ElseIf info="" Then
  572.         Comms.Send "mai;mem;lis;" + menuitem + "\r"
  573.     Else 
  574.         Comms.Send "mai;mem;lis;" + menuitem + ";" + info + "\r"
  575.     End If
  576.  
  577.     WaitFor "Membership !"
  578.     CaptureRewind 12
  579.     CaptureText Basic.Eoln$+"!end"+Basic.Eoln$
  580.     Terminal.Enabled = True
  581.  
  582.     Capture CAPTURE_OFF
  583.  
  584.     ' back to so area for other scripts to work
  585.     Comms.Send "so\r"
  586.  
  587.     ' Add to import queue
  588.     If QueueFile(Session.Service, filename, IM_DELETE) Then
  589.         ReportSuccess id & " : Membership info for forum " & forum & " collected"
  590.     Else
  591.         ReportSuccess id & " : Membership info for forum " & forum & " failed"
  592.     End If
  593. End Sub
  594.  
  595. 'T:AsciiGetMemberCount (subroutine) (CompuServe)
  596. ' Get Membership Count
  597. Sub AsciiGetMemberCount(id As String, forum As String)
  598.     Dim filename As String
  599.  
  600.     If Not GoSysop(forum) Then
  601.         LogResult "Unable to access " + forum + " to get member count"
  602.         Exit Sub
  603.     End If
  604.  
  605.     Terminal.Status "Getting Member Count ... Please Wait"
  606.  
  607.     Comms.Send "mai;mem;cnt\r"
  608.     WaitFor "\n"
  609.     filename = StartCapture(forum + "/Membership Member_Count")
  610.     WaitFor "Maintenance"
  611.     CaptureRewind 22
  612.     CaptureText Basic.Eoln$+"!end"+Basic.Eoln$
  613.     Capture CAPTURE_OFF
  614.  
  615.     ' back to so area for other scripts to work
  616.     Comms.Send "so\r"
  617.  
  618.     ' Add to import queue
  619.     If QueueFile(Session.Service, filename, IM_DELETE) Then
  620.         ReportSuccess id & " : Member count for forum " & forum & " collected"
  621.     Else
  622.         ReportSuccess id & " : Member count for forum " & forum & " failed"
  623.     End If
  624. End Sub
  625.  
  626. 'T:AsciiWhoIs (subroutine) (CompuServe)
  627. Sub AsciiWhoIs(id As String, forum As String, uid As String)
  628.     Dim filename As String
  629.  
  630.     If Not GoForum(forum) Then
  631.         LogResult "Unable to access " + forum + " to get who is"
  632.         Exit Sub
  633.     End If
  634.  
  635.     filename = StartCapture(forum + "/Sysop_Logs Who_Is")
  636.     CaptureText "Who is UID "+ uid +Basic.Eoln$
  637.     Terminal.Status "Getting member records ... Please Wait"
  638.     Comms.Send "who " + uid + "\r"
  639.     WaitForPrompt "Prompt"
  640.     CaptureRewind 7
  641.     CaptureText Basic.Eoln$+"!end"+Basic.Eoln$
  642.     Capture CAPTURE_OFF
  643.  
  644.     ' Add to import queue
  645.     If QueueFile(Session.Service, filename, IM_DELETE) Then
  646.         ReportSuccess id & " : Who is for " & uid & " collected"
  647.     Else
  648.         ReportSuccess id & " : Who is for " & uid & " failed"
  649.     End If
  650. End Sub
  651.  
  652. 'T:InfoPageBreak (subroutine) (CompuServe)
  653. Sub InfoPageBreak(t As Tracker)
  654.     CaptureRewind Len(t.match)
  655.     CaptureText Basic.Eoln$+"!end"+Basic.Eoln$
  656.     CaptureText "!start "+breakforum+"/Statistics CompuServe"+Basic.Eoln$
  657.  
  658.     If t.match=Chr$(10)+"Generating library statistics...please wait" Then
  659.         CaptureText Chr$(10)+"Library statistics"
  660.     Else
  661.         CaptureText t.match
  662.     End If
  663.     t.reset
  664. End Sub
  665.  
  666. 'T:AdvancedForumStats (subroutine) (CompuServe)
  667. Sub AdvancedForumStats(id As String, forum As String)
  668.     Dim filename As String
  669.     Dim tMore As Tracker, tEnter As Tracker, tBreak1 As Tracker
  670.     Dim tBreak2 As Tracker, tBreak3 As Tracker, tBreak4 As Tracker
  671.     Dim tBreak5 As Tracker, tBreak6 As Tracker, tError As Tracker
  672.  
  673.     If Not GoSysop(forum) Then
  674.         LogResult "Unable to access " + forum + " to get advanced forum statistics"
  675.         Exit Sub
  676.     End If
  677.  
  678.     breakforum = forum
  679.     Terminal.Status "Getting Advanced Forum Statistics ... Please Wait"
  680.     Set tMore = CreateTracker("PromptHideMore", "\nPress <CR> for more :", "SendCR")
  681.     Set tEnter = CreateTracker("PromptEnter2", "\nPress <CR> :")
  682.     Set tError = CreateTracker("PromptEnter3", "\n% Ambiguous command")
  683.     Set tBreak1 = CreateTracker("PageBreak1", "\nMESSAGE STATISTICS", "InfoPageBreak")
  684.     Set tBreak2 = CreateTracker("PageBreak2", "\nMessage Size Statistics:", "InfoPageBreak")
  685.     Set tBreak3 = CreateTracker("PageBreak3", "\nSlot Statistics", "InfoPageBreak")
  686.     Set tBreak4 = CreateTracker("PageBreak4", "\nGenerating library statistics...please wait", "InfoPageBreak")
  687.     Set tBreak5 = CreateTracker("PageBreak5", "Library Download History", "InfoPageBreak")
  688.     Set tBreak6 = CreateTracker("PageBreak6", "\nMEMBERSHIP STATISTICS", "InfoPageBreak")
  689.  
  690.     ' Message statistics
  691.     Comms.Send "sta;mes;1;2;3\r"
  692.     WaitFor "\n"
  693.     filename = UniqueFilename$()
  694.     Capture CAPTURE_ON, filename
  695.     WaitForPrompt "PromptEnter"
  696.     If PromptMatches("PromptEnter3") Then
  697.         Capture CAPTURE_OFF
  698.         LogResult "Unable to get advanced forum statistics from "+forum
  699.     Else
  700.         CaptureRewind 12
  701.         CaptureText Basic.Eoln$+"!end"+Basic.Eoln$
  702.         Capture CAPTURE_OFF
  703.         Comms.Send "\r"
  704.         WaitFor "!"
  705.         Comms.Send "\r"
  706.         WaitFor "!"
  707.  
  708.         ' Library statistics
  709.         Comms.Send "lib\r"
  710.         WaitFor "\n"
  711.         Capture CAPTURE_ON, filename
  712.         CaptureText "!start "+forum+"/Statistics CompuServe"+Basic.Eoln$
  713.         WaitForPrompt "PromptEnter"
  714.         CaptureRewind 12
  715.         CaptureText Basic.Eoln$+"!end"+Basic.Eoln$
  716.         Capture CAPTURE_OFF
  717.         Comms.Send "\r"
  718.         WaitFor "!"
  719.  
  720.         ' Member statistics
  721.         Comms.Send "mem\r"
  722.         WaitFor "or N)\?"
  723.         Comms.Send "y\r"
  724.         WaitFor "please wait"
  725.         Capture CAPTURE_ON, filename
  726.         CaptureText "!start "+forum+"/Statistics CompuServe"+Basic.Eoln$
  727.         WaitForPrompt "PromptEnter"
  728.         CaptureRewind 12
  729.         CaptureText Basic.Eoln$+"!end"+Basic.Eoln$
  730.         Capture CAPTURE_OFF
  731.         Comms.Send "\r"
  732.         WaitFor "!"
  733.         Comms.Send "so\r"
  734.         WaitForPrompt "Prompt"
  735.  
  736.         ' Get more library stats
  737.         Comms.Send "mai;lib;all\r"
  738.         WaitFor "\n"
  739.         Capture CAPTURE_ON, filename
  740.         CaptureText Basic.Eoln$+"!start "+forum+"/Statistics CompuServe"+Basic.Eoln$
  741.         WaitFor "\nEnter Library number to change (CR when done):"
  742.         CaptureRewind 46
  743.         CaptureText Basic.Eoln$+"!end"+Basic.Eoln$
  744.         Capture CAPTURE_OFF
  745.         Comms.Send "\r"
  746.  
  747.         ' Add to import queue
  748.         If QueueFile(Session.Service, filename, IM_DELETE) Then
  749.             ReportSuccess id & " : Advanced Forum Statistics for forum " & forum & " collected"
  750.         Else
  751.             ReportSuccess id & " : Advanced Forum Statistics for forum " & forum & " failed"
  752.         End If
  753.     End If
  754.     WaitFor "!"
  755.     Comms.Send "so\r"
  756.     WaitForPrompt "Prompt"
  757.  
  758.     ' Cleanup
  759.     tEnter.delete
  760.     tError.delete
  761.     tMore.delete
  762.     tBreak1.delete
  763.     tBreak2.delete
  764.     tBreak3.delete
  765.     tBreak4.delete
  766.     tBreak5.delete
  767.     tBreak6.delete
  768. End Sub
  769.  
  770.  
  771.