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

  1. 'T:SYSOPLIB.EBS for CompuServe
  2. ' VA 4.01 release
  3.  
  4. Declare Sub StartSysopLog(forum As String, msg As String)
  5. Declare Sub EndSysopLog
  6. Declare Function GoSysOp(ByVal forum As String)
  7. Declare Sub ReportSuccess(id As String)
  8. Declare Function StartCapture(pseudo As String)
  9. Declare Function SectionNumber(ByVal section As String)
  10. Declare Function FileUrl(fn As String) As String
  11. Declare Function QueueFile(service As String, sfilename As String, queueflags As Long) As Boolean
  12.  
  13. Public DownloadDir As String    'where downloads go
  14.  
  15. Const IM_DELETE = 2048      ' Delete scratchpad file afterwards?
  16.  
  17. 'T:SysopRelMerge (subroutine) (CompuServe)
  18. ' This is first for Pete
  19. Sub SysopRelMerge(id As String, forum As String, fname As String)
  20.     Dim sect As String, t As Tracker
  21.  
  22.     sect = SectionNumber(forum)
  23.     If Not GoSysOp(forum) Then
  24.         LogResult "Unable to release "+fname+" in "+forum
  25.         Exit Sub
  26.     End If
  27.  
  28.     ' Send the command
  29.     StartSysopLog forum, "Released and Merged: "+forum+" file: "+fname
  30.     Comms.Send "so;mai;lib;pre "+sect+"\r"
  31.     WaitFor " !"
  32.     Comms.Send "rel\r"
  33.     WaitFor "name:"
  34.     Comms.Send fname+"\r"
  35.     WaitForPrompt "Prompt"
  36.     Set t = CreateTracker("PromptCancel", "\nDo you wish to Cancel this Merge (Y or N)")
  37.     Comms.Send "mer 0\r"
  38.     WaitForPrompt "Prompt"
  39.     If PromptMatches("PromptCancel") Then
  40.         Comms.Send "y\r"
  41.         WaitForPrompt "Prompt"
  42.     End If
  43.     t.delete
  44.     CaptureRewind 10
  45.     EndSysopLog
  46.  
  47.     ReportSuccess id & " : Released and Merged " & forum & " file: " & fname
  48. End Sub
  49.  
  50. 'T:SysopRelease (subroutine) (CompuServe)
  51. Sub SysopRelease(id As String, forum As String, fname As String)
  52.     Dim sect As String, t As Tracker
  53.  
  54.     sect = SectionNumber(forum)
  55.     If Not GoSysOp(forum) Then
  56.         LogResult "Unable to release "+fname+" in "+forum
  57.         Exit Sub
  58.     End If
  59.  
  60.     ' Send the command
  61.     StartSysopLog forum, "Released: "+forum+" file: "+fname
  62.     Comms.Send "so;mai;lib;pre "+sect+"\r"
  63.     WaitFor " !"
  64.     Comms.Send "rel\r"
  65.     WaitFor "name:"
  66.     Comms.Send fname+"\r"
  67.     WaitForPrompt "Prompt"
  68.     CaptureRewind 10
  69.     EndSysopLog
  70.  
  71.     ReportSuccess id & " : Released " & forum & " file: " & fname
  72. End Sub
  73.  
  74. 'T:SysopMerge (subroutine) (CompuServe)
  75. Sub SysopMerge(id As String, forum As String, when As String, mergefl As String)
  76.     Dim sect As String, t As Tracker
  77.  
  78.     sect = SectionNumber(forum)
  79.     If Not GoSysOp(forum) Then
  80.         LogResult "Unable to start merge in "+forum
  81.         Exit Sub
  82.     End If
  83.  
  84.     ' Send the command
  85.     StartSysopLog forum, "Merged for: "+forum+" at "+when
  86.     Comms.Send "so;mai;lib;pre "+sect+"\r"
  87.     WaitFor " !"
  88.     Set t = CreateTracker("PromptCancel", "\nDo you wish to Cancel this Merge (Y or N)")
  89.     Comms.Send "mer "+when+"\r"
  90.     WaitForPrompt "Prompt"
  91.     If PromptMatches("PromptCancel") Then
  92.         Comms.Send mergefl+"\r"
  93.         WaitForPrompt "Prompt"
  94.     End If
  95.     t.delete
  96.     CaptureRewind 10
  97.     EndSysopLog
  98.  
  99.     ReportSuccess id & " : Merge scheduled for " & forum & " at " & when
  100. End Sub
  101.  
  102. 'T:SysopErase (subroutine) (CompuServe)
  103. Sub SysopErase(id As String, forum As String, fname As String)
  104.     Dim sect As String, t As Tracker
  105.  
  106.     sect = SectionNumber(forum)
  107.     If Not GoSysOp(forum) Then
  108.         LogResult "Unable to erase "+fname+" in "+forum
  109.         Exit Sub
  110.     End If
  111.  
  112.     ' Send the command
  113.     StartSysopLog forum, "Erase: "+forum+" file: "+fname
  114.     Comms.Send "so;mai;lib;lib "+sect+"\r"
  115.     WaitFor " !"
  116.     Comms.Send "erase\r"
  117.     WaitFor "name:"
  118.     Comms.Send fname+"\r"
  119.     WaitFor "N)?"
  120.     Comms.Send "y\r"
  121.     WaitForPrompt "Prompt"
  122.     Comms.Send "\r"
  123.     WaitForPrompt "Prompt"
  124.     Comms.Send "so;mai;lib;pre "+sect+"\r"
  125.     WaitFor " !"
  126.     Comms.Send "rel\r"
  127.     WaitFor "name:"
  128.     Comms.Send fname+"\r"
  129.     WaitForPrompt "Prompt"
  130.     Set t = CreateTracker("PromptCancel", "\nDo you wish to Cancel this Merge (Y or N)")
  131.     Comms.Send "mer 0\r"
  132.     WaitForPrompt "Prompt"
  133.     If PromptMatches("PromptCancel") Then
  134.         Comms.Send "y\r"
  135.         WaitForPrompt "Prompt"
  136.     End If
  137.     t.delete
  138.     CaptureRewind 10
  139.     EndSysopLog
  140.  
  141.     ReportSuccess id & " : Erase " & forum & " file: " & fname
  142. End Sub
  143.  
  144. 'T:SysopDownload (subroutine) (CompuServe)
  145. Sub SysopDownload(id As String, forum As String, fname As String)
  146.     Dim sect As String, t As Tracker
  147.  
  148.     sect = SectionNumber(forum)
  149.     If Not GoSysOp(forum) Then
  150.         LogResult "Unable to download "+fname+" in "+forum
  151.         Exit Sub
  152.     End If
  153.  
  154.     ' Send the command
  155.     StartSysopLog forum, "Download: "+forum+" file: "+fname
  156.     Comms.Send "so;mai;lib;pre "+sect+"\r"
  157.     WaitFor " !"
  158.     Set t = CreateTracker("PromptComputer", "puter:")
  159.     Comms.Send "down/pro:qb "+fname+"\r"
  160.     WaitForPrompt "Prompt"
  161.     If PromptMatches("PromptComputer") Then
  162.         Comms.SendLiteral DownloadDir+fname
  163.         Comms.Send "\r"
  164.         WaitForPrompt "Prompt"
  165.         CaptureRewind 10
  166.         EndSysopLog
  167.         t.delete
  168.  
  169.         ReportSuccess id & " : Download unreleased " & forum & " " & FileUrl(DownloadDir + fname)
  170.         Exit Sub
  171.     End If
  172.     t.delete
  173.     CaptureRewind 10
  174.     EndSysopLog
  175.     Comms.Send "mes\r"
  176.     WaitForPrompt "Prompt"
  177.  
  178.     ReportSuccess id & " : Download failed " & forum & " file: " & fname
  179. End Sub
  180.  
  181. Sub SysopModifyFile(id As String, forum As String, fname As String, _
  182.       newfname As String, ftype As String, subj As String, keys As String, _
  183.       userid As String, sysopcomment As String, accesscount As String, _
  184.       msgfile As String)
  185.     Dim sect As String, t1 As Tracker, t2 As Tracker, inpline As String
  186.     Dim newfile As Tracker, newtype As Tracker, newtitle As Tracker
  187.     Dim newkeys As Tracker, newdesc As Tracker, newuserid As Tracker
  188.     Dim newcomment As Tracker, newaccess As Tracker, newlib As Tracker
  189.  
  190.     sect = SectionNumber(forum)
  191.     If Not GoSysOp(forum) Then
  192.         LogResult "Unable to modify "+fname+" in "+forum
  193.         Exit Sub
  194.     End If
  195.  
  196.     ' Send the command
  197.     StartSysopLog forum, "Modify: "+forum+" file: "+fname
  198.     Comms.Send "so;mai;lib;pre "+sect+"\r"
  199.     WaitFor " !"
  200.  
  201.     Set t1 = CreateTracker("PromptOK", "):")
  202.     Comms.Send "mod "+fname+"\r"
  203.     WaitForPrompt "Prompt"
  204.     If Not PromptMatches("PromptOK") Then
  205.         EndSysopLog
  206.         Comms.Send "mes\r"
  207.         WaitForPrompt "Prompt"
  208.  
  209.         ReportSuccess id & " : Modify file failed " & forum & " file: " & fname
  210.         Exit Sub
  211.     End If
  212.     t1.delete
  213.  
  214.     ftype = UCase$(ftype)
  215.     If ftype="ASCII" Then ftype = "1"
  216.     If ftype="BINARY" Then ftype = "2"
  217.     If ftype="IMAGE" Then ftype = "3"
  218.     If ftype="GRAPHIC:RLE" Then ftype = "4"
  219.     If ftype="GRAPHIC:NAPLPS" Then ftype = "5"
  220.     If ftype="GRAPHIC:GIF" Then ftype = "6"
  221.     If ftype="GRAPHIC:JPEG" Then ftype = "7"
  222.     If ftype="GRAPHIC:PNG" Then ftype = "10"
  223.  
  224.     Set newfile = CreateTracker("NewFileName", "New File Name:")
  225.     Set newtype = CreateTracker("NewType", "choice !")
  226.     Set newtitle = CreateTracker("NewTitle", "New Title:")
  227.     Set newkeys = CreateTracker("NewKeys", "New Keywords:")
  228.     Set newdesc = CreateTracker("NewDesc", "finished:")
  229.     Set newuserid = CreateTracker("NewUserId", "New User ID:")
  230.     Set newcomment = CreateTracker("NewComment", "New Comment:")
  231.     Set newaccess = CreateTracker("NewAccess", "New Access Count:")
  232.     Set newlib = CreateTracker("NewLibrary", "\nLIB "+sect+" (pre)")
  233.     Comms.Send "1-8\r"
  234.  
  235.     Do
  236.         WaitForPrompt "New"
  237.         If PromptMatches("NewFileName") Then
  238.             Comms.Send newfname+"\r"
  239.             newfname = ""
  240.         End If
  241.         If PromptMatches("NewType") Then
  242.             Comms.Send ftype + "\r"
  243.             ftype = ""
  244.         End If
  245.         If PromptMatches("NewTitle") Then
  246.             Comms.Send subj+"\r"
  247.             subj = ""
  248.         End If
  249.         If PromptMatches("NewKeys") Then
  250.             Comms.Send keys+"\r"
  251.             keys = ""
  252.         End If
  253.         If PromptMatches("NewDesc") Then
  254.             WaitFor "\n"
  255.             Comms.Send "/pos 1,d99\r"
  256.             WaitFor "\n"
  257.             Open msgfile For Input Access Read Shared As #1
  258.             While Not Eof(1)
  259.                 Line Input #1, inpline
  260.                 If inpline = "/EXIT" Then inpline = ""
  261.                 Comms.SendLiteral inpline
  262.                 Comms.Send "\r"
  263.                 WaitFor "\n"
  264.             Wend
  265.             Close #1
  266.             Comms.Send "/exit\r"
  267.         End If
  268.         If PromptMatches("NewUserId") Then
  269.             Comms.Send userid+"\r"
  270.             userid = ""
  271.         End If
  272.         If PromptMatches("NewComment") Then
  273.             Comms.Send sysopcomment+"\r"
  274.             sysopcomment = ""
  275.         End If
  276.         If PromptMatches("NewAccess") Then
  277.             Comms.Send accesscount+"\r"
  278.             accesscount = ""
  279.             Exit Do
  280.         End If
  281.         If PromptMatches("NewLibrary") Then
  282.             Exit Do
  283.         End If
  284.     Loop
  285.  
  286.     WaitForPrompt "Prompt"
  287.     CaptureRewind 10
  288.     EndSysopLog
  289.     Comms.Send "mes\r"
  290.     WaitForPrompt "Prompt"
  291.  
  292.     newfile.delete
  293.     newtype.delete
  294.     newtitle.delete
  295.     newkeys.delete
  296.     newdesc.delete
  297.     newuserid.delete
  298.     newcomment.delete
  299.     newaccess.delete
  300.     newlib.delete
  301.  
  302.     ReportSuccess id & " : Modify file " & forum & " file: " & fname
  303. End Sub
  304.  
  305. 'T:GetMergeLog (subroutine) (CompuServe)
  306. Sub GetMergeLog(id As String, forum As String)
  307.     Dim filename As String
  308.     Dim t As Tracker
  309.  
  310.     If Not GoSysop(forum) Then
  311.         LogResult "Unable to access " + forum + " to get Merge list"
  312.         Exit Sub
  313.     End If
  314.  
  315.     Set t = CreateTracker("PromptMore1", "Press <CR> for More :", "SendCR")
  316.     filename = StartCapture(forum + "/Sysop_Logs Library_Merge")
  317.     CaptureText "Library Merge Report"+Basic.Eoln$
  318.     Terminal.Enabled = False
  319.     Terminal.Status "Collecting Merge Log ... Please Wait"
  320.     Comms.Send "so;mel\r"
  321.     WaitFor "\nPress <CR> :"
  322.     t.delete
  323.     CaptureRewind 12
  324.     CaptureText Basic.Eoln$+"!end"+Basic.Eoln$
  325.     Capture CAPTURE_OFF
  326.     Terminal.Enabled = True
  327.     Comms.Send "\r"
  328.     WaitForPrompt "Prompt"
  329.                           
  330.     ' Add to import queue
  331.     If QueueFile(Session.Service, filename, IM_DELETE) Then
  332.         ReportSuccess id & " : Merge Log for forum " & forum & " collected"
  333.     Else
  334.         ReportSuccess id & " : Merge Log for forum " & forum & " failed"
  335.     End If
  336. End Sub
  337.  
  338.  
  339.