home *** CD-ROM | disk | FTP | other *** search
- 'T:SYSOPLIB.EBS for CompuServe
- ' VA 4.01 release
-
- Declare Sub StartSysopLog(forum As String, msg As String)
- Declare Sub EndSysopLog
- Declare Function GoSysOp(ByVal forum As String)
- Declare Sub ReportSuccess(id As String)
- Declare Function StartCapture(pseudo As String)
- Declare Function SectionNumber(ByVal section As String)
- Declare Function FileUrl(fn As String) As String
- Declare Function QueueFile(service As String, sfilename As String, queueflags As Long) As Boolean
-
- Public DownloadDir As String 'where downloads go
-
- Const IM_DELETE = 2048 ' Delete scratchpad file afterwards?
-
- 'T:SysopRelMerge (subroutine) (CompuServe)
- ' This is first for Pete
- Sub SysopRelMerge(id As String, forum As String, fname As String)
- Dim sect As String, t As Tracker
-
- sect = SectionNumber(forum)
- If Not GoSysOp(forum) Then
- LogResult "Unable to release "+fname+" in "+forum
- Exit Sub
- End If
-
- ' Send the command
- StartSysopLog forum, "Released and Merged: "+forum+" file: "+fname
- Comms.Send "so;mai;lib;pre "+sect+"\r"
- WaitFor " !"
- Comms.Send "rel\r"
- WaitFor "name:"
- Comms.Send fname+"\r"
- WaitForPrompt "Prompt"
- Set t = CreateTracker("PromptCancel", "\nDo you wish to Cancel this Merge (Y or N)")
- Comms.Send "mer 0\r"
- WaitForPrompt "Prompt"
- If PromptMatches("PromptCancel") Then
- Comms.Send "y\r"
- WaitForPrompt "Prompt"
- End If
- t.delete
- CaptureRewind 10
- EndSysopLog
-
- ReportSuccess id & " : Released and Merged " & forum & " file: " & fname
- End Sub
-
- 'T:SysopRelease (subroutine) (CompuServe)
- Sub SysopRelease(id As String, forum As String, fname As String)
- Dim sect As String, t As Tracker
-
- sect = SectionNumber(forum)
- If Not GoSysOp(forum) Then
- LogResult "Unable to release "+fname+" in "+forum
- Exit Sub
- End If
-
- ' Send the command
- StartSysopLog forum, "Released: "+forum+" file: "+fname
- Comms.Send "so;mai;lib;pre "+sect+"\r"
- WaitFor " !"
- Comms.Send "rel\r"
- WaitFor "name:"
- Comms.Send fname+"\r"
- WaitForPrompt "Prompt"
- CaptureRewind 10
- EndSysopLog
-
- ReportSuccess id & " : Released " & forum & " file: " & fname
- End Sub
-
- 'T:SysopMerge (subroutine) (CompuServe)
- Sub SysopMerge(id As String, forum As String, when As String, mergefl As String)
- Dim sect As String, t As Tracker
-
- sect = SectionNumber(forum)
- If Not GoSysOp(forum) Then
- LogResult "Unable to start merge in "+forum
- Exit Sub
- End If
-
- ' Send the command
- StartSysopLog forum, "Merged for: "+forum+" at "+when
- Comms.Send "so;mai;lib;pre "+sect+"\r"
- WaitFor " !"
- Set t = CreateTracker("PromptCancel", "\nDo you wish to Cancel this Merge (Y or N)")
- Comms.Send "mer "+when+"\r"
- WaitForPrompt "Prompt"
- If PromptMatches("PromptCancel") Then
- Comms.Send mergefl+"\r"
- WaitForPrompt "Prompt"
- End If
- t.delete
- CaptureRewind 10
- EndSysopLog
-
- ReportSuccess id & " : Merge scheduled for " & forum & " at " & when
- End Sub
-
- 'T:SysopErase (subroutine) (CompuServe)
- Sub SysopErase(id As String, forum As String, fname As String)
- Dim sect As String, t As Tracker
-
- sect = SectionNumber(forum)
- If Not GoSysOp(forum) Then
- LogResult "Unable to erase "+fname+" in "+forum
- Exit Sub
- End If
-
- ' Send the command
- StartSysopLog forum, "Erase: "+forum+" file: "+fname
- Comms.Send "so;mai;lib;lib "+sect+"\r"
- WaitFor " !"
- Comms.Send "erase\r"
- WaitFor "name:"
- Comms.Send fname+"\r"
- WaitFor "N)?"
- Comms.Send "y\r"
- WaitForPrompt "Prompt"
- Comms.Send "\r"
- WaitForPrompt "Prompt"
- Comms.Send "so;mai;lib;pre "+sect+"\r"
- WaitFor " !"
- Comms.Send "rel\r"
- WaitFor "name:"
- Comms.Send fname+"\r"
- WaitForPrompt "Prompt"
- Set t = CreateTracker("PromptCancel", "\nDo you wish to Cancel this Merge (Y or N)")
- Comms.Send "mer 0\r"
- WaitForPrompt "Prompt"
- If PromptMatches("PromptCancel") Then
- Comms.Send "y\r"
- WaitForPrompt "Prompt"
- End If
- t.delete
- CaptureRewind 10
- EndSysopLog
-
- ReportSuccess id & " : Erase " & forum & " file: " & fname
- End Sub
-
- 'T:SysopDownload (subroutine) (CompuServe)
- Sub SysopDownload(id As String, forum As String, fname As String)
- Dim sect As String, t As Tracker
-
- sect = SectionNumber(forum)
- If Not GoSysOp(forum) Then
- LogResult "Unable to download "+fname+" in "+forum
- Exit Sub
- End If
-
- ' Send the command
- StartSysopLog forum, "Download: "+forum+" file: "+fname
- Comms.Send "so;mai;lib;pre "+sect+"\r"
- WaitFor " !"
- Set t = CreateTracker("PromptComputer", "puter:")
- Comms.Send "down/pro:qb "+fname+"\r"
- WaitForPrompt "Prompt"
- If PromptMatches("PromptComputer") Then
- Comms.SendLiteral DownloadDir+fname
- Comms.Send "\r"
- WaitForPrompt "Prompt"
- CaptureRewind 10
- EndSysopLog
- t.delete
-
- ReportSuccess id & " : Download unreleased " & forum & " " & FileUrl(DownloadDir + fname)
- Exit Sub
- End If
- t.delete
- CaptureRewind 10
- EndSysopLog
- Comms.Send "mes\r"
- WaitForPrompt "Prompt"
-
- ReportSuccess id & " : Download failed " & forum & " file: " & fname
- End Sub
-
- Sub SysopModifyFile(id As String, forum As String, fname As String, _
- newfname As String, ftype As String, subj As String, keys As String, _
- userid As String, sysopcomment As String, accesscount As String, _
- msgfile As String)
- Dim sect As String, t1 As Tracker, t2 As Tracker, inpline As String
- Dim newfile As Tracker, newtype As Tracker, newtitle As Tracker
- Dim newkeys As Tracker, newdesc As Tracker, newuserid As Tracker
- Dim newcomment As Tracker, newaccess As Tracker, newlib As Tracker
-
- sect = SectionNumber(forum)
- If Not GoSysOp(forum) Then
- LogResult "Unable to modify "+fname+" in "+forum
- Exit Sub
- End If
-
- ' Send the command
- StartSysopLog forum, "Modify: "+forum+" file: "+fname
- Comms.Send "so;mai;lib;pre "+sect+"\r"
- WaitFor " !"
-
- Set t1 = CreateTracker("PromptOK", "):")
- Comms.Send "mod "+fname+"\r"
- WaitForPrompt "Prompt"
- If Not PromptMatches("PromptOK") Then
- EndSysopLog
- Comms.Send "mes\r"
- WaitForPrompt "Prompt"
-
- ReportSuccess id & " : Modify file failed " & forum & " file: " & fname
- Exit Sub
- End If
- t1.delete
-
- ftype = UCase$(ftype)
- If ftype="ASCII" Then ftype = "1"
- If ftype="BINARY" Then ftype = "2"
- If ftype="IMAGE" Then ftype = "3"
- If ftype="GRAPHIC:RLE" Then ftype = "4"
- If ftype="GRAPHIC:NAPLPS" Then ftype = "5"
- If ftype="GRAPHIC:GIF" Then ftype = "6"
- If ftype="GRAPHIC:JPEG" Then ftype = "7"
- If ftype="GRAPHIC:PNG" Then ftype = "10"
-
- Set newfile = CreateTracker("NewFileName", "New File Name:")
- Set newtype = CreateTracker("NewType", "choice !")
- Set newtitle = CreateTracker("NewTitle", "New Title:")
- Set newkeys = CreateTracker("NewKeys", "New Keywords:")
- Set newdesc = CreateTracker("NewDesc", "finished:")
- Set newuserid = CreateTracker("NewUserId", "New User ID:")
- Set newcomment = CreateTracker("NewComment", "New Comment:")
- Set newaccess = CreateTracker("NewAccess", "New Access Count:")
- Set newlib = CreateTracker("NewLibrary", "\nLIB "+sect+" (pre)")
- Comms.Send "1-8\r"
-
- Do
- WaitForPrompt "New"
- If PromptMatches("NewFileName") Then
- Comms.Send newfname+"\r"
- newfname = ""
- End If
- If PromptMatches("NewType") Then
- Comms.Send ftype + "\r"
- ftype = ""
- End If
- If PromptMatches("NewTitle") Then
- Comms.Send subj+"\r"
- subj = ""
- End If
- If PromptMatches("NewKeys") Then
- Comms.Send keys+"\r"
- keys = ""
- End If
- If PromptMatches("NewDesc") Then
- WaitFor "\n"
- Comms.Send "/pos 1,d99\r"
- WaitFor "\n"
- Open msgfile For Input Access Read Shared As #1
- While Not Eof(1)
- Line Input #1, inpline
- If inpline = "/EXIT" Then inpline = ""
- Comms.SendLiteral inpline
- Comms.Send "\r"
- WaitFor "\n"
- Wend
- Close #1
- Comms.Send "/exit\r"
- End If
- If PromptMatches("NewUserId") Then
- Comms.Send userid+"\r"
- userid = ""
- End If
- If PromptMatches("NewComment") Then
- Comms.Send sysopcomment+"\r"
- sysopcomment = ""
- End If
- If PromptMatches("NewAccess") Then
- Comms.Send accesscount+"\r"
- accesscount = ""
- Exit Do
- End If
- If PromptMatches("NewLibrary") Then
- Exit Do
- End If
- Loop
-
- WaitForPrompt "Prompt"
- CaptureRewind 10
- EndSysopLog
- Comms.Send "mes\r"
- WaitForPrompt "Prompt"
-
- newfile.delete
- newtype.delete
- newtitle.delete
- newkeys.delete
- newdesc.delete
- newuserid.delete
- newcomment.delete
- newaccess.delete
- newlib.delete
-
- ReportSuccess id & " : Modify file " & forum & " file: " & fname
- End Sub
-
- 'T:GetMergeLog (subroutine) (CompuServe)
- Sub GetMergeLog(id As String, forum As String)
- Dim filename As String
- Dim t As Tracker
-
- If Not GoSysop(forum) Then
- LogResult "Unable to access " + forum + " to get Merge list"
- Exit Sub
- End If
-
- Set t = CreateTracker("PromptMore1", "Press <CR> for More :", "SendCR")
- filename = StartCapture(forum + "/Sysop_Logs Library_Merge")
- CaptureText "Library Merge Report"+Basic.Eoln$
- Terminal.Enabled = False
- Terminal.Status "Collecting Merge Log ... Please Wait"
- Comms.Send "so;mel\r"
- WaitFor "\nPress <CR> :"
- t.delete
- CaptureRewind 12
- CaptureText Basic.Eoln$+"!end"+Basic.Eoln$
- Capture CAPTURE_OFF
- Terminal.Enabled = True
- Comms.Send "\r"
- WaitForPrompt "Prompt"
-
- ' Add to import queue
- If QueueFile(Session.Service, filename, IM_DELETE) Then
- ReportSuccess id & " : Merge Log for forum " & forum & " collected"
- Else
- ReportSuccess id & " : Merge Log for forum " & forum & " failed"
- End If
- End Sub
-
-
-