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

  1. 'T:COMMANDS.EBS for CompuServe
  2. ' VA 4.01 release
  3.  
  4. Declare Function ParseString(args As String, delim As String) As String
  5. Declare Function QueueFile(service As String, sfilename As String, queueflags As Long) As Boolean
  6.  
  7. Const IM_DELETE = 2048      ' Delete scratchpad file afterwards?
  8.  
  9. Public DownloadDir As String    'where downloads go
  10. Public WorkingPath As String    'added to speed up Fetch stuff online
  11. Public WhereAmI As String        'name of last forum/page etc
  12. Public Sysop As Boolean            'are we a sysop?
  13. Public InAscii As Boolean
  14.  
  15. Dim lastprompt As String    'Tracker name of the last prompt encountered
  16. Dim lastmatch As String     'Tracker match text of the last prompt encountered
  17. Dim MailSubject As String   'Subject for current mail message
  18. Dim MailFilename As String  'Filename for current mail message
  19. Dim Success As Boolean  'Whether command succeeded
  20. Dim Failure As String       'Reason command failed (error message)
  21. Dim sctrack As Tracker      'Success/Failure tracker
  22. Dim BellSet As Boolean      'do we have ^G prompt set?
  23. Dim nummessages As Integer
  24. Dim LastDownMessages As String
  25. Dim LastFailure As String   'last forum we failed going to
  26. Dim binfname As String
  27. Dim binfrom As String
  28. Dim billingproblem As Boolean   'workaround CIS switching into 7bit mode
  29. Dim SetHighMessage As Boolean
  30.  
  31. Declare Function UniqueFileName$
  32. Declare Function MyDate$
  33. Declare Sub SetHighMessageNumber
  34.  
  35. 'T:Main - CIS (subroutine) (CompuServe) (CompuServe)
  36. 'Entry point. Does a complete blink
  37. Sub Main
  38.     On Error Goto Main_error
  39.     If Instr(Command$, "debug") Then
  40.         ViewportOpen
  41.         Capture CAPTURE_ON
  42.         Print "Current Directory = "; CurDir$
  43.     End If
  44.  
  45.     Trackers.DefaultIgnoreCase = False
  46.     Trackers.DefaultWildcard = False
  47.     InAscii = False
  48.  
  49.     ' Default download dir
  50.     DownloadDir = ReadIni$("Service "+Session.Service, "Download Directory", Session.IniFilename)
  51.     AddBackSlash DownloadDir
  52.  
  53.     ' added this to use in RemoteSearch
  54.     WorkingPath = ReadIni$("Service "+Session.Service, "Work Path", Session.IniFileName)
  55.     AddBackSlash WorkingPath
  56.  
  57.     'Create the cis.rep file
  58.     StartReportFile
  59.     LogResult "CompuServe connection Started " + MyDate$ + " (" + _
  60.         ReadIni$(Session.IniSection, "Description", Session.IniFileName)+ ")"
  61.     Terminal.Log = True
  62.     Terminal.Print "Started at " + MyDate$ + Basic.Eoln$
  63.  
  64.     LoadExtraLibraries
  65.     LoadAddonLibraries
  66.     SetUpStandardTrackers
  67.  
  68.     HMIMain
  69.  
  70.     LogResult "CompuServe connection Finished " + MyDate$
  71.     Terminal.Print "Finished at " + MyDate$ + Basic.Eoln$
  72.     'Close and queue the cis.rep file
  73.     EndReportFile
  74.     Exit Sub
  75. Main_error:
  76.     LogResult "Error:" + Str$(Err) + " in line " + Str$(Erl) + ":" + Error$
  77.     LogResult "CompuServe connection Failed " + MyDate$
  78.     'Close and queue the cis.rep file
  79.     EndReportFile
  80. End Sub
  81.  
  82. ' Load the other libraries
  83. Sub LoadExtraLibraries
  84.     LoadScript "hmibase.ebs"
  85.     LoadScript "hmimail.ebs"
  86.     LoadScript "hmiforum.ebs"
  87.     LoadScript "hmisysop.ebs"
  88.     LoadScript "basic.ebs"
  89.     LoadScript "billing.ebs"
  90.     LoadScript "ens.ebs"
  91.     LoadScript "exec.ebs"
  92.     LoadScript "online.ebs"
  93.     LoadScript "sysop.ebs"
  94.     LoadScript "sysop2.ebs"
  95.     LoadScript "sysoplib.ebs"
  96.     LoadScript "weather.ebs"
  97.     LoadScript "ziff.ebs"
  98.     LoadScript "obsolete.ebs"
  99.  
  100.     ' User created scripts should go into user.ebs
  101.     LoadScript "user.ebs"
  102. End Sub
  103.  
  104. 'T:LookupForum (subroutine) (CompuServe)
  105. Function LookupForum(forum As String) As String
  106.     Dim newforum As String
  107.  
  108.     newforum = ReadIni$("Forum Lookup", forum, Session.ServicePath+"userlist.ini")
  109.     If newforum="" Then
  110.         newforum = ReadIni$("Forum Lookup", forum, Session.ServicePath+"list.ini")
  111.     End If
  112.     'LogResult "Forum Lookup: "+forum+" -> "+newforum
  113.     If newforum="" Then
  114.         LookupForum = forum
  115.     Else
  116.         LookupForum = newforum
  117.     End If
  118. End Function
  119.  
  120. 'T:ResetForum (subroutine) (CompuServe)
  121. ' Clears the current forum - so the next GoForum() does it
  122. Sub ResetForum
  123.     WhereAmI = ""
  124.     Sysop = False
  125. End Sub
  126.  
  127. 'T:SectionNumber (function) (CompuServe)
  128. 'Returns section number as a string or "" if nothing there
  129. Function SectionNumber(ByVal section As String)
  130.     Dim i% As Integer
  131.     Dim tsection As String
  132.  
  133.     SectionNumber = ""
  134.     i% = InStr(section, "/S", 1)
  135.     If i%=0 Then i% = InStr(section, "/L", 1)
  136.     If i%<>0 Then
  137.         tsection = Mid(section, i%+2)
  138.         i% = InStr(tsection, "_")
  139.         If i% = 0 Then i% = InStr(tsection, " ")
  140.         If i%<>0 Then
  141.             SectionNumber = Mid(tsection, 1, i%-1)
  142.         Else
  143.             SectionNumber = tsection
  144.         End If
  145.     End If
  146. End Function
  147.  
  148. 'T:ForumName (function) (CompuServe)
  149. 'Returns forum name part of forum/section or "" if nothing there
  150. Function ForumName(ByVal forum As String) As String
  151.     ForumName = ParseString(forum, "/")
  152. End Function
  153.  
  154. 'T:StartCapture (subroutine) (CompuServe)
  155. ' Opens capture file and sticks header it it
  156. Function StartCapture(pseudo As String)
  157.     Dim filename As String
  158.  
  159.     filename = UniqueFilename$()
  160.     Capture CAPTURE_ON, filename
  161.     CaptureText Basic.Eoln$+"!start "+pseudo+Basic.Eoln$
  162.     StartCapture = filename
  163. End Function
  164.  
  165. Sub ReplaceAllInString(txt As String, search As String, replace As String)
  166.     Dim i As Integer, s As Integer, r As Integer
  167.  
  168.     s = Len(search)
  169.     r = Len(replace)
  170.     i = Instr(txt, search)
  171.     While i > 0
  172.         If s = r Then
  173.             Mid$(txt, i, s) = replace
  174.         Else
  175.             txt = Left$(txt, i - 1) + replace + Mid$(txt, i + s)
  176.         End If
  177.         i = Instr(i + r, txt, search)
  178.     Wend
  179. End Sub
  180.  
  181. Sub ReplaceAnyInString(txt As String, search As String, replace As String)
  182.     Dim i As Integer, s As Integer
  183.  
  184.     s = Len(txt)
  185.     For i = 1 To s
  186.         If Instr(search, Mid$(txt, i, 1)) Then
  187.             Mid$(txt, i, 1) = replace
  188.         End If
  189.     Next
  190. End Sub
  191.  
  192. 'T:QueFetches (subroutine) (CompuServe)
  193. 'added this should make the Fetch process faster and neater
  194. Sub QueFetches
  195.    Dim c as Boolean, Fetchfilename As String
  196.    
  197.    Fetchfilename = WorkingPath + "mswfetch.tmp"
  198.  
  199.    If FileExists(Fetchfilename) Then
  200.        If FileLen(Fetchfilename) > 0 Then
  201.            c = QueueFile(Session.Service, Fetchfilename, IM_DELETE)
  202.        Else
  203.            DeleteFile Fetchfilename
  204.        End If
  205.    End If
  206. End Sub
  207.  
  208. Function FullErrorMessage() As String
  209.     FullErrorMessage = err & " in line " & erl & ":" & Error$
  210. End Function
  211.  
  212. 'T:Standard Trackers for CompuServe
  213. 'The standard CIS trackers
  214. Sub SetUpStandardTrackers()
  215.     Dim t As Tracker
  216.  
  217.     Set t = CreateTracker("PromptChoice1", "\nEnter choice!", "", True)
  218.     Set t = CreateTracker("PromptChoice2", "\nEnter choice !", "", True)
  219.     Set t = CreateTracker("PromptEnter", "\nPress <CR> !")
  220.     Set t = CreateTracker("BadCommand", "\nI don't recognize that command.")
  221.     Set t = CreateTracker("PromptNextOrChoice", "\nPress <CR> for next or type CHOICES !")
  222.     Set t = CreateTracker("PromptMain", "\n!")
  223.     Set t = CreateTracker("PromptForum", "\nForum !")
  224.     Set t = CreateTracker("PromptMessages", "\nMessages !")
  225.     Set t = CreateTracker("PromptAction", "\nRead action !")
  226.     Set t = CreateTracker("PromptOK", "\nOK")
  227.     Set t = CreateTracker("PromptPost", "\nPost action !")
  228.     Set t = CreateTracker("PromptNumber1", "\nEnter choice number!")
  229.     Set t = CreateTracker("PromptNumber2", "\nEnter choice number !")
  230.     Set t = CreateTracker("PromptMail", "\nMail!")
  231.     Set t = CreateTracker("PromptLibrary", "\nLIB ")
  232.     Set t = CreateTracker("PromptAdditional", "\nDo you wish additional information (Y or N)!", "SendNo")
  233.     Set t = CreateTracker("PromptMore", "\nMORE !", "SendCR")
  234.     Set t = CreateTracker("PromptMore2", Chr$(19)+Chr$(13)+Chr$(0)+Chr$(0)+Chr$(0)+Chr$(0)+"PAGE", "SendCR")
  235.     Set t = CreateTracker("PromptMore3", Chr$(13)+"PAGE", "SendCR")
  236.     Set t = CreateTracker("PromptAdd", "ADDress or HELp")
  237.     Set t = CreateTracker("PromptEmpty1", "\nThat page is empty !")
  238.     Set t = CreateTracker("PromptEmpty2", "\nThat page is empty!")
  239.     Set t = CreateTracker("PromptLast", "\nLast page, enter choice!")
  240.     Set t = CreateTracker("PromptDelete", "Delete these messages\? (Y or N)!")
  241.     Set t = CreateTracker("PromptSend1", "SEND!")
  242.     Set t = CreateTracker("PromptSend2", "User ID):")
  243.     Set t = CreateTracker("PromptLastPage1", "\nLast Page!", "", True)
  244.     Set t = CreateTracker("PromptLastPage2", "\nLast Page !", "", True)
  245.     Set t = CreateTracker("PromptSO1", "\nSO !", "", True)
  246.     Set t = CreateTracker("PromptSO2", "\nMembership Maintenance !", "", True)
  247.     Set t = CreateTracker("PromptSO3", "\nMaintenance !", "", True)
  248. End Sub
  249.  
  250. 'T:SetStandardOptions (subroutine) (CompuServe)
  251. Sub SetStandardOptions
  252.     Comms.AutoDownload = PROT_QUICKB
  253.     Comms.Send "set width 79\r"
  254.     WaitForPrompt "Prompt"
  255. End Sub
  256.  
  257. 'T:SuccessMatched (subroutine) (CompuServe)
  258. 'Tracker procedure called if the success tracker is hit
  259. Sub SuccessMatched(t As Tracker)
  260.     Print "SuccessMatched :"; t.Name; "="; t.Match
  261.     Success = True
  262.     t.reset
  263. End Sub
  264.  
  265. 'T:FailureMatched (subroutine) (CompuServe)
  266. 'Tracker procedure called if the failure tracker is hit
  267. 'The match string is stored in the Failure variable for showing to the user
  268. Sub FailureMatched(t As Tracker)
  269.     Print "FailureMatched :"; t.Name; "="; t.Match
  270.     Success = False
  271.     Failure = Failure + t.Match
  272.     t.reset
  273. End Sub
  274.  
  275. 'T:TrackSuccess (subroutine) (CompuServe)
  276. 'Set up a success tracker to match pattern s
  277. 'If the tracker isn't matched, we will report defaulterr
  278. Sub TrackSuccess(s As String, defaulterr As String)
  279.     If sctrack Is Not Nothing Then sctrack.delete
  280.     Set sctrack = CreateTracker("sctrack", s, "SuccessMatched")
  281.     Success = False
  282.     Failure = defaulterr
  283. End Sub
  284.  
  285. 'T:TrackFailure (subroutine) (CompuServe)
  286. 'Set up a failure tracker to match pattern s
  287. 'If it is matched, the match string will be stored in the Failure variable
  288. Sub TrackFailure(s As String)
  289.     If sctrack Is Not Nothing Then sctrack.delete
  290.     If s<>"" Then
  291.         Set sctrack = CreateTracker("sctrack", s, "FailureMatched")
  292.         Success = True
  293.         Failure = ""
  294.     End If
  295. End Sub
  296.  
  297. 'T:ReportSuccessFlag (subroutine) (CompuServe)
  298. 'At the end of the command, report whether it succeeded
  299. 'Assumes either TrackSuccess or TrackFailure has been called at start
  300. Sub ReportSuccessFlag(id As String)
  301.     If sctrack Is Not Nothing Then sctrack.delete
  302.     If Success Then
  303.         ReportSuccess id
  304.     Else
  305.         ReportFailure id, Failure
  306.     End If
  307. End Sub
  308.  
  309. 'T:PromptMatches (function) (CompuServe) (CompuServe)
  310. 'Check if the last prompt tracker name matches prefix
  311. Function PromptMatches(prefix As String)
  312.     PromptMatches = (Left$(lastprompt, len(prefix)) = prefix)
  313. End Function
  314.  
  315. 'T:TimedWaitForPrompt(subroutine) (CompuServe)
  316. 'Timed wait for a prompt whose tracker name matches prefix
  317. Sub TimedWaitForPrompt(prefix As String, timeout As Integer)
  318.     Dim t As Tracker
  319.  
  320.     Print "WaitForPrompt "; prefix
  321.     Trackers.Reset
  322.     Do
  323.         Set t = Wait(10 * timeout)
  324.         lastprompt = t.Name
  325.         lastmatch = t.Match
  326.         t.reset
  327.     Loop Until PromptMatches(prefix)
  328. End Sub
  329.  
  330. 'T:WaitForPrompt (subroutine) (CompuServe)
  331. 'Wait 4 mins for a prompt whose tracker name matches prefix
  332. Sub WaitForPrompt(prefix As String)
  333.     TimedWaitForPrompt prefix, 240
  334. End Sub
  335.  
  336. 'T:GoTop (subroutine) (CompuServe)
  337. ' Go to the top menu
  338. Sub GoTop
  339.     If SetHighMessage Then
  340.         Comms.Send "high;l\r"
  341.         WaitForPrompt "Prompt"
  342.         SetHighMessage = False
  343.     End If
  344.     ResetForum
  345.     Comms.Send "go cis:top\r"
  346.     WaitForPrompt "Prompt"
  347. End Sub
  348.  
  349. 'T:SetSysop (subroutine) (global)
  350. Sub SetSysop(t As Tracker)
  351.     Print "Matched:"; t.name
  352.     t.reset
  353.     Sysop = True
  354. End Sub
  355.  
  356. 'T:GoForum (function) (CompuServe)
  357. ' Intelligently GO forum/page etc
  358. Function GoForum(ByVal forum As String) As Boolean
  359.     Dim go1 As Tracker, go2 As Tracker, go3 As Tracker, go4 As Tracker
  360.     Dim go5 As Tracker, go6 As Tracker, go7 As Tracker, go8 As Tracker
  361.     Dim go9 As Tracker, go10 As Tracker, go11 As Tracker, go12 As Tracker
  362.     Dim go13 As Tracker, go14 As Tracker, go15 As Tracker, go16 As Tracker
  363.     Dim go17 As Tracker, go18 As Tracker, go19 As Tracker, go20 As Tracker
  364.     Dim go21 As Tracker, go22 As Tracker, go23 As Tracker, go24 As Tracker
  365.     Dim go25 As Tracker, go26 As Tracker, go27 As Tracker, go28 As Tracker
  366.     Dim go29 As Tracker, go30 As Tracker, go31 As Tracker, t As Tracker
  367.     Dim sysop1 As Tracker, sysop2 As Tracker, sysop3 As Tracker
  368.     Dim filename As String, b As Boolean
  369.  
  370.     ' Mangle the forum name a bit
  371.     forum = ParseString(forum, "/")
  372.     If Instr(forum, ":")=0 Then
  373.         forum = "cis:"+forum
  374.     End If
  375.  
  376.     ' Use the lookup table to auto-convert menus to forums.
  377.     ' eg. 'PCPLUS' -> 'PCPFORUM'
  378.     forum = LookupForum(forum)
  379.  
  380.     ' Sort out any switch between ascii/hmi
  381.     If InAscii=False Then
  382.         SetHighMessageNumber
  383.         ResetForum
  384.         InAscii = True
  385.     End If
  386.  
  387.     ' If we're already here then do nothing
  388.     If WhereAmI <> forum Then
  389.         GoForum = False
  390.  
  391.         ' If we failed last time then we're just gonna fail again
  392.         If LastFailure=forum Then
  393.             Exit Function
  394.         End If
  395.         BellSet = False
  396.         On Error Goto GoForum_error
  397.         If SetHighMessage Then
  398.             Comms.Send "high;l\r"
  399.             WaitForPrompt "Prompt"
  400.             SetHighMessage = False
  401.         End If
  402.         Trackers.Delete 'disable all trackers
  403.         ResetForum
  404.  
  405.         Set go1 = CreateTracker("GoPromptForum1", "\nForum !", "")
  406.         Set go3 = CreateTracker("GoMore1", "\nMORE !", "SendCR")
  407.         Set go4 = CreateTracker("GoPromptMenu", "\n!", "")
  408.         Set go5 = CreateTracker("GoUnavailable1", "\n? Service is temporarily unavailable", "")
  409.         Set go6 = CreateTracker("GoUnavailable2", "\n% ENS is temporarily unavailable due to hardware problems.", "")
  410.         Set go7 = CreateTracker("GoUnavailable3", "\n?*is temporarily unavailable", "", False, True)
  411.         Set go8 = CreateTracker("GoUnavailable4", "Capacity limit exceeded, please try later", "")
  412.         Set go9 = CreateTracker("GoUnavailable5", "INSTOF Tempcore OPEN failure", "")
  413.         Set go10= CreateTracker("GoUnavailable6", "This Forum is temporarily\nclosed for maintenance.", "")
  414.         Set go11= CreateTracker("GoUnavailable7", "\n% Forum is at maximum capacity", "")
  415.         Set go12= CreateTracker("GoUnavailable8", "\n?? LOGTWO - Cannot take more than 2 minutes to Log-in", "")
  416.         Set go13= CreateTracker("GoUnavailableHMI1", "\nYour communications software is not able to access this product", "")
  417.         Set go14= CreateTracker("GoUnavailableHMI2", "\nRequested page is empty. Key T for top!", "")
  418.         Set go15= CreateTracker("GoUnavailableHMI3", "\nCIM Only Product   GGG-292", "")
  419.         Set go16= CreateTracker("GoPressCR1", "\nPress <CR> !", "SendCR")
  420.         Set go17= CreateTracker("GoPressCR2", "\nPress <CR> to continue :", "SendCR")
  421.         Set go18= CreateTracker("GoUnknown1", "\n* is unrecognized!", "", False, True)
  422.         Set go19= CreateTracker("GoUnknown2", "\nUnknown service error!", "")
  423.         Set go20= CreateTracker("GoPromptIssue1", "\n\rIssue:")
  424.         Set go21= CreateTracker("GoPromptIssue2", "\nIssue:")
  425.         Set go22= CreateTracker("GoPromptCommodity1", "\n\rCommodity:")
  426.         Set go23= CreateTracker("GoPromptCommodity2", "\nCommodity:")
  427.         Set go24= CreateTracker("GoPromptCompany1", "\n\rCompany:")
  428.         Set go25= CreateTracker("GoPromptCompany2", "\nCompany:")
  429.         Set go26= CreateTracker("GoEmpty", "\nThat page is empty!")
  430.         Set go27= CreateTracker("GoNewsflash", "\nNews Flash:")
  431.         Set go28= CreateTracker("GoEnterChoice1", "\nEnter choice!")
  432.         Set go29= CreateTracker("GoEnterChoice2", "\nEnter choice !")
  433.         Set go30= CreateTracker("GoMore2", Chr$(19)+Chr$(13)+Chr$(0)+Chr$(0)+Chr$(0)+Chr$(0)+"PAGE", "SendCR")
  434.         Set go31= CreateTracker("GoMore3", Chr$(13)+"PAGE", "SendCR")
  435.         Set sysop1 = CreateTracker("GoLibNeeded", "\nThe following Libraries need attention:")
  436.         Set sysop2 = CreateTracker("GoLibNoBlocks", "\nThe Forum Libraries have No Blocks")
  437.         Set sysop3 = CreateTracker("GoSysop", "\nGreetings, SYSOP!", "SetSysop")
  438.  
  439.         ' Try to go
  440.         WhereAmI = ""
  441.         Comms.Send "go " + forum + "\r"
  442.         WaitForPrompt "Go"
  443.  
  444.         ' Capture the newsflash
  445.         If PromptMatches("GoNewsflash") Then
  446.             filename = StartCapture(forum+"/Newsflash CompuServe")
  447.             CaptureText "News Flash"+Basic.Eoln$
  448.             WaitForPrompt "Go"
  449.             CaptureRewind 7
  450.             CaptureText Basic.Eoln$+"!end"+Basic.Eoln$
  451.             Capture CAPTURE_OFF
  452.             b = QueueFile(Session.Service, filename, IM_DELETE)
  453.         End If
  454.  
  455.         ' Capture the library attention messages
  456.         If PromptMatches("GoLib") Then
  457.             sysop1.Active = False
  458.             sysop2.Active = False
  459.             filename = StartCapture(forum+"/Sysop_Logs Library_Attention")
  460.             CaptureText lastmatch
  461.             WaitForPrompt "Go"
  462.             CaptureRewind 7
  463.             CaptureText Basic.Eoln$+"!end"+Basic.Eoln$
  464.             Capture CAPTURE_OFF
  465.             b = QueueFile(Session.Service, filename, IM_DELETE)
  466.         End If
  467.  
  468.         ' Check for a ^G prompt
  469.         If PromptMatches("GoPromptForum1") Then
  470.             On Error Resume Next
  471.             Set t = Wait(2)
  472.         End If
  473.  
  474.         Terminal.Status "GoForum: "+forum
  475.         On Error Goto 0
  476.         Trackers.delete
  477.         SetupStandardTrackers
  478.  
  479.         ' Handle the prompt
  480.         If PromptMatches("GoUnavailable") Then
  481.             LastFailure = forum
  482.             SetHighMessage = False
  483.             If PromptMatches("GoUnavailable1") Then
  484.                 WaitFor "continue:"
  485.                 GoTop
  486.             Else
  487.                 If PromptMatches("GoUnavailableHMI") Then
  488.                     ' Oops!  A HMI forum
  489.                     filename = StartCapture(forum+"/Newsflash CompuServe")
  490.                     CaptureText "New Forum Information"+Basic.Eoln$
  491.                     CaptureText "Virtual Access is currently not able to access this forum. Ashmount"+Basic.Eoln$
  492.                     CaptureText "Research is currently working to rapidly bring this service back to you."+Basic.Eoln$+Basic.Eoln$
  493.  
  494.                     CaptureText "In the mean time you can use the CompuServe Information Manager"+Basic.Eoln$
  495.                     CaptureText "available in GO CIMSOFT forum."+Basic.Eoln$+Basic.Eoln$
  496.  
  497.                     CaptureText "More details about this new forum product is available in GO NEWFORUM."+Basic.Eoln$
  498.                     CaptureText "If you have any questions, GO FEEDBACK or send mail to CompuServe"+Basic.Eoln$
  499.                     CaptureText "Customer Service at 70006,101."+Basic.Eoln$
  500.                     CaptureText "!end"+Basic.Eoln$
  501.                     Capture CAPTURE_OFF
  502.                     b = QueueFile(Session.Service, filename, IM_DELETE)
  503.                     If PromptMatches("GoUnavailableHMI1") Then Comms.Send Chr$(3)+"T\r"
  504.                     If PromptMatches("GoUnavailableHMI2") Then Comms.Send "GO TOP\r"
  505.                 End If
  506.                 WaitFor "\n!"
  507.             End If
  508.             LogResult "GoForum:"+forum+":Failed - unavailable."
  509.             Exit Function
  510.         End If
  511.         If PromptMatches("GoUnknown") Or PromptMatches("GoEmpty") Then
  512.             LastFailure = forum
  513.             SetHighMessage = False
  514.             GoTop
  515.             LogResult "GoForum:"+forum+":Failed - unknown."
  516.             Exit Function
  517.         End If
  518.  
  519.         ' It all worked
  520.         WhereAmI = forum
  521.     End If
  522.  
  523.     LastFailure = ""
  524.     GoForum = True
  525.     Exit Function
  526.  
  527. GoForum_error:
  528.     On Error Goto 0
  529.     LogResult "GoForum:"+forum+":Failed error: "+Error$+" ("+LTrim(Str$(Err))+")"
  530.     Trackers.delete
  531.     SetupStandardTrackers
  532. End Function
  533.  
  534.