home *** CD-ROM | disk | FTP | other *** search
- 'T:SYSOP2.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 Function StartCapture(pseudo As String)
- Declare Function MyDate$
- Dim nummessages as Integer
- Declare Function GoSysOp(forum As String)
-
- Dim syslog As String ' Location of SysOp logs
- Dim ErrorDetected As Boolean ' Error detected while running script
- Dim sMsgStatFile as string ' Unique name for capture file
- Dim msMessageLine() As String ' Message Lines
-
- 'T:AsciiListOfMailUsers (subroutine) (CompuServe)
- Sub AsciiListOfMailUsers(id as String, forum As String, TheDate as String, SendMailToUsers as String)
- Dim NewUserData as String
- Dim ImportNewUserNames As String
- Dim BSCFile As String
- Dim t1 as tracker, t2 as Tracker
-
- If Not GoSysOp(forum) Then
- LogResult "Unable to access " + forum + "to get list of new users"
- Exit Sub
- End If
-
- ' Send the command
- Comms.Send "so;mai;mem;lis;djn;" + TheDate + "\r"
- Terminal.Status "Capturing New User Information"
- WaitFor "Public CO Rooms :"
- Terminal.Enabled = False
- Set t1 = CreateTracker("NewUser", "Name : ", "NewUserCounter")
- Set t2 = CreateTracker("PromptSOList", "\nList Membership !", "", True)
-
- NewUserData = UniqueFilename$()
- Capture CAPTURE_ON, NewUserData
-
- 'Wait until I get back to the prompt.
- Do
- TimedWaitForPrompt "Prompt", 45
- Loop Until PromptMatches("PromptSOList")
-
- Capture CAPTURE_OFF
- t1.Delete
- t2.delete
- Terminal.Enabled = True
- Terminal.Status "Processing New User Information"
-
- ImportNewUserNames = UniqueFileName$()
-
- Open NewUserData For Input Access Read Shared As #1
- Open ImportNewUserNames For Output Access Write Shared As #3
-
- Print #3, "!start "+forum+"/Membership New_Joiners"
- Print #3, "People who have joined the forum since " + TheDate
- Print #3, " "
-
- If UCase$(SendMailToUsers) = "Y" then
- BSCFile = Session.ServicePath
- AddBackslash BSCFile
- BSCFile = BSCFIle & Session.Service & ".bsc"
- Open BSCFile For Append Access Write Shared As #2
-
- Print #3, "These people will all be mailed the 'welcome to the forum'"
- Print #3, "text the next time you do a connect to CompuServe."
- Print #3, " "
- While Not Eof(1)
- Line Input #1, inpline
- If Left$(inpline, 7) = "Name : " then
- print #2, ";-; id:" & Chr(9) & "system type:" & Chr(9) & "script script:" & Chr(9) & "Send Welcome Mail to User priority:" & Chr(9) & "30 #:" & Chr(9) & forum & " #:" & Chr(9) & Right$(inpline, len(inpline) -7)
- print #2, "WelcomeMailTo"
- print #2, forum
- print #2, Right$(inpline, len(inpline) -7)
- print #3, Right$(inpline, len(inpline) -7)
- End If
- Wend
- close #2
- Else
- Print #3, " "
- While Not Eof(1)
- Line Input #1, inpline
- If Left$(inpline, 7) = "Name : " then
- print #3, Right$(inpline, len(inpline) -7)
- End If
- Wend
- End If
-
- Print #3, " "
- Close #3
- close #1
- b = QueueFile(Session.Service, ImportNewUserNames, IM_DELETE)
-
- Comms.Send "mes\r"
- WaitForPrompt "Prompt"
- ReportSuccess id & " : got info"
- End Sub
-
- 'T:NewUserCounter (subroutine) (CompuServe)
- ' Display number of messages downloaded
- Sub NewUserCounter(t As Tracker)
- nummessages = nummessages + 1
- Terminal.CaptureStatus nummessages, "Collecting new joinee names"
- t.reset
- End Sub
-
- 'T:AsciiListHeldMessages (subroutine) (CompuServe)
- Sub AsciiListHeldMessages(id As String, forum As String, sections As String)
- Dim nFOld As Integer
- Dim nFNew As Integer
- Dim sScanOld As String
- Dim sScanNew As String
- Dim sNextLine As String
- Dim nTextBreak As Integer
- Dim sMsgNumber as String
- Dim sMsgSection as String
- Dim nIndex as Integer
-
- On Error Goto AsciiListHeldMessages_Error
-
- If Not GoForum(forum) Then
- LogResult id + " : Failed : Unable to collect messages from " + forum
- Exit Sub
- End If
-
- sScanOld = StartCapture(forum + "/Sysop_Logs Held_Messages")
-
- Terminal.Status "Collecting Held List ... Please Wait"
-
- Comms.Send "mess;ss "+sections+";sca hold\r"
-
- WaitForPrompt "Prompt"
- CaptureRewind 7
- CaptureText Basic.Eoln$+"!end"+Basic.Eoln$
- Capture CAPTURE_OFF
-
- ' Create file new file to hold converted data
- sScanNew = UniqueFileName$()
- nFNew = FreeFile
- Open sScanNew For Output Access Write Shared As #nFNew
-
- ' Open old file and start reading
- nFOld = FreeFile
- Open sScanOld For Input Shared As #nFOld
- Print #nFNew, "!start "+forum+"/Sysop_Logs Held_Messages"
- Print #nFNew, "Messages on Hold"
- Print #nFNew, ""
-
- Do While Not EOF(nFOld)
-
- ' Get line
- Line Input #nFOld,sNextLine
-
- ' Check for message number
- If Left$(sNextLine,2) = "#:" Then
-
- ' Parse line
- sNextLine = Trim$(sNextLine)
- sNextLine = Mid$(sNextLine,4)
- nTextBreak = Instr(1,sNextLine," ")
- sMsgNumber = Mid$(sNextLine,1,nTextBreak-1)
- sMsgSection = Mid$(sNextLine,nTextBreak+5)
-
- ' Add underscores
- For nIndex = 1 to Len(sMsgSection)
- Select case Mid$(sMsgSection,nIndex,1)
- Case "/"," "
- Mid$(sMsgSection,nIndex,1) = "_"
- End Select
- Next nIndex
-
- Print #nFNew, "VA:Cis:" + forum + "/" + sMsgSection + "#" + sMsgNumber
- End If
- Loop
- Print #nFNew, "!end"
-
- ' Close open files
- Close #nFOld
- Close #nFNew
-
- ' Delete the old scan file
- Kill sScanOld
-
- ' Add to import queue
- If QueueFile(Session.Service, sScanNew, IM_DELETE) Then
- ReportSuccess id & " : Held Message List for forum " & forum & " collected"
- Else
- ReportSuccess id & " : Held Message List for forum " & forum & " failed"
- End If
-
- Terminal.Status ""
- Exit Sub
-
- AsciiListHeldMessages_Error:
- LogResult "Error running Held Message List script"
- End Sub
-
- 'T:WelcomeMailTo (subroutine) (CompuServe)
- Sub WelcomeMailTo(id As String, forum As String, user As String)
- Dim fname As String
-
- fname = Session.ServicePath
- AddBackslash fname
- If InStr(forum, ":")<>0 Then
- fname = fname + Mid$(forum, InStr(forum, ":")+1, 8)+".wel"
- Else
- fname = fname + Mid$(forum, 1, 8)+".wel"
- End If
-
- MailTo "Welcome", user, fRECEIPT+fDONTCOPY, _
- "Welcome to the "+forum+" Forum", fname
- SendMail "Welcome"
- ReportSuccess id & " : Welcome message sent to " & user
- End Sub
-
-